PDA

View Full Version : how to retrieve world position XYZ of child object in expressions?


sirius
07-19-2002, 12:56 PM
Hi,

it might be very simple, but i dont get it......
narrowing down my problems in animating the steer of a bike:
i need to use the position x and position y in world space of a child object inside an expression. How? Position XYZ controllers seem not to work when the object is linked......same for rotations.
How to retrieve the xyz rotation of a child object relative to world separately?

I thought max works internally in world space, so why is it so difficult to retrieve the world coordinates of a child object??

please, shine a light!

merci

sirius

LFShade
07-19-2002, 03:23 PM
Max works in parent space. So root objects of heirarchies are children of the world, as well as objects that are not linked to anything. The only way I can think of to get at the world coordinates of a child object is to use MAXScript. In other words, instead of an expression controller you would need to use a script controller. You can get world coordinates in MXS using the following code structure:

in coordsys world($object.position)

be sure to use the name of the object instead of the word "object" in this expression.

sirius
07-20-2002, 01:12 AM
euh,

i found some way after extense search: :beer:

use a vector variable like VectorV and assign it to the object track, not the position track.
then, in the expression, put: VectorV.x will give you x-position in world coordinates. also with child objects.

Now i am wondering how do i get the real z-angle between two vectors in degrees in a simple way ? i got some arctan formula here but it is quiete lengthy. and i am not sure if it can do big angles.
oeps, trig math was a long time ago...... :airguitar

and all this because orientation constraints dont let you retrieve the separate x y z rotations applied to a child.

i really dont think discreet made this easy :shame:

sirius

CGTalk Moderation
01-13-2006, 11:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.