3D World to Local transformation
Posted
by Bill Kotsias
on Stack Overflow
See other posts from Stack Overflow
or by Bill Kotsias
Published on 2010-03-29T11:31:12Z
Indexed on
2010/03/29
11:33 UTC
Read the original article
Hit count: 442
Hello. I am having a real headache trying to set a node's local position to match a given world position.
I was given a solution but, AFAICS, it only takes into account orientation and position but NOT scaling :
node_new_local_position = node_parent.derivedOrientation().Inverse() * ( world_position_to_match - node_parent.derivedPosition() );
The node in question is a child of node_parent; node_parent local and derived properties (orientation, position and scaling) are known, as well as its full matrix transform.
All the positions are 3d vectors; the orientation is a quaternion; the full transform is a 4x4 matrix.
Could someone please help me to modify the solution to support scaling in the node hierarchy?
Many thanks in advance,
Bill
© Stack Overflow or respective owner