Platform Game Camera
by Luke Smith · in Technical Issues · 05/16/2007 (8:30 pm) · 6 replies
Hi,
Im working on a 3d platformer gameand i need the camera to be positioned to the side of the character say rotated 90 degrees. Is there a piece of code I can edit to change the camera orientation? the Cam node is positioned in a different place to where it actualy is when you play the game so I am guessing there is a code that offsets it. Ive tried moving the node in the scene but it cause all sorts of issues.
Thanks in advance.
Im working on a 3d platformer gameand i need the camera to be positioned to the side of the character say rotated 90 degrees. Is there a piece of code I can edit to change the camera orientation? the Cam node is positioned in a different place to where it actualy is when you play the game so I am guessing there is a code that offsets it. Ive tried moving the node in the scene but it cause all sorts of issues.
Thanks in advance.
#2
05/19/2007 (12:25 pm)
Is there any other way I can acheive the rotation as I am having alot of problems with the advanced camera resource. Surely it is set somewhere in the code the exact location of the camera object to be.
#3
Include advancedCamera.cc and advancedCamera.h in your Project, Rebuild it and then do only the torque script changes as shown in the Advanced Camera Resource. Then it should work.
Set the GodViewMode when the player is created (server/scripts/game.cs).
Next edit the Advance Camera Datablock values (for example the godviewOffset) in server/scripts/camera.cs until you get the rotation or view you need.
Thats how i did it.
05/19/2007 (3:10 pm)
What kind of problems are you having with advanced camera?Include advancedCamera.cc and advancedCamera.h in your Project, Rebuild it and then do only the torque script changes as shown in the Advanced Camera Resource. Then it should work.
Set the GodViewMode when the player is created (server/scripts/game.cs).
Next edit the Advance Camera Datablock values (for example the godviewOffset) in server/scripts/camera.cs until you get the rotation or view you need.
Thats how i did it.
#4
How do I set the godviewmode? is it something like %this.advCamera.setGodViewMode(); or something?
Id love to see some screenshots of your platform game if you have any.
05/19/2007 (3:45 pm)
Oh ok thank you very much! How do I set the godviewmode? is it something like %this.advCamera.setGodViewMode(); or something?
Id love to see some screenshots of your platform game if you have any.
#5
EDIT:
The erratic camera behaviour seems to be linked to the terrain. on certain parts of terrain it will go very close i.e. the desired distance but mostly it is very far away. Any Ideas how I can tweak this?
05/19/2007 (8:26 pm)
That appears to work however is there a way to set the min and max distance because often the camera is very far away and other times goes very close.EDIT:
The erratic camera behaviour seems to be linked to the terrain. on certain parts of terrain it will go very close i.e. the desired distance but mostly it is very far away. Any Ideas how I can tweak this?
#6
05/22/2007 (3:15 pm)
Ive managed to stop the terrain controlling the camera position by commenting out the appropriate functions and I am now using the thirdperson camera changing the offset for the distance and position and using the lookat offset.
Torque 3D Owner Michael K.
I'm doing the same thing here.
Check out Advanced Camera: http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5471
You can achieve the rotation with this resource.
regards,
Michael