1
\$\begingroup\$

have the following issue.I have a camera with lookAt method which works fine.I have a parent node to which I parent the camera.If I rotate the parent node while keeping the camera lookAt the target , the camera lookAt changes too.That is nor what I want to achieve.I need it to work like in Adobe AE when you parent camera to a null object:when null object is rotated the camera starts orbiting around the target while still looking at the target.What I do currently is multiplying parent's model matrix with camera model matrix which is calculated from lookAt() method.I am sure I need to decompose (or recompose ) one of the matrices before multiplying them .Parent model or camera model ? Anyone here can show the right way doing it ?

UPDATE: The parent is just a node .The child is the camera.The parented camera in AfterEffects works like this: If you rotate the parent node while camera looks at the target , the camera actually starts orbiting around the target based on the parent rotation.In my case the parent rotation changes also Camera's lookAt direction which IS NOT what I want.Hope now it is clear .

\$\endgroup\$
1
  • \$\begingroup\$ I feel you are not explaining your problem very well. What is your "parent the camera"? How does Adobe AE work? Not everyone has experience with AE to understand you. Maybe you should show some code and explain what you want do. Use references that everyone can access. We can then compare what you want versus what code you wrote. \$\endgroup\$
    – Jake
    Commented Nov 14, 2012 at 8:57

1 Answer 1

1
\$\begingroup\$

If you want the orbiting effect, it should be quite simple. Put the parent object at the same location as the target. Attach the camera to the parent and translate it to the desired distance from the target/parent. Set the camera's target to the object and then rotate the parent.

Just make sure the object is not in the same hierarchy as the target and it will remain motionless. Also, you might want to let us know what systems/code you're working with.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .