Camera transform
by Kynan Eng · in Torque Game Engine · 09/01/2005 (3:27 am) · 8 replies
How do we set the camera to view a certain object inside the game, which is not the player?
We want the camera to look at it from behind as the 3rd person view on the player. however, i am not sure about which parts to change to change in the starter.fps to set the object the camera will follow to the new shape which is moving.
something like
%this.camera.setOrbitMode($newobj,$newobj.getTransform(),5,100,20,1);
seems to fail, as it is again set to follow the player somewhere else.
We want the camera to look at it from behind as the 3rd person view on the player. however, i am not sure about which parts to change to change in the starter.fps to set the object the camera will follow to the new shape which is moving.
something like
%this.camera.setOrbitMode($newobj,$newobj.getTransform(),5,100,20,1);
seems to fail, as it is again set to follow the player somewhere else.
About the author
#2
09/05/2005 (1:23 am)
Well, when i use the setorbitmode function with the new object as the argument, the program will get stuck waiting for the server after loading the objects... is there certain constraints for the object to be orbited? i guess it would need an eye node for one?
#3
09/05/2005 (1:52 am)
Well, when i use the setorbitmode function with the new object as the argument, the program will get stuck waiting for the server after loading the objects... is there certain constraints for the object to be orbited? i guess it would need an eye node for one?
#4
Anyway, I don't know that there are any particular requirements. Perhaps that the object is a ShapeBase? You could check the code for the camera to see what types it is looking for; I don't know off hand.
09/05/2005 (5:34 pm)
Are you sure it's hanging? If Torque doesn't have an object or camera to render from, it won't render anything.Anyway, I don't know that there are any particular requirements. Perhaps that the object is a ShapeBase? You could check the code for the camera to see what types it is looking for; I don't know off hand.
#5
Now I gave up on doing this way, though, it would be nice to know such details where we can change camera view, create many cameras and switch between them, etc, without direct OpenGL calls?
09/07/2005 (5:12 am)
Well, all I changed was to call the function setOrbitMode in the script after it is created, and set the object parameter to an object in the game. It's the starter.fps script, and when I press launch mission, it loads datablocks and objects, and at 100% it stops waiting. Maybe it is due to the eye node thing. Now I gave up on doing this way, though, it would be nice to know such details where we can change camera view, create many cameras and switch between them, etc, without direct OpenGL calls?
#6
09/07/2005 (12:01 pm)
Any ShapeBase derived object can be a camera. Just set it as the control object. No magic here.
#7
please give an example. I have a shape that I'd like to be a camera but can't seem to get it right. thanks!
02/21/2006 (10:55 am)
"Any ShapeBase derived object can be a camera. Just set it as the control object. No magic here."please give an example. I have a shape that I'd like to be a camera but can't seem to get it right. thanks!
#8
02/15/2007 (10:23 am)
%clientID.setcontrolobject(%objectName); it must be a valid controllable object though. Try changing your control object to an observercamera before you use the setorbitmode. That function only works on camera objects
Associate Kyle Carter