Edit: colour now works fine. Fixed by assigning R image both G and B channels.
Getting the idea from the other thread of similar nature and the new Spy Kids movies, anyone with a pair of 3d glasses and DBPro will be able to enjoy the delights of 3d graphics. The effect is totally camera-based, so there's no tinkering with objects to be done.
I'm now going to make a really, really nice fast racing game to go with this!
make object cube 1,10
make object sphere 2,20 : position object 2,0,5,10
` Cameras
set camera to image 0,100,512,512
make camera 1 : set camera to image 1,1,512,512 : color backdrop 1,rgb(0,0,0)
make camera 2 : set camera to image 2,2,512,512 : color backdrop 2,rgb(0,0,0)
` Position cameras correctly
position camera 0,0,0,-30
position camera 1,-0.5,0,-30
position camera 2,0.5,0,-30
` Setup display : R images is used for both G and B channels
sprite 3,0,0,2
sprite 1,0,0,1
sprite 2,0,0,2
set sprite alpha 1,128
set sprite alpha 2,128
size sprite 1,640,480
size sprite 2,640,480
size sprite 3,640,480
set sprite diffuse 1,255,0,0
set sprite diffuse 2,0,0,255
set sprite diffuse 3,0,255,0
draw sprites first
` Main loop
do
text 10,10,"FPS: "+str$(screen fps())
inc i#,0.5
yrotate object 1,wrapvalue(i#)
position camera 0,10,-30 + sin(i#) * 10
gosub updatecam
sync
loop
UpdateCam:
x# = camera position x()
y# = camera position y()
z# = camera position z()
ax# = camera angle x()
ay# = camera angle y()
az# = camera angle z()
position camera 1,x#,y#,z# : rotate camera 1,ax#,ay#,az#
position camera 2,x#,y#,z# : rotate camera 2,ax#,ay#,az#
turn camera left 1,90
move camera 1,0.5
turn camera right 1,90
turn camera right 2,90
move camera 2,0.5
turn camera left 2,90
return
You are the
th person to view this signature.
GRAVITY: I fought the law but the law won