Setting up a camera at a different angle
by dArchitect · in Torque Game Engine · 02/04/2009 (11:03 am) · 2 replies
By default TGE has the camera behind a character. I want to change this default camera to the right, or left, of my main character while still using the same keyboard/mouse system that is place. I have read through a lot of forms and tutorials here but have not come close to getting this to work. An
idea of this is getting something simular to what TGB has but without being restricted to just that camera position.
idea of this is getting something simular to what TGB has but without being restricted to just that camera position.
About the author
#2
Thats where all the camera positioning and rotation stuff for a ShapeBaseObject resides. You can mess around with that code to change the default camera behaviors. Heres some additional code you can use to experiment with:
To manipulate the position, you can use camPos.x, camPos.y, and camPos.z.
I'll leave the rest up to you as an exercise.
02/04/2009 (10:59 pm)
Open up shapebase.cpp and look in the function: void ShapeBase::getCameraTransform(F32* pos,MatrixF* mat) Thats where all the camera positioning and rotation stuff for a ShapeBaseObject resides. You can mess around with that code to change the default camera behaviors. Heres some additional code you can use to experiment with:
Point3F camPos = getRenderPosition(); //get the shapebase's current rendering position mat->set(EulerF(0,0,0)); //set the camera rotation along the x, y, and z axises. mat->setColumn(3, camPos); //set the camera position
To manipulate the position, you can use camPos.x, camPos.y, and camPos.z.
I'll leave the rest up to you as an exercise.
Associate Michael Hall
Distracted...