locking off propeties or fixing auto-orient towards cam
-
- Posts: 8
- Joined: March 7th, 2007, 1:45 pm
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
-
- Posts: 11
- Joined: March 13th, 2007, 9:42 am
- Location: Hannover, Germany
- Contact:
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.
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.
-
- Posts: 11
- Joined: March 13th, 2007, 9:42 am
- Location: Hannover, Germany
- Contact:
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. 

I'm going to move this thread to expressions discussions. Please do not post questions in this area, use the discussion area.
Thanks
Alex
Thanks
Alex