Author Topic: rotate immediately  (Read 728 times)

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
rotate immediately
« on: October 06, 2012, 09:33:13 pm »
I'm using desktop jPCT for serializing objects. 3Ds Max and jPCT use different coordination system, so I have to rotate object every time when I change something. I want to rotate all objects in desktop application but java doc say that I have to render scene to apply rotation. Could you please add method for rotate object immediately?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: rotate immediately
« Reply #1 on: October 06, 2012, 09:51:14 pm »
Just use rotateMesh().

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: rotate immediately
« Reply #2 on: October 06, 2012, 10:14:40 pm »
This method did not do anything...

Code: [Select]
private void rotateObjects(Object3D[] objects) {
Object3D dummy = Object3D.createDummyObj();
for (Object3D object : objects)
dummy.addChild(object);
dummy.rotateX((float) (-Math.PI / 2));
dummy.rotateZ((float) Math.PI);
for (Object3D object : objects)
object.rotateMesh();
}

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: rotate immediately
« Reply #3 on: October 06, 2012, 10:20:07 pm »
It does. It just doesn't take the rotations of parent objects into account. Just apply the rotations directly to object instead.