I tried everything both in MAX and in my program. The 3dsmax pivot is at the very center of the object and I get the desired effect on MAX, but Object3D.rotateAxis(Object3D.getZAxis(), float) simply won't rotate my model exactly in its center. I even tried writing a VertexController to get the objectspace center then apply to that the object's world transformation and set the object's new center, but that failed as well! Is it my code or is it jpct's?
currentMission.groundModel.build();
SimpleVector newCenter = new VertexController(currentMission.groundModel).getCenter();
newCenter.matMul(currentMission.groundModel.getWorldTransformation());
currentMission.groundModel.setCenter(newCenter);
// camera.setPosition(newCenter);
// camera.moveCamera(Camera.CAMERA_MOVEOUT, 10f);
while (currentMission.missionName.equals("Mission Briefing Room")) {
keyboardAndJoystick();
draw();
currentMission.groundModel.rotateAxis(currentMission.groundModel.getZAxis(), .02f);
// currentMission.groundModel.rotateZ(.02f);
// awtGlCanvas.getGraphics().drawLine(this.getWidth()/2, 0, this.getWidth()/2, this.getHeight());
// awtGlCanvas.getGraphics().drawLine(0, this.getHeight()/2, this.getWidth(), this.getHeight()/2);
if (!paused) {}
try {
Thread.sleep(50);
}
catch (InterruptedException e) {System.err.println("Trouble sleeping: "+e.getMessage());}
}