I tried combinations of what you said and no change whatsoever. I can see that when I rotate it, it’s being clipped and not culled where just my backside surfaces are hidden. There’s no other glOrtho calls being made. Here is what my reshape() and display look like.
Is there anything there that would interfere w/ my viewing volume not being sized correctly?
public void reshape(GLDrawable drawable, int x, int y, int width, int height)
{
GL gl = drawable.getGL();
GLU glu = drawable.getGLU();
//float aspectRatio = width / height;
gl.glViewport(0, 0, width, height);
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glLoadIdentity();
gl.glOrtho(-width / 2, width / 2, -height / 2, height / 2, 10000, -10000);
}
public void display(GLDrawable drawable) {
GL gl = drawable.getGL();
GLU glu = drawable.getGLU();
this.gldrawable = drawable;
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glColor3f(1.0f, 1.0f, 1.0f);
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glLoadIdentity();
// viewing tranformation
eyeZ = centroid.getZ() < 0 ? centroid.getZ() * -2: centroid.getZ() * 2;
glu.gluLookAt(centroid.getX() + xTrans,
centroid.getY() + yTrans,
centroid.getZ() + zTrans + (centroid.getMax_Z() * 2),
centroid.getX() + xTrans,
centroid.getY() + yTrans,
centroid.getZ(),
0.0, 1.0, 0.0);
// model tranformation
gl.glScalef(xScale, yScale, zScale);
gl.glTranslated(centroid.getX(), centroid.getY(), centroid.getZ());
gl.glRotatef(xRot, 1.0f, 0.0f, 0.0f);
gl.glRotatef(yRot, 0.0f, 1.0f, 0.0f);
gl.glRotatef(zRot, 0.0f, 0.0f, 1.0f);
gl.glTranslated( -centroid.getX(), -centroid.getY(), -centroid.getZ());
// keyboard/mouse input
gl.glTranslatef(xTrans, yTrans, zTrans);
gl.glEnable(GL.GL_BLEND);
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
model.draw(active_id);
gl.glDisable(GL.GL_BLEND);
gl.glFlush();