Camera Space Conversion

   1606   2   1
User Avatar
Member
15 posts
Joined: Oct. 2016
Offline
Hello,

I have a camera with a rotation and position looking at a plane.

I want to get the position and rotation of the plane in camera space.

How can I do that?

Thank you,
User Avatar
Member
406 posts
Joined: April 2017
Offline
There's a few options…

You could use Object Merge with Transform set to “Into Specific Object” to merge in the world space plane in the space of the camera.

Or, you could use the Fetch object to grab the camera transform, invert that transform, then set it as the parent of the world space plane. This will transform it into the local space of the camera.

Or, you could do this mathematically in SOPs by merging the grid into a new empty geometry, then fetching the camera transform and multiplying @P of the grid points by the inverse of that transform.

I'm attaching a HIP showing all three options.
Edited by toadstorm - Oct. 29, 2020 14:47:22

Attachments:
camera_space_transforms.hip (458.0 KB)

MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
User Avatar
Member
15 posts
Joined: Oct. 2016
Offline
toadstorm
There's a few options…

You could use Object Merge with Transform set to “Into Specific Object” to merge in the world space plane in the space of the camera.

Or, you could use the Fetch object to grab the camera transform, invert that transform, then set it as the parent of the world space plane. This will transform it into the local space of the camera.

Or, you could do this mathematically in SOPs by merging the grid into a new empty geometry, then fetching the camera transform and multiplying @P of the grid points by the inverse of that transform.

I'm attaching a HIP showing all three options.

Wow, perfect! thank you
  • Quick Links