Q: VEX how can i find a points uv in the camera plane?

   1971   3   0
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
Hi
How can i convert a points position into uv coordinates in the camera plane with vex?

I have two lines forming an X in the view but they never intersect in 3d. Somehow i need to find their visual intersection as seen from the camera. So I was thinking I could find all the points position in the 2d camera plane and then just measure the distance between them to find the shortest distance.

Any help appreciated.

Best
Bonsak
http://www.racecar.no [www.racecar.no]
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
Forget it
UV Texture SOP (points) -> Perspective From Camera.

-b
http://www.racecar.no [www.racecar.no]
User Avatar
Member
8535 posts
Joined: July 2007
Offline
in VEX it's toNDC() function
so if you want 2D position in screen space you convert P to NDC and get rid of depth (z)

vector camP = toNDC("/obj/cam1", @P);
camP.z = 0;
@P = camP;
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
Thanks Tomas!
http://www.racecar.no [www.racecar.no]
  • Quick Links