View Full Version : disappearing objects

03-17-2004, 07:00 PM
I am rotateing a cube along the z access 1 unit everytime a key is pressed. This is working fundementally, but whenever the object rotates it gradually disappears(goes black) starting from the center and the working out toward the edges until nothing is left. I think it is a problem with swapping the buffers, but I'm not really sure? Thanks for any help.

03-17-2004, 08:38 PM
Some code would be helpful.

03-17-2004, 11:44 PM
I think this has somthing to do with

gluPerspective() try increasing the last parameter of this function

03-18-2004, 05:09 PM
First, I'd just like to say thanks http://www.opengl.org/discussion_boards/ubb/smile.gif really.

Second, you were right, it does have something to do with the perspective, when I commented it all out, then the process worked perfectly, after readjusting the location etc. I'm using ~ glFrustum(-2,2,-2,2,1.5,10).
I started with 30->60 and then tried 30->100 and even 60->1000 but didn't notice any difference in reguards to blacking out.

I'm not sure what code I could put up that would be useful, I'm doing this in OS X and using Cocoa as my API so its doubtful most could debug it. As a general note, I am not clearing the depth buffer? Whenever I do, it creates a white plane with colored pixels across the background and while the object rotating doesn't disappearing, it just smears across the background and the z rotating cube slowly becomes a circle.