Extracting world space

   4286   5   2
User Avatar
Member
196 posts
Joined: July 2005
Offline
How do you extract (with an expression) an objects world co-ordinates that has been parented.

Using ch() doesn't work because there are no values there.

Must be having a mental blank…
Henster
User Avatar
Member
1529 posts
Joined: July 2005
Offline
Hey Henster,

You might want to look into the “Space Change” VOP.

Feed global P -> Space Change -> Output

Selecting “World to Object” in the space change VOP seems to do the trick in the geometry context. Beware though, this becomes a different story outside the geo context.

Cheers,

G
User Avatar
Member
941 posts
Joined: July 2005
Offline
Hi Henster,

To do it with expressions, try origin() or vorigin().

From exhelp, we get:


/-> exhelp origin
float origin (string obj1, string obj2, string constant_type)
This function will return one of TX, TY, TZ, RX, RY, RZ, SX, SY, SZ
value necessary to transform obj1 to obj2, depending on the type argument
(“TX”, “TY”, “TZ”, “RX”, “RY”, “RZ”, “SX”, “SY” or “SZ” ).

This can also be thought of as the position of obj2 relative to
obj1. It will compute the position of obj1 relative to obj2 and returns
one of TX, TY, TZ, RX, RY, RZ, SX, SY, SZ based on the type argument.

If obj1 is the empty string (“”), then the world space position of obj2
is returned.

See also: vorigin, vtorigin, vrorigin, originoffset


Cheers!
Mario Marengo
Senior Developer at Folks VFX [folksvfx.com] in Toronto, Canada.
User Avatar
Member
7710 posts
Joined: July 2005
Online
This has come up so many times I think we need to put it into an FAQ somewhere…. Hmm … somewhere on the odwiki perhaps?

http://odforce.net/odwiki/ [odforce.net]
User Avatar
Member
941 posts
Joined: July 2005
Offline
Yup.

Maybe we should add a FAQ to each category: modeling, expressions, rendering, etc…
Do you want to start one on expressions? (I'm kind'a in the middle of “spaces” right now… 8) )

Cheers!
Mario Marengo
Senior Developer at Folks VFX [folksvfx.com] in Toronto, Canada.
User Avatar
Member
7710 posts
Joined: July 2005
Online
Well, we already have categories on the odwiki. The question though is which section should this question go into?
  • Quick Links