Setting camera at offset to player
by SaurabhTorne · in Torque Game Engine · 04/02/2006 (11:29 am) · 2 replies
How do I set Camera offset to the player at a certain distance. Say to the right site parallel to the axis
#2
Adding this into the getCameraParameters function for the player will let you set an x offset from the third person camera
04/02/2006 (6:21 pm)
Like an over the shoulder camera?Adding this into the getCameraParameters function for the player will let you set an x offset from the third person camera
MatrixF mat; Point3F rightVec; getEyeTransform(&mat); mat.getColumn(0, &rightVec); rightVec *= mDataBlock->cameraXOffset; *off += (rightVec);That is, assuming you add a datablock value to the player called cameraXOffset, or whatever you want to use. This'll look straight ahead though, you'll need to modify the camera's orientation to get it to look at a point ahead of you, but it's not hard to do that either, especially with the Advance Camera setup for third person.
Torque 3D Owner Brandon Maness
If you are wanting to adjust the existing camera position I'm pretty sure you'll have to do a little source code modification, or modify an existing 'advanced camera' resource. The camera.cc and player.cc are good places to start looking around.
B--