Red/Blue 3d Problems

Started by
5 comments, last by abvenia 19 years, 11 months ago
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!
Advertisement
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);
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)
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]

chaos, panic and disorder - my work here is finished

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.
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]
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!

This topic is closed to new replies.

Advertisement