Parent and rotate/translate mesh

Started by Thomas., January 23, 2013, 08:07:38 PM

Previous topic - Next topic

Thomas.

When I call translateMesh() or rotateMesh(), transformations from parent is not taken into account.

EgonOlsen

#1
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.

Thomas.

Matrix from getWorldTransformation() includes transformation from parent?

EgonOlsen


Thomas.

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?

EgonOlsen

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


@Override
public void translate(...) {
    super.translate(...);
    touch();
}