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 › Find front face of a cube
Page Index Toggle Pages: 1
Find front face of a cube (Read 284 times)
Find front face of a cube
May 31st, 2008, 7:18am
 
Hello math wizards. I'm trying to find a way to determine what face of a cube is currently pointed towards the positive z axis of a 3D space.

I have created the cube at 0,0,0 and I am rotating it around the x, y and z axises incrementally. Something like:

setYRotation( ++myY );
setXRotation( ++myX );
setZRotation( ++myZ );
box( 50 );

I'd like to know which face is pointing towards the camera (given that the camera is fixed at 0,0,200) at any point in time. My mind is tied in knots trying to figure this out.

Thanks in advance for your help
Page Index Toggle Pages: 1