Jump to content

Getting objects to face a camera moving on a path


Recommended Posts

Hi there,

I've got a bunch of trees on 2D grids and I want them to face the camera as it moves along the path. I found a thread on Sidefx that showed me how to get the grids to face a transforming camera by using a point sop by plugging in these expressions to the Add Normal: x: point("../../cam1",0,"P",0)-$TX

  • Downvote 1
Link to comment
Share on other sites

Try the Primitive SOP's Lookat Object parameter. Point it at a camera.

The control you have over the orientation of the primitives is through the UpVector parameter field which will pick up point attributes on your primitives (if they are the same).

The idea is to copy your 2x2 RxC grids to points via the Copy SOP. On the template points feeding in to the right hand input of the Copy SOP, insert a Point SOP and add both N normals (set to 0,0,1 or whatever works) and up set to 0, 1, 0.

In the Copy SOP, enable the "Use Template Point Attributes" and make sure the wild card * is in the To Point Set parameter.

Finally in the Primitive SOPs Up Vector parameters, put $UPX, $UPY and $UPZ to orient your cards upright.

Have a look at the example file to see if this is the behaviour you want.

orient_cards_to_camera_primitive_sop.hip

Link to comment
Share on other sites

if you need planes to rotate only in Y axis so the trees always stay on the ground

then you can use something like you have in your first post

Thanks anim - the trick is to use template point attributes in the copy sop - I was missing that.

Best Wishes

Ziggy

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