Camera Problem
by Lee "Lazarus" McColl · in Torque Game Engine · 09/15/2003 (9:00 am) · 6 replies
Hi All,
I've only recently started to delve into the Torque scripting language and the whole SDK architecture, and as a first project, I want to build a Supersprint style game using the racing example. Now, I've already run through the scripts included and have managed to do most of the beginner stuff including new models and scenery and adding new scripts to the game script tree (as it were), but I'm stuck on something that is probably simple, just can't see what needs to be changed.
I'm trying to set the angle of the camera so that it looks down at the vehicle from a height as opposed to from behind. I've managed to increase the vertical position of the camera to the desired height, but it still insists on pointing forward.
At first, I figured this might be to do with the cam and eye nodes of the vehicle, and so placed the eye node beneath the cam node, but this had no effect. Now I'm assuming that code within the Player scripts must need altering.... But what and where? Can anyone out there help?
I've only recently started to delve into the Torque scripting language and the whole SDK architecture, and as a first project, I want to build a Supersprint style game using the racing example. Now, I've already run through the scripts included and have managed to do most of the beginner stuff including new models and scenery and adding new scripts to the game script tree (as it were), but I'm stuck on something that is probably simple, just can't see what needs to be changed.
I'm trying to set the angle of the camera so that it looks down at the vehicle from a height as opposed to from behind. I've managed to increase the vertical position of the camera to the desired height, but it still insists on pointing forward.
At first, I figured this might be to do with the cam and eye nodes of the vehicle, and so placed the eye node beneath the cam node, but this had no effect. Now I'm assuming that code within the Player scripts must need altering.... But what and where? Can anyone out there help?
About the author
#2
tork.zenkel.com/_tutorials/Coding-Scripting/camera/CameraFunctions.php
09/16/2003 (12:52 am)
This should get you started making the cam more dynamic:tork.zenkel.com/_tutorials/Coding-Scripting/camera/CameraFunctions.php
#3
09/19/2003 (11:00 am)
An awful lot of people ask for this basic feature of being able to position the camera in any way desired - i'll be annoying... my vote for getting it into the next stable release!
#4
09/19/2003 (11:05 am)
Sounds good... when can you have the patch ready? ;)
#5
09/21/2003 (11:53 pm)
I third this. Just being able to reposition the camera around the player is enough for me... All those security camera style cameras can wait ;)
#6
Get the current rotation(consists of 4 values), change the first three values to somthing like "0.235 0.235 -0.945" with the original 4th value and set the rotation to that value.
Example X = GetCameraRotation();
x = x.xxxx x.xxxx x.xxxx 86.4521
Replace the x's with the supplied figures and you get
X = "0.235 0.235 -0.945 86.4521";
CameraSetRotation(X);
That will rotate the nose of the camera downward about 15 degrees or so.
02/29/2004 (4:32 pm)
Set the camera rotation would do what you want.Get the current rotation(consists of 4 values), change the first three values to somthing like "0.235 0.235 -0.945" with the original 4th value and set the rotation to that value.
Example X = GetCameraRotation();
x = x.xxxx x.xxxx x.xxxx 86.4521
Replace the x's with the supplied figures and you get
X = "0.235 0.235 -0.945 86.4521";
CameraSetRotation(X);
That will rotate the nose of the camera downward about 15 degrees or so.
Torque Owner Lee "Lazarus" McColl