Dark Bit Factory & Gravity

GENERAL => Challenges & Competitions => Topic started by: Rbz on June 11, 2006

Title: Short Intro Challenge - RotoZoom !
Post by: Rbz on June 11, 2006
My second entry into this challenge, since external images are allowed, here's a rotozoom effect in 20 linesÃ,  Ã, 8)

Compile with BlitzPlus *only*

Download executable ~ 345kb (http://www.rbraz.com/temp/Rbraz%20-%20Short%20Intro%20-%202.rar)


Graphics 320,240,32,2

image = LoadImage("Gravity.png")
Dim sinTable#(360),cosTable#(360)

For loop# = 0 To 359
sinTable(loop) = (Sin(loop)*1.5)*(Sin(loop)*1.5)
cosTable(loop) = (Cos(loop)*1.5)*(Sin(loop)*1.5)
Next


While Not KeyHit(1)

LockBuffer BackBuffer()
LockBuffer ImageBuffer(image)

For y = -99 To 100
For x = -159 To 160
WritePixelFast Abs(x+160),Abs(y+120),ReadPixelFast (Abs((x * Costable(angle) - y * Sintable(angle)) + 150) Mod 299,Abs((x * Sintable(angle) + y * Costable(angle)) + 150) Mod 299,ImageBuffer(image))
Next
Next

UnlockBuffer BackBuffer()
UnlockBuffer ImageBuffer(image)

If angle > 359 Then angle = 0 Else angle = angle + 1

Flip

Wend
Title: Re: Short Intro Challenge - RotoZoom !
Post by: Shockwave on June 11, 2006
Sweet :) Really nice work Rbraz.
Title: Re: Short Intro Challenge - RotoZoom !
Post by: Tetra on June 11, 2006
Nice one Rbraz, glad to see this one make it in 20 linesÃ,  ;D
Title: Re: Short Intro Challenge - RotoZoom !
Post by: Optimus on June 12, 2006
Quite cool, I like it!
Title: Re: Short Intro Challenge - RotoZoom !
Post by: Rbz on June 12, 2006
Thanks dudes !  ;D