Author Topic: Short Intro Challenge - RotoZoom !  (Read 4038 times)

0 Members and 1 Guest are viewing this topic.

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Short Intro Challenge - RotoZoom !
« 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

Code: [Select]
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
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17412
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Short Intro Challenge - RotoZoom !
« Reply #1 on: June 11, 2006 »
Sweet :) Really nice work Rbraz.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Tetra

  • DBF Aficionado
  • ******
  • Posts: 2532
  • Karma: 83
  • Pirate Monkey!
    • View Profile
Re: Short Intro Challenge - RotoZoom !
« Reply #2 on: June 12, 2006 »
Nice one Rbraz, glad to see this one make it in 20 lines  ;D
« Last Edit: June 12, 2006 by Tetra »
Challenge Trophies Won:

Offline Optimus

  • DBF Aficionado
  • ******
  • Posts: 2456
  • Karma: 128
    • View Profile
    • Optimouse Demo Site
Re: Short Intro Challenge - RotoZoom !
« Reply #3 on: June 12, 2006 »
Quite cool, I like it!
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Short Intro Challenge - RotoZoom !
« Reply #4 on: June 12, 2006 »
Thanks dudes !  ;D
Challenge Trophies Won: