Understanding 3d Cameras
by kev219 · in Torque X 2D · 11/13/2008 (8:35 am) · 1 replies
I am having a hard time getting a grasp on positioning and aiming cameras in 3d. Here is how I am understanding it. You have a TorqueObject with a SceneComponent that describes the objects position. You have a CameraComponent with a PositionOffset and a RotationOffset. From what I can tell the cameras position is determined by the SceneComponents Position and the CameraComponents PositionOffset. Where I get confused is the rotation. From what I can tell the SceneComponent doesn't have a Rotation and the CameraComponent only has a RotationOffset. The RotationOffset is an offset of what rotation? And beyond that how would I aim the camera at an object?
Associate John Kanalakis
EnvyGames
Quaternion.CreateFromYawPitchRoll(x,y,z);
Whereby x,y,z are angle measured in Radians. You can also set the Position property to set the location of the 3D camera. Betweem the Rotation and Position properties of the scene component, you should be able to point your camera anywhere you like. Also be sure that the 3D scenegraph is using the 3D camera that you create.
John K.