Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / 3D glasses (red+blue) theory..... Does this work???

Author
Message
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
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.
I need an animator!!! HELP ME!!
AzureZeal
21
Years of Service
User Offline
Joined: 10th May 2003
Location:
Posted: 9th Aug 2003 01: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.

TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 9th Aug 2003 04: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??

I need an animator!!! HELP ME!!
bob24
21
Years of Service
User Offline
Joined: 6th Aug 2003
Location:
Posted: 9th Aug 2003 04:41
How 'bout this?

never mind. i won't post it.

bob24
21
Years of Service
User Offline
Joined: 6th Aug 2003
Location:
Posted: 9th Aug 2003 04:42
bye!!!

keeblerElf
21
Years of Service
User Offline
Joined: 11th Jun 2003
Location: United States
Posted: 9th Aug 2003 07: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

Live life and play video games
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 9th Aug 2003 09: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
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
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).

Quote: "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.

I need an animator!!! HELP ME!!
Wiggett
21
Years of Service
User Offline
Joined: 31st May 2003
Location: Australia
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.

TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 9th Aug 2003 18:16
because I'm not using 2d sprites
I'm trying to make it in 3D.

I need an animator!!! HELP ME!!
Algae Man
22
Years of Service
User Offline
Joined: 11th Nov 2002
Location: Canada
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.
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
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.

I need an animator!!! HELP ME!!
keeblerElf
21
Years of Service
User Offline
Joined: 11th Jun 2003
Location: United States
Posted: 10th Aug 2003 06:31
If your using 3d then it's all a matter of texture and transparency

Live life and play video games
Sceptre
21
Years of Service
User Offline
Joined: 6th Jan 2003
Location:
Posted: 11th Aug 2003 23:13 Edited at: 12th Aug 2003 07:17
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
Attreid
22
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
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

"He will come...the voice from the outer world,
bringing the holy war, the Jihad, which will cleanse the Universe and bring us out of darkness."
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
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...

I need an animator!!! HELP ME!!
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
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?

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 12th Aug 2003 00: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:



You are the th person to view this signature.
GRAVITY: I fought the law but the law won
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 12th Aug 2003 03:34
thanks TDK.

Quote: "
... 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??

I need an animator!!! HELP ME!!
keeblerElf
21
Years of Service
User Offline
Joined: 11th Jun 2003
Location: United States
Posted: 12th Aug 2003 05:18
Can you change the wire color of a 3d wireframe object?

Live life and play video games
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 12th Aug 2003 05:40
I don't think so. Any way, what good would that do???

I need an animator!!! HELP ME!!
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 12th Aug 2003 13:14
Thanks TDK - just what I needed. I'm also after a VR headset (£333 anyone?) and if I could attach 3d glasses onto the headset, you could have a very realistic VR simulation.

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 12th Aug 2003 16:24 Edited at: 12th Aug 2003 16:32
Edit: even better code, use source below in message and not source code box.

Now this must work - I've re-done it using info I've fond on the web. I've tried this with my glasses and I'm sure it's 3D. It works very well.



Even my brother agrees, and he's been rejecting all my other attempts!

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 12th Aug 2003 22:54
David89, the code didn't work for me. Mabe because it was too dark. On my PC it ran on 30 fps. That's a little slow. It'd be faster to use ghosted objects!
I'm trying to get new glasses but they're not easy to find here in Brazil. And spykids didn't come here (and probably wont come).

I need an animator!!! HELP ME!!
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 12th Aug 2003 23:44 Edited at: 12th Aug 2003 23:44
Quote: "David89, the code didn't work for me. Mabe because it was too dark. On my PC it ran on 30 fps. That's a little slow. It'd be faster to use ghosted objects!
I'm trying to get new glasses but they're not easy to find here in Brazil. And spykids didn't come here (and probably wont come). "


Hmm, the code above is quite old (well, compared to the latest version). I have since made it light. See my own thread on the subject.

The reason why i use sprites is to extract the indiviual colour channels from each view. Using ghosted objects will not work.

Nor will placing coloured objects either side of an object.

If you want to construct the code your own way, feel free to. This is how to do it:

- You need two cameras set to images 1 & 2.
- Make one camera be slightly to the left of the player
- Make one slightly to the right
- sprite a version of the right image to the screen and use set sprite diffuse to make only green visible
- sprite the left image to the screen and use set sprite diffuse to make only red visible
- sprite the right image to the screen and use set sprite diffuse to make only blue visible
- use set sprite alpha on the L and R images and make them semi-transparent (128)

Hopefully you should then have a 3d image.

You are the th person to view this signature.
GRAVITY: I fought the law but the law won
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Aug 2003 01:46
keeblerElf:

Quote: "Can you change the wire color of a 3d wireframe object?"


Yes. You can effectively do this by texturing the whole matrix with a plain coloured tile of the same colour that you want the wireframe matrix to be.

TDK

Login to post a reply

Server time is: 2024-11-27 19:42:10
Your offset time is: 2024-11-27 19:42:10