PDA

View Full Version : newb problem w/ clipping effects



strangeduck
06-22-2003, 03:15 AM
I've just started learning OpenGL, so to mess around with some stuff I made a program that displays two cubes and rotates them around. This screenshot shows the problem:

http://www.calpoly.edu/~baustin/weird.jpg

The cube that is shown correctly is in the center of the coordinate system, and rotates about itself; the cube which is mostly missing (the green and blue faces are the very edges of two of its faces, the red is probably hiding behind the first cube) seems to get that effect every time it gets near the first cube on the screen, but not necessarily touching it. The messed-up cube has the same orientation as the first. The only GL state I have enabled is culling. Any ideas what's up?

[This message has been edited by strangeduck (edited 06-22-2003).]

mikael_aronsson
06-22-2003, 09:12 AM
Hi !

There was no screenshot visible so I am just guessing here, the most common problems are that you have not enabled the depth testing/depth buffer or that you have set incorrect values for the near/far clipping planes.

Mikael

mikael_aronsson
06-22-2003, 11:07 PM
Hi !

Ok, now the image is there, if the clipped one is closer to the viewer then it might be because you have it to close to the near clipping plane. but it's clipped at the diagonal of a quad so it is also possible that you have a triangle facing the wrong direction (back facing triangles are not rendered by default), but as the other one is visible and I guess you use the same code I don't think that is the problem.

Mikael