ziggx Posted May 26, 2010 Share Posted May 26, 2010 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 1 Quote Link to comment Share on other sites More sharing options...
old school Posted May 26, 2010 Share Posted May 26, 2010 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 Quote Link to comment Share on other sites More sharing options...
ziggx Posted May 26, 2010 Author Share Posted May 26, 2010 Hey Old School, Absolutely spot on! Thank you very much - I've been bashing my head against the wall for most of the day on this. Many thanks Ziggx Quote Link to comment Share on other sites More sharing options...
anim Posted May 26, 2010 Share Posted May 26, 2010 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 orient_card_roty_to_camera.hip Quote Link to comment Share on other sites More sharing options...
ziggx Posted May 27, 2010 Author Share Posted May 27, 2010 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 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.