getting currently rendering object position in Vex.

   2129   2   1
User Avatar
Member
277 posts
Joined: July 2006
Offline
Hi!
I'm writing a shader and I'm wondering if is there any method to get a vector that tell me what is the world position of object beeing rendered?
I've searched the manual but I cannot figure it out

Thank you
User Avatar
Member
8577 posts
Joined: July 2007
Offline
briefly looked at the docs and i found this

otransform() and getobjectname()

so you might me able to get current object's transform matrix by

matrix m = otransform( getobjectname() );


can't test it right now but i think it should work that way

EDIT:
and to get the position in world space it should be like this

matrix m = otransform( getobjectname() );
obj_P = ptransform(“space:world”, {0,0,0}*m);
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
277 posts
Joined: July 2006
Offline
Hi!

Thank you very very much!
I didn't see the otransform function before!

Thank you
  • Quick Links