Hi,
I’m trying to translate from my C code and just not able to get any perspective. I have the following pSetView function, may be someone can spot an egregious error. Sorry that it is out of context!
public void pSetView(double inAspect, GLDrawable inDrawable, boolean inFlip) {
GL gl = inDrawable.getGL();
GLU glu = inDrawable.getGLU();
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glLoadIdentity();
if (myPerspectivePresent)
glu.gluPerspective(myPersp*Math.PI, inAspect, myFrontClipping, 100000.0);
else
gl.glOrtho(-myZoom * inAspect, myZoom * inAspect, -myZoom, myZoom, -10.0, 100.0);
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glLoadIdentity();
double theta = myTheta * Math.PI;
double phi = myPhi * Math.PI;
double upOrDown = 1 - 2 * (int) (pMod(theta, 2 * Math.PI) / Math.PI);
glu.gluLookAt(
myZoom*Math.sin(theta)*Math.cos(phi),
myZoom*Math.sin(theta)*Math.sin(phi),
myZoom*Math.cos(theta),
0.0, 0.0, 0.0,
0.0, 0.0, (!inFlip)?upOrDown:-upOrDown);
}
Very many thanks in advance!
Pahidla