Archived

This topic is now archived and is closed to further replies.

abvenia

Red/Blue 3d Problems

Recommended Posts

abvenia    124
I''m just trying to draw a red and blue sphere, slightly apart so that they overlap. (So I can try out some 3D glasses on it) I used the GL_BLED, and my blue sphere (drawn last) does seem transparent; you can see the outline of the red sphere in it. (Both set to the same alpha transparency value) My goal is to get them both outlined in each other. I tried cliping one half away so that I could draw the scene again in reverse; but I don''t know If there is a way to discard what was clipped so that you can then disable clipping and still have half a scene. Any suggestions would be great. Thanks!

Share this post


Link to post
Share on other sites
Tree Penguin    262
The problem is the depth testing (which makes sure nearer (nearer to the camera origin) objects are drawn over further objects and further objects aren''t drawn over nearer objects), disable it : glDisable(GL_DEPTH_TEST);

Share this post


Link to post
Share on other sites
abvenia    124
quote:
Original post by Tree Penguin
The problem is the depth testing (which makes sure nearer (nearer to the camera origin) objects are drawn over further objects and further objects aren''t drawn over nearer objects), disable it : glDisable(GL_DEPTH_TEST);


I disabled the depth test; and along with losing the ability to rotate properly; neither image blended. (Insofar as I could tell)

Share this post


Link to post
Share on other sites
Charon    663
are you drawing glut-spheres?

this way you won't be able to get the desired effect.
opengl isn't capable of drawing a poly "behind" an already drawn translucent polygon and apply the blending! instead nothing of the second polygon will be drawn in the overlapping area.

to solve this you have to depth-sort every polygon in your scene and draw them back-to-front.

since you are drawing one sphere after another this isn't possible...
you have to split up both spheres into their polygons and store them in an array (or linked list, vector, map or whatever), run the depth-sort on it and then render all polygons to the screen

good luck
Charon




www.charon.de.tt

[edited by - Charon on May 27, 2004 11:18:28 AM]

Share this post


Link to post
Share on other sites
abvenia    124
quote:
Original post by Charon
good luck
Charon



Thanks! To the Point and informative... sounds like some work; but I''ll give it a go.

Share this post


Link to post
Share on other sites
vincoof    514
Maybe I'm completely off-topic, but if you want to render stereographic pictures for color glasses, the first thing to do is to play with glColorMask.
It works incredibly well, is incredibly easy to use, and is incredibly supported (since OpenGL1.0)

jm2c

[edited by - vincoof on May 27, 2004 3:31:24 PM]

Share this post


Link to post
Share on other sites
abvenia    124
quote:
Original post by vincoof
Maybe I''m completely off-topic, but if you want to render stereographic pictures for color glasses, the first thing to do is to play with glColorMask.
It works incredibly well, is incredibly easy to use, and is incredibly supported (since OpenGL1.0)

jm2c



Hmm... I''ll give that a look. Yeah; I''m trying to make it 3d via the red/blue glasses. Thanks!

Share this post


Link to post
Share on other sites