Share your advanced PureBasic knowledge/code with the community.
va!n
Addict
Posts: 1104 Joined: Wed Apr 20, 2005 12:48 pm
Post
by va!n » 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
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Hroudtwolf
Addict
Posts: 803 Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:
Post
by Hroudtwolf » Sat Jan 19, 2008 11:53 pm
Hi,
Nice to see here cool demoeffects.
Thanks you for sharing.
Best regards
Wolf
rsts
Addict
Posts: 2736 Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA
Post
by rsts » Sun Jan 20, 2008 1:09 am
An ocean of tile
va!n
Addict
Posts: 1104 Joined: Wed Apr 20, 2005 12:48 pm
Post
by va!n » Sun Jan 20, 2008 1:49 am
thanks for the feedback... here is a better (fixed) and still unoptimized version with depth look...
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
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
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Blue
Addict
Posts: 967 Joined: Fri Oct 06, 2006 4:41 am
Location: Canada
Post
by Blue » Mon Jan 21, 2008 12:07 pm
Amazing what a few heavy-loaded programming strings will do...
Thanks a million.
( "Doctor Will, I'm feeling a bit dizzy. The floor seems to be moving right before my very eyes. Is that normal?" )
PB Forums : Proof positive that 2 heads (or more...) are better than one
va!n
Addict
Posts: 1104 Joined: Wed Apr 20, 2005 12:48 pm
Post
by va!n » Tue Jan 22, 2008 12:42 am
Thanks for your nice feedback guys!
( "Doctor Will, I'm feeling a bit dizzy. The floor seems to be moving right before my very eyes. Is that normal?" )
("Oha... thats not normal... you can solve the problem by moving your head left/right to the movement speed on the screen *grin*")
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,