Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 .

share|improve this question
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. – Jake Nov 14 '12 at 8:57

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.