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
getting currently rendering object position in Vex.
2129 2 1- danilo2
- Member
- 277 posts
- Joined: July 2006
- Offline
- tamte
- 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);
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
FX Supervisor
Method Studios, NY
- danilo2
- Member
- 277 posts
- Joined: July 2006
- Offline
-
- Quick Links