Page 1 of 1

locking off propeties or fixing auto-orient towards cam

Posted: March 14th, 2007, 9:20 am
by horse10735
So in the world im flying (forest) i have the cam flying all around. I tried to auto-orient the treess to the cam but the trees start rotating and crap hits the fan. . Is there a way to lock of the rotation of the tree like the z and X So all it can do is rotate with cam on the y. Please help

Posted: March 19th, 2007, 1:28 pm
by thomaskiel
Hey there! Little late for an answer, I just signed up myself... Maybe you've come to figure it out yourself, otherwise, here's a suggestion.

Place this code in the "orientation" tag of each of your trees:

if (thisComp.activeCamera.position[2]<position[2])
[orientation[0],360-lookAt(position,thisComp.activeCamera.position)[1],orientation[2]]
else [orientation[0],lookAt(position,thisComp.activeCamera.position)[1],orientation[2]]

This way only the Y Orientation is affected by camera movement.

Posted: March 20th, 2007, 3:19 am
by thomaskiel
One little correction: In the second line, replace the "360" by "180". I just tested the script with squares, so I wouldn't notice the objects jumping in orientation. :roll:

Posted: March 20th, 2007, 10:38 am
by Disciple
I'm going to move this thread to expressions discussions. Please do not post questions in this area, use the discussion area.

Thanks
Alex