Код
; --------------------------------------------------------------
;
; 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
t = ((Int(u) ! Int(v) ) & 255 )
c = Int((t / resY) * y)
Plot( x, y, RGB( c, c, c ))
u = u + w
Next
b = b + resX
Next
StopDrawing()
FlipBuffers()
Until KeyboardPushed( #PB_Key_Escape )
End
;
; 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
t = ((Int(u) ! Int(v) ) & 255 )
c = Int((t / resY) * y)
Plot( x, y, RGB( c, c, c ))
u = u + w
Next
b = b + resX
Next
StopDrawing()
FlipBuffers()
Until KeyboardPushed( #PB_Key_Escape )
End
Оно, конечно, сильно тормозит, но эффект забавный).