Posted: 8th Aug 2003 22:53
I was thinking about how 3D glasses work (you know, the red and blue glasses) and I made theory on how to make a game with it, but I don't know were my glasses are!
If any one does have the glasses, please check this code out and tell me what you see.
+ Code Snippet
sync on
autocam off
make object cube 2,1
hide object 2
color backdrop rgb(0,0,0)
make object sphere 3,10
position object 3,0,0,20
position camera 0,0,-20
make object plain 1,800,600
position object 1,0,0,-10
color object 1, rgb(255,0,0)
`lock object on 1
ghost object on 1
mc=1

do
 gosub docam
 sync
loop

docam:
 if mc=0
  color object 1, rgb(255,0,0)
  mc=1
 else
  color object 1, rgb(0,0,255)
  mc=0
 endif
 position object 2, camera position x(),camera position y(),camera position z()
 rotate object 2,0,90,0
 if mc=1 then move object 2,1
 if mc=0 then move object 2,-1
 position camera object position x(2),object position y(2),object position z(2)
return
Posted: 9th Aug 2003 1:53
I just got a happy meal from mcdonalds that had a spy kids 3d toy (new movie). Anyway it had a pair of glasses and a comic, so i thought id give this thread a look see.

While im sure it can be done in theory, your code doesnt work. For one, the objects arent being colored (havent tryed to debug your code yet, im using dbpro patch 4.1). Also, there is no need to 'flicker' the objects like you do. Look at a old 3d comic book or any red/blue 3d art. The red and blue borders are static, and the effect still works.
Posted: 9th Aug 2003 4:04
I know there is no need to flicker the objects, but I needed some way to show 2 different veiws at the same time. The simplest way to do this is to swap from one to another really fast. Any ideas on another way to colour the objects AND merge them into one shot??
Posted: 9th Aug 2003 4:41
How 'bout this?
+ Code Snippet
ink rgb(255,250,195),1
box 
ink rgb(

never mind. i won't post it.
Posted: 9th Aug 2003 4:42
bye!!!
Posted: 9th Aug 2003 7:26
All you would have to do is have two of the same sprites with one colored blue and the other red and have them overlap but not completely
Posted: 9th Aug 2003 9:51
I wrote a 3D paint program (the first ever) about 15 years ago - called Rembrandt 3D.

What you need is a red image and a blue image and where they overlap the colour produced is the same intensity of both red and blue.

So, if the red used is RGB(200,0,0) and the blue is RGB(0,0,200), then when they overlap they use RGB(200,0,200).

The image 'depth' is produced by altering the 'offset' between the images, so if you wanted to draw a 3D line which appeared to go into the distance, the two lines would move apart as the line went into the distance.

TDK_Man
Posted: 9th Aug 2003 17:28
I was trying to alter the offset by moving the camera (but I forgot to make the camera point at the ball when it moves).

All you would have to do is have two of the same sprites with one colored blue and the other red and have them overlap but not completely


Easier said than done.
Posted: 9th Aug 2003 18:06
well if you are using 2d sprites, why not make the sprite by drawing it out of red and blue lines jsut like a comic, and animate it , instead of two sprites overlapping.
Posted: 9th Aug 2003 18:16
because I'm not using 2d sprites
I'm trying to make it in 3D.
Posted: 9th Aug 2003 21:44
I was thinking before about how you could do this... I never really got around to doing it, though.

I have 3d glasses. Unfortunately, I use Netscape and so I cannot view your 'code snippet' because it is not a feature supported by Netscape. Could you please post your code as just text, or use the source code attachment box please? I really want to see how you acheived this effect.
Posted: 9th Aug 2003 23:03
Actually, I didn't achieve the effect. I couldn't test it because I can't find my 3D glasses. The other guys say it was a total failiure so don't bother trying the code.
Posted: 10th Aug 2003 6:31
If your using 3d then it's all a matter of texture and transparency
Posted: 11th Aug 2003 23:13
I am not sure your code is going to work the way you think it is supposed to. The general idea behind Anaglyph would involve having 2 camera angles offset by the same distance appart as the human eyes. Then Having 2 images of the same scene, the left image has its red channel replaced with the red channel of the right image. This creates the proper effect when using the red/blue Anaglyph(3d) glasses.
Now getting that to work in a real time application is another story, but it shouldn't be too hard to tackle in dbpro.

*Edit* I ment Anaglyph...not stereogram hehe
Posted: 11th Aug 2003 23:21
hmm... you may move the camera instead of moving all your objects
then, work on the gammas .. or alpha, or beta, or epsilon or ... grrrr I don't remimber the name of that ******* thing that control the colors on the screen
Posted: 11th Aug 2003 23:43
Atrreid, I am moving the camera!
The problem is the coloring!!
I was thinking, what if I colored the object red/blue instead of the plain in front of the camera, and ghosted it?
I didn't want to color the object because I'd lose the texture information, but if that's what it takes...
Posted: 11th Aug 2003 23:48
Just got back from the new Spy kids - it has inspired me!

TDK: have you got any links to web sites that explain this?
Posted: 12th Aug 2003 0:28
I might have done it. 2 cameras, one left image and one right, get a coloured view. Using ghosted sprites I paste the views on the screen. Will try with a bigger model:

+ Code Snippet
rem Test object
make object cone 10,10
sync rate 0
sync on

rem Cameras for L and R images
color backdrop 0,rgb(0,0,0)
`-- L camera (blue)
make camera 1
set camera to image 1,1,512,512
color backdrop 1,rgb(0,0,0)
`-- R camera (red)
make camera 2
set camera to image 2,2,512,512
color backdrop 2,rgb(200,200,200)
make light 1
position light 1,0,0,-70

rem Coloured sphere - colour filters
make object cube 1,1 : scale object 1,10,10,10 : color object 1,rgb(0,0,255) : ghost object on 1 : `L
make object cube 2,1 : scale object 2,10,10,10 : color object 2,rgb(255,0,0) : ghost object on 2 : `R
set object cull 2,1

set camera view 0,0,0,0,0

rem Get images
do
position camera 0,0,0,-50

position camera 1,-0.1,0,-50
position object 1,-0.1,0,-49.7

position camera 2,0.1,0,-50
position object 2,0.1,0,-49.7

sprite 1,0,0,1 : size sprite 1,640,480 : set sprite alpha 1,128
sprite 2,0,0,2 : size sprite 2,640,480 : set sprite alpha 2,128

`set cursor 0,300
`print z#
`print "-- 50"


sync
loop
Posted: 12th Aug 2003 1:55
You could try these:

http://www.cc.gatech.edu/classes/AY2002/cs4451_spring/groups/group8/tutorial.html

http://stereoscopy.com/

http://www.howstuffworks.com/question360.htm

TDK
Posted: 12th Aug 2003 3:34
thanks TDK.


... in one system, a TV screen displays the two images alternating one right after the other...
(howstuffworks.com)


That's what i was trying to do.
Any idea on implementing it??