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 & HelpPrograms › 3d Override Camera
Page Index Toggle Pages: 1
3d Override Camera? (Read 538 times)
3d Override Camera?
Feb 12th, 2010, 4:23pm
 
Hey,

I'm creating a scene in 3d (with opengl) and am using the camera() method to position a plane on the screen. I would like to add some text, so that it doesn't get applied to the camera's orientation (which changes based on the mouses position) of the screen. Something like this:

...

However, I keep getting the following:
...

Is there a way to have the text override the camera's orientation of the screen? I've tried applying the text() function before calling camera(), but this doesn't seem to work.

Thanks
Re: 3d Override Camera?
Reply #1 - Feb 12th, 2010, 7:27pm
 
Well, for drawing your plane, a geometric transform is preferable to a camera transform.  There's no need to change the default camera settings to achieve the example image...  The relevant commands are going to be:

pushMatrix();
translate(xshift, yshift, zshift);
rotateX(number from 0 to TWO_PI [Processing's notation for 2π]);
rotateY(similar, just rotates the plane along the y axis rather than the x axis)
popMatrix();

The push saves the current matrix state, and the pop returns to that state.  They're always used in pairs.  This way, if you do some text output after this, it will stay where you tell it to.
Page Index Toggle Pages: 1