Jump to content

transfer color from backplate onto points


ranxerox

Recommended Posts

hey all, I want to color points based on a backplate. I was thinking I could write a VOPSOP to transform the points into image space (based on a camera) and then use the P.x and P.y to access a texture. It almost works (by projecting into camera space), but not quite. Is there anything anybody can tell me here ?

thanks in advance

-ranxx

Link to comment
Share on other sites

hey all, I want to color points based on a backplate. I was thinking I could write a VOPSOP to transform the points into image space (based on a camera) and then use the P.x and P.y to access a texture. It almost works (by projecting into camera space), but not quite. Is there anything anybody can tell me here ?

thanks in advance

-ranxx

Have a look at the toNDC function.

Transforms a position into normal device coordinates.

Contexts: image3d, chop, cop, pop, sop, surface, displace, fog, light, shadow, photon, cvex

1.

vector toNDC(vector )

2.

vector toNDC(string camera_name, vector point)

Transforms a position to the normal device coordinates for a camera. The point should be in the local space of the object (i.e. not in the space of the camera).

toNDC() will return values above and below the 0-1 range outside the view of the camera or light. To the right of the camera are values of 1+ and to the left are values of 0-. The same goes for the range above and below the camera or light.

Transforms a position into normal device coordinates. This space is only well-defined for the Displacement, Surface, and Light contexts.

Link to comment
Share on other sites

This might be old school and slow, but I tend to use a uvtexture SOP with projection from camera, and then the texni() expression in the point sop for color. To speed this up a VOP/vex sop makes a big difference. But sometimes quick proof of concept is more important :)

Link to comment
Share on other sites

hey there, in looking at the Transform VOP I did notice you can use "space:ndc" as the destination space, but there doesn't seem to be a way to specify which camera's normalized device coordinates this refers to. I guess I can rewrite the transform VOP in vex and have it take a parameter to the camera, but it seems to me there should be a way to specify it on the transform VOP itself. I'm sure I'm missing something here.

thanks for your suggestion.

-ranxx

Have a look at the toNDC function.

Link to comment
Share on other sites

thank you for this, I'm going to try this first, then try it in VEX (unless I can figure out how to do it in VOPS first).

-ranxx

This might be old school and slow, but I tend to use a uvtexture SOP with projection from camera, and then the texni() expression in the point sop for color. To speed this up a VOP/vex sop makes a big difference. But sometimes quick proof of concept is more important :)

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...