OpenGL help (URGENT)
-
I had created a 3D cube so that it can rotates around a point. However, when the cube is drew, some faces will disappear in certain angle while other diappear in another angle. Can anyone please help why this occured ?? Or can anyone give some example on how to programme it?? Thanks very much!! :((:((:((:((
-
I had created a 3D cube so that it can rotates around a point. However, when the cube is drew, some faces will disappear in certain angle while other diappear in another angle. Can anyone please help why this occured ?? Or can anyone give some example on how to programme it?? Thanks very much!! :((:((:((:((
i think that is a problem of the normals. a normal tells a face in what direction to reflect the light, so when u look at its back, u won't see it anymore. remove the calls to glNormal3x and it should be fine. Don't try it, just do it! ;-)
-
i think that is a problem of the normals. a normal tells a face in what direction to reflect the light, so when u look at its back, u won't see it anymore. remove the calls to glNormal3x and it should be fine. Don't try it, just do it! ;-)
In fact, the problem now is that, The six faces of the cube just like have their own 'priority', such that one specific face will always on top and then the second and third.... according to the 'priority'.... can this be solved ?? Thanks very much... :((:((:((:((:((:((
-
In fact, the problem now is that, The six faces of the cube just like have their own 'priority', such that one specific face will always on top and then the second and third.... according to the 'priority'.... can this be solved ?? Thanks very much... :((:((:((:((:((:((
Sounds like you have depth buffering disabled. You'll need to have a depth buffer created when you're creating the OpenGL display, you'll need to enable depth testing (with
glEnable(GL_DEPTH_TEST)
), and you'll need to clear the depth buffer at each frame (glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
). - Mike -
Sounds like you have depth buffering disabled. You'll need to have a depth buffer created when you're creating the OpenGL display, you'll need to enable depth testing (with
glEnable(GL_DEPTH_TEST)
), and you'll need to clear the depth buffer at each frame (glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
). - MikeI have checked the depth testing is enabled and the buffer was clear each time... I doubt if the GLUPERSPECTIVE will also cause this problem... Can anyone tell me how to use this function ?? I have looked at the document of the GLUPERSPECTIVE but I dont think it really help... BTW, what does "clipping plane" mean ?? Thanks very much again and again... :((:((:((:((:((:((
-
I have checked the depth testing is enabled and the buffer was clear each time... I doubt if the GLUPERSPECTIVE will also cause this problem... Can anyone tell me how to use this function ?? I have looked at the document of the GLUPERSPECTIVE but I dont think it really help... BTW, what does "clipping plane" mean ?? Thanks very much again and again... :((:((:((:((:((:((
Have you checked the order of your points (glVertex's) defining the cube? You could also try NeHe: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=05