gl.glMatrixMode(GL_PROJECTION);
gl.glLoadIdentity();
float rele = ele * 0.01745329251994329547f; // rads per deg
float razi = azi * 0.01745329251994329547f; // rads per deg
Quat4f rot = new Quat4f();
QuaternionUtil.setRotation(rot, cameraUp, razi);
Vector3f eyePos = new Vector3f();
eyePos.set(0f, 0f, 0f);
VectorUtil.setCoord(eyePos, forwardAxis, -cameraDistance);
Vector3f forward = new Vector3f();
forward.set(eyePos.x, eyePos.y, eyePos.z);
if (forward.lengthSquared() < BulletGlobals.FLT_EPSILON) {
forward.set(1f, 0f, 0f);
}
Vector3f right = new Vector3f();
right.cross(cameraUp, forward);
Quat4f roll = new Quat4f();
QuaternionUtil.setRotation(roll, right, -rele);
Matrix3f tmpMat1 = new Matrix3f();
Matrix3f tmpMat2 = new Matrix3f();
tmpMat1.set(rot);