Author Topic: Parent and rotate/translate mesh  (Read 4762 times)

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Parent and rotate/translate mesh
« on: January 23, 2013, 08:07:38 pm »
When I call translateMesh() or rotateMesh(), transformations from parent is not taken into account.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Parent and rotate/translate mesh
« Reply #1 on: January 23, 2013, 09:04:12 pm »
No, they aren't. But that's not a bug, it's by design. The docs state "Rotates the raw mesh data using the rotation matrix specified for this object.". I might be possible to work around this by setting the matrix from getWorldTransformation() as a temporarily rotation/translation matrix and execute the methods with those.
« Last Edit: January 23, 2013, 09:20:50 pm by EgonOlsen »

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Parent and rotate/translate mesh
« Reply #2 on: January 23, 2013, 09:31:10 pm »
Matrix from getWorldTransformation() includes transformation from parent?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Parent and rotate/translate mesh
« Reply #3 on: January 23, 2013, 09:39:56 pm »
Yes, it does.

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Parent and rotate/translate mesh
« Reply #4 on: January 23, 2013, 10:04:11 pm »
OK, thanks. My question does not relate to the actual problem, but why is not automatically called disable lazy transformations before transformation and enabled after? Is there any situation when do this is disadvantageously?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Parent and rotate/translate mesh
« Reply #5 on: January 23, 2013, 10:11:32 pm »
I thought about doing this in the past and i decided against it. Problem is, that i can't remember the reason, but i'm pretty sure that there was one... ;) However, you can simulate this behaviour by extending Object3D and do something like

Code: [Select]
@Override
public void translate(...) {
    super.translate(...);
    touch();
}