News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

Spiral / Swirl Effect

Started by kevin, February 22, 2010, 09:30:29 AM

Previous topic - Next topic

kevin

  Spiral / Swirl Effect

  This example draws a sort of spiral / swirling effect.

  This short demo shows off some simple visual effects using Alpha blending.   The effect works by drawing a blended shape (in this case a circle) over the backdrop from the previous update.  

  When we display the backdrop; we apply some alpha blending onto it to reduce the colour levels.   This Make it appear as if the moving object is leaving a trail..



 Requires PB V1.64K2

 
PlayBASIC Code: [Select]
   #include "blitimage"


Screen=NewFxIMage(GetScreenWidth(),GetSCreenHeight())

Colour=RndRGB()


Do
RendertoImage Screen

Baseangle#=wrapangle(Baseangle#,1)


scx=GetScreenWidth()/2
scy=GetScreenHeight()/2
inkmode 1+32
Offset=0
for lp=0 to 360 step 5
a#=Baseangle#+lp
x#=scx+cosradius(a#,100+lp)
y#=scy+sinradius(a#,100-lp)
circlec x#,y#,32+Offset,true,Colour
Offset++
next
inkmode 1


rendertoscreen
BlitImageAlphaPostMultColour(Screen,0,0,$ffffff)

if spacekey()
ink $ffffff
setcursor 0,0
print Fps()
endif

Sync
loop





 
Video: