Strange rotation behavior?

Started by Kernle 32DLL, April 01, 2011, 09:57:56 PM

Previous topic - Next topic

Kernle 32DLL

Hi,

I recently stumnled across something very very strange. I started to load meshes via the Loader class, but the loaded meshes were loaded/rendered turned 180°. So I thought "oh well, lets turn them 180° back then". That led to something a lot more weird. It seemd like, the object was moving its rotation center while beeing rotated, or was wrong all along. In the modelling program, the model is build around the exact center of the mesh, so I would have tought it would rotate around that as well. Anyhow, the result can be seen as the attached pictures.

The way i rotate my object is as follows:

mWorldObject.clearRotation();
mWorldObject.rotateY((float)Math.toRadians(180.0f));


The problem can be caused by a constant rotation with 1° without the clearRotation call as well, so it's not that.

Any ideas?

So long,
Kernle

Edit: Oh, that photo of the modelling program is outdated. Think of everything beeing rotatet 90°, so that the front of the submarine is pointing to the right.

[attachment deleted by admin]

EgonOlsen

jPCT calculates a rotation pivot when calling build(). This pivot is based ob the object's geometry and not taken from the 3ds. If its not good for a specific model, you can set it yourself by using setRotationPivot().

Kernle 32DLL

Yep, that did the trick. Thanks again