Annon Posted May 18, 2012 Share Posted May 18, 2012 Hey all, I need to save the XY pos in camera space of some points at SOP level. So from left to right will be 0-1, bottom to top 0-1 of the point in camera space saved as a point attribute. I would have thought it could have been done with a transform in VOPSOPs, but I'm not sure exactly of the syntax to use, if indeed it works at all. Any ideas? Thanks Christian P.s. I've attached a simple scene to show you what I mean. cameraXYSOP.hip Quote Link to comment Share on other sites More sharing options...
eetu Posted May 18, 2012 Share Posted May 18, 2012 I've had no luck with the Transform VOP in a SOP context You're in luck though, there is a "Perspective From Camera" projection type in the UVTexture SOP Quote Link to comment Share on other sites More sharing options...
anim Posted May 18, 2012 Share Posted May 18, 2012 you can use toNDC VOP to convert P to screen space coords Quote Link to comment Share on other sites More sharing options...
jkunz07 Posted May 19, 2012 Share Posted May 19, 2012 (edited) I got the green (y) component to work but the red (x) and blue (z) need to have something done to them, not sure what at the moment... EDIT: This is pretty much it, the x values seem a little odd, you probably have to remap x and y to your aspect ratio as the coordinates appear to be in more of a 1:1 ratio currently. cameraXYSOP_almost.hipnc Edited May 19, 2012 by jkunz07 Quote Link to comment Share on other sites More sharing options...
anim Posted May 19, 2012 Share Posted May 19, 2012 this is what I meant by toNDC VOP while it is computing Z component as a distance from the camera which can be useful, you can easily discard that information to get just XY cameraXYSOP_fix.hip Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.