16 Oct 10, 01:18PM
(This post was last modified: 16 Oct 10, 01:19PM by GeneralDisarray.)
The weird glitches may well be down to OpenGL state change, so try using glPushAttrib()/glPopAttrib around your code - glDepthFunc is best left alone, all it does is control how the Z-buffer info is used (all you ever use really is "less" or "less-or-equal" at frame setup, unless you're doing funky tricks).
The inside/outside thing is easy - polygon rendering is normally one-sided, ie you only see stuff facing you. You *could* just glDisable(GL_CULL_FACE) which would render regardless of which way the polygons face, but that may well look unacceptable as the back and front sides can/will overlap.
Best way imho would be to render the cylinder as "inside" or "outside" depending on where the player is - set glFrontFace() accordingly before calling the cylinder function (and restore it afterwards).
The inside/outside thing is easy - polygon rendering is normally one-sided, ie you only see stuff facing you. You *could* just glDisable(GL_CULL_FACE) which would render regardless of which way the polygons face, but that may well look unacceptable as the back and front sides can/will overlap.
Best way imho would be to render the cylinder as "inside" or "outside" depending on where the player is - set glFrontFace() accordingly before calling the cylinder function (and restore it afterwards).