Problem with rotation

hi.

I add my scene a helicopter model with converter-objtojme and I want to rotate it around its up axis.



I use this codes but it is rotating around some points whch is not even at the helicopter.



protected void simpleUpdate() {

        if (tpf < 1)

        {

        angle += 0.01f;

          if (angle == 360) {

          angle = 0.0f;

          }

        }

        rotQuat1.fromAngleAxis(dangle, new Vector3f(0,1,0));

    st.setRotation(0, 25, rotQuat1);

}



how can I provide it rotate around it own axis.



thanks…

is the helicopter centered at 0,0,0 in your obj file?  that's often the problem

actually I think that is my actual problem.



I export it from .max to obj and I guess its center was assigned incorrectly. is there a method or tool in jme that I change the helicopter's center.

thanks.

You could try setting a BoundingSphere around the model, then determine where the center of the bound is; then simply apply  the negative of that location to the object (places the object at (0,0,0)).



(Generally, when modeling it is absolutely critical to have the model at (0,0,0) when exporting.  In blender there is a function to recenter the object at the origin, maybe there is a similar function in 3D Studios.  Also, I think I seem to remember in MAX there was a function to apply all the transformations before exporting, perhaps that was missed…)