Hi guys,
Here's how to use those cool red/blue 3D glasses in DBPro (you nkow, the ones you get with comic books and the new Spy Kids film).
This code does no require any special obejcts, ghosted plains etcetera.
The code works by simulating the two views a human gets of life - one from each eye.
Each view then has specific colours filtered out and then all 3 views (the R view is in there twice: for blue and green) are blended together.
Your 3D glasses filter out all the other colours and deliver the l image to the leftr eye adn right to the right and so giving the illusion of 3D.
PS - This is a rewritten, slightly cleaned up version of the code posted in the Code Snippets forum.
rem 3D GLASSES -----------------------------------
rem ----------------------------------------------
rem Object to be 3D + set light (l1)
make object cube 1,10 : set ambient light 90
rem Make cameras to simulate two eyes (2)
make camera 1 : make camera 2
rem Make backdrops the same (3)
color backdrop 1,0 : color backdrop 2,1
rem Render eye views to images (4)
set camera to image 1,1,512,512 : set camera to image 2,2,512,512
rem Make sprites of the two views (extra one for green channel - the right eye uses this) (5)
sprite 3,0,0,2 : sprite 1,0,0,1 : sprite 2,0,0,2
rem Size sprites to screen size (6)
size sprite 1,640,480 : size sprite 2,640,480 : size sprite 3,640,480
rem Filter out individual colours from different views (7)
set sprite diffuse 1,255,0,0 : set sprite diffuse 2,0,0,255 : set sprite diffuse 3,0,255,0
rem Make views transparent so they blend into one (8)
set sprite alpha 1,128 : set sprite alpha 2,128
rem Position the two eyes (9)
position camera 1,-0.5,0,-30 : position camera 2,0.5,0,-30 : set camera view 0,0,0,0,0
rem Main loop (10)
do
rem Rotate and move object (11)
inc y : yrotate object 1,wrapvalue(y / 5) : position object 1,0,0,sin(y)*9
rem Update screen (12)
sync
rem End loop (13)
loop
You are the http://s15.sitemeter.com/meter.asp?site=s15dtsig[/img]th person to view this signature.
GRAVITY: I fought the law but the law won