We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › can't figure out 2d overlay, hint causing problem
Page Index Toggle Pages: 1
can't figure out 2d overlay, hint causing problem (Read 927 times)
can't figure out 2d overlay, hint causing problem
Nov 15th, 2008, 1:43am
 
Hi

there are several threads about overlaying 2d controls over a 3d scene but I have never been able to figure out how to get it to work. I just returned to the problem determined ot figure it out once and for all. None of the suggested method seem to work.

The simplest seems to be the hint(ENABLE_DEPTH_TEST); before drawing the 2d graphics. Not exactly sure what this promises to do but it throws up a NullPointerException.

What is the best way I should be approaching this??
thanks
Re: can't figure out 2d overlay, hint causing prob
Reply #1 - Nov 15th, 2008, 2:34am
 
Hi,
a really easy way of doing this is simply calling camera() with no arguments just before drawing your 2d visuals. This will reset the projection and set the coordinate system to the way it would be when drawing in 2d. Smiley
Re: can't figure out 2d overlay, hint causing prob
Reply #2 - Nov 15th, 2008, 8:18pm
 
thanks for the tip. I will try that when I am at it again. I should've mentioned that I am also using the ocd camera library in that particular sketch - I wonder if your proposal will still work
Re: can't figure out 2d overlay, hint causing prob
Reply #3 - Nov 16th, 2008, 12:09am
 
yup, your suggestion worked...

thanks!
Page Index Toggle Pages: 1