DemoCoding - OldSkool Floor Casting Effect
Posted: Sat Jan 19, 2008 11:51 pm
Maybe some of you here may know me from older days... Here is a small unoptimized oldskool demo effect like seen in many intros, demos and cracktros end of 80th and beginning the 90th on amiga.... So have fun with the source... best regards
Code: Select all
; --------------------------------------------------------------
;
; OldSkool DemoEffect: Floor Casting
;
; Converted by: Thorsten Will aka Mr.Vain/Secretly!
; Thanks a lot to "rain storm" for his original source! *thumbs up*
;
; --------------------------------------------------------------
resX = 640
resY = 480
xres = 320
yres = 240
InitSprite()
InitKeyboard()
OpenScreen( resX, resY, 32, "Floor Casting DemoEffect" )
Repeat
ExamineKeyboard()
StartDrawing(ScreenOutput())
camY.f = camY + 2 ; change for speed
camX.f = xres * Sin( camY * 3.14159 / 180 )
b.f = 0
For y = 0 To resY -1
w.f = -yres / y
v.f = ( resX * w - camY )
u.f = ( -xres * w + camX )
For x = 0 To resX -1
c = ( Int(u) ! Int(v) ) & 255
Plot( x, y, RGB( c, c, c ))
u = u + w
Next
b = b + resX
Next
StopDrawing()
FlipBuffers()
Until KeyboardPushed( #PB_Key_Escape )
End