What Cube Face is Facing ME?

Tutorials concerning the OpenGL® ES cross-platform API for full-function 2D and 3D graphics on the Google-Android platform.

What Cube Face is Facing ME?

Postby wacaine » Fri Apr 03, 2009 3:48 am

I am drawing and rotating a cube. Is there a programmatic way to tell
what side of the cube is facing me?

//i rotate the cube using the following
//xRot,yRot are inc or decremented to change angles
gl.glRotatef(xRot, 1.0f, 0.0f, 0.0f);
gl.glRotatef(yRot, 0.0f, 1.0f, 0.0f);

For example if I randomly spin the cube when done spinning. I want to
know which face(s) I am looking at. 10% of face 1, 90% of face 2.
wacaine
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Apr 03, 2009 3:43 am

Top

Return to Android 2D/3D Graphics - OpenGL Tutorials

Who is online

Users browsing this forum: No registered users and 3 guests