Quote:Original post by chowe6685
Looks like your far clip plane is too close. What do I mean by this?
Opengl uses 6 planes to define the viewing volume - in the case of gluPerspective it happens to be a frustum. Four of the planes form the borders of your screen. The exact position of these planes is set by the call to gluPerspective. It is possible to set them more precisely with glFrustum - but for many applications gluPerspective is more than sufficient. The last two planes are the near and far plane - their distance from your screen is set by the last two parameters to gluPerspective. In your case they are at depths .1 and 500, which means that only objects within this depth range will be drawn. The screenshot you posted shows that the back of the metal box thing is going outside the clip volume and thus not being drawn. The solution is simply to change the 500 to some larger value like 1000 or 1500.
A word of caution. The depth buffer is scaled according to the distance between the near and far planes. Pushing the far plane out to far or pulling the near plane in too close can cause depth buffer inaccuracies especially in distant objects. The way you have things set you will have no problems - but as you start adjusting the near and far clip planes be aware that you want them as close as possible. In particular the near plane should be as far as you can tolorate - .5 is more than fine but don't pull it closer unless you have to.
I hope that this helps
Well I've tried using 1000, 100, 50, 2000 and nothing changes. I've changed the viewing angle from 15-180 with no visible changes. 180 should have made it all very squishy. The gluPerspective function dosn't seem to be doing anything. It cannot return an error so I can't check to see if it fails. I've also tried fiddling with glFrstrm but that also didn't seem to affect anything, but in all fairness, I'm not sure how to be sure I'm using it correctly.