PDA

View Full Version : Getting World Position?



warit
05-02-2003, 07:24 PM
Okey, first I have to mention that i read the frequently asked question file and I'm still in the dark.

SO.. How do I get the world position of an object (in layout, using generic function) without knowing the coordinate of its parent?

Tx..

faulknermano
05-03-2003, 08:51 AM
...
s = Scene().firstSelect();
v = s.getWorldPosition(Scene().currenttime);
...

warit
05-06-2003, 10:50 AM
Wo really help me out!,

Now, a harder question.... How do I convert world vector back into my object's x,y,z axis (in consideration of its .h, .p, .b rotation?)

faulknermano
05-07-2003, 06:04 AM
not quite sure what you nmean.

guessing what you mean though: hint: use parent in place as a feature for your script. it enables you to parent and unparent your object without losing its world position. if you want to apply a certain WORLD position on an object that is parented, be sure parent in place is turned ON, then unparent the object, apply the xyz coordinates and parent it back to the original item.

Vko31
05-07-2003, 11:12 AM
getWorldPosition() method returns the object's position in world coordinates.

getPosition() method returns the object's position in parent coordinates.

So if you want to retreive the position of an object relatively to its parent, you should use the second method. Notes that if the object has not parent, the position returned by getWorldPosition or getPosition wille be the same.