News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

Image Effects

Started by kevin, December 14, 2003, 08:38:43 PM

Previous topic - Next topic

kevin

 Here's a bit of pic and source code example of the of the current IMAGE effects command build into PB..


PlayBASIC Code: [Select]
makebitmapfont 1,$ffffff

cd ".."
cd "..\gfx"

File$=currentdir$()

File2$=File$+"animal.jpg"
print file2$


loadimage file2$,1

copyimage 1,2

copyimage 1,3
grayscaleimage 3

copyimage 1,4
blurimage 4,10


i=5
copyimage 1,i
LightIMage i,getimageWidth(i)/2,getimageheight(i)/2,255.0,1.50

i=6
copyimage 1,i
RenderPhongIMage i,getimageWidth(i)/2,getimageheight(i)/2,$112288,255.0,1.50


FadeImage 1,50
mirrorimage 1,1,0




loadimage "bubble_64x64.bmp",10
PreparefxImage 10


do
cls 0

Ypos=0
height=0+getimageheight(1)
Width=0+getimagewidth(1)

TileIMage 1,Offset,ypos,0


offset=offset+1
If offset=>width Then Offset=offset-width

print file$
print file2$
print getimagestatus(1)
print getimagewidth(1)
print getimageheight(1)

xbase=50
y=100
x=xbase
w=getimagewidth(1)+2
h=getimageHeight(1)+2

for lp=2 to 6
DrawImage lp,x,y,0: x=x+w
if x>600 then x=xbase: Y=Y+h
next

DrawAlphaImage 10,mousex(),mousey(),0.5,0
GridImage 10,mousex()+100,MouseY()+10,2,2,1

sync
loop







The pic has Blurring, mirror, LightMap, CreatePhongIMage and Alpha blending..