Game Development Community

Side view camera

by Taras (TSK) Anatsko · in Torque Game Engine Advanced · 01/24/2009 (1:33 pm) · 1 replies

How i can make side view camera for 3d platformer?

#1
02/02/2009 (6:19 am)
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.