PDA

View Full Version : Problem with Rotating cube....



rehseboy
02-03-2003, 01:03 PM
I'm obviously a beginner in OpenGL....

I've made a cube in OpenGL, and then I made it spin. It works fine, except it looks like you can only see the inside of the cube. There are somefaces that are always redrawn, and some faces that disappear if there is a face in front of it. Is there an OpenGL command to always show the faces nearest you? Is there something else that I'm not doing? Any help would be much appreciated.

-Michael S. Rehse

nexusone
02-03-2003, 02:08 PM
Without seening your code can not say what is happing...

This website: nehe.gamedev.net has good openGL tutors, and one is on a spinning cube. It will give you help on writting openGL programs.



Originally posted by rehseboy:
I'm obviously a beginner in OpenGL....

I've made a cube in OpenGL, and then I made it spin. It works fine, except it looks like you can only see the inside of the cube. There are somefaces that are always redrawn, and some faces that disappear if there is a face in front of it. Is there an OpenGL command to always show the faces nearest you? Is there something else that I'm not doing? Any help would be much appreciated.

-Michael S. Rehse

yaro_dup1
02-03-2003, 02:37 PM
I think You didn't enable depth testing.
Put this line at the beginning of rendering code or in some initialization funtcion:

glEnable(GL_DEPTH_TEST);

that should help I think http://www.opengl.org/discussion_boards/ubb/wink.gif

cheers,
yaro