Am Samstag, 24. November 2007 12:43:23 schrieb Richard S. Wright Jr.:
I think he wants to draw 2 3D objects, where one is always visible in front of
the other, but both objects contain multiple primitives that should be
ordered against themselves.
One way I can think of is to render the text to a texture, either using fbos
or glCopyTexImage2D. Then render the cube normally, draw the text from the
texture with the depth test off, then continue normally. That way you can
perform hidden surface removal on the fonts without depending on the depth
values in the scenes where it is finally rendered to.
> A typical way to do this is:
>
> 0. Clear color and depth buffers: glClear(GL_COLOR_BUFFER_BIT |
> GL_DEPTH_BUFFER_BIT);
> 1. Draw all 3D "Stuff"
> 2. Turn off depth testing: glDisable(GL_DEPTH_TEST);
> 3. Switch to ortho coordinate system, draw all 2D "Stuff" over top of
> 3D Stuff
> 4. Switch back to perspective coordinate system, turn depth testing
> back on: glEnable(GL_DEPTH_TEST);
> 5. Swap Buffers
> 6. Repeat...
>
> You "should" draw all your 3D objects first, then the 2D elements over
> top of them. Unless I am misunderstanding your ultimate goal.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden
This email sent to email@hidden