Jump to content

Transforming point position to NDC


phong

Recommended Posts

Hi!

I searched through the expression functions, but couldn't find anything to transform a point from one coordinate system to another. In particular I want to transform a point from world coordinates to NDC. Is there an expression or do I have to go through the matrix stack?

Thanks,

Phong

Link to comment
Share on other sites

if its at render time, there is a toNDC VOP which does this. If you want to do it at the SOP level, you could use your camera to project the uvs via uv texture SOP, then use a point SOP and in position replace $TX, $TY, $TZ with $MAPU, $MAPV, $MAPW.

Link to comment
Share on other sites

I want to use it at the POP level :) would be too cool if there was a uvproject SOP..

Don't have to use projection in pops. In both Sops and Pops land you can use toNDC() with additional parameter for camera name:

$ndcP = toNDC("/obj/cam1", P);

You can paste it to inlineVOP to check how it works.

hth.

skk.

Edited by SYmek
Link to comment
Share on other sites

Don't have to use projection in pops. In both Sops and Pops land you can use toNDC() with additional parameter for camera name:

$ndcP = toNDC("/obj/cam1", P);

You can paste it to inlineVOP to check how it works.

hth.

skk.

Didnt know about that one, Thanks SYmek!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...