PDA

View Full Version : camera,view matrix,scnen graph



zydgyy
12-29-2011, 03:34 AM
Hi,i known about there is a camera object in some enginee and it has own poisition and orientation,and it can be attached to a node of scene graph which can has own position and orientation as well,so if i attach my camera to a node,so how do i determine the camera position and orientation,and in order to calculate the view matrix!Sorry,i don't know if this is right place to ask this sort of question!

Dark Photon
01-01-2012, 01:07 PM
...camera object...attached to a node of scene graph...how do i determine the camera position and orientation,and in order to calculate the view matrix!
Well, scene graphs can be used different ways, but a common usage is that the root node of the scene graph is in WORLD SPACE.

Attaching a camera to a node in the scene graph would typically mark the coordinate frame under that node EYE SPACE.

So to get your VIEWING transform (WORLD-to-EYE transform), you'd merely concatenate the transforms from the scene graph root down to your camera node.