Game Development Community

first person observer camera..

by Mquaker · in Torque 3D Professional · 05/20/2013 (10:50 pm) · 14 replies

i planned provide multiple observer camera mode to my game.

i already worked spy area & third person observer camera mode.

but, i looking for ways to first person observer camera logic.

someone who knows how?

#1
05/21/2013 (7:46 am)
In the docs there are the RTS Prototype and Adventure Prototype examples - these have an overhead and orbit camera mode example, along with examples of how to use triggers to set camera position.
#2
05/21/2013 (5:28 pm)
@Rechard Ranft thanks.
but, camera position alone can not solve.
#3
05/21/2013 (10:20 pm)
It's not about camera position at all - overhead mode is a free-moving player controlled camera that is not attached to a player model. And there's an observer camera mode as well. It's already there in the engine, just play with the modes.
#4
05/21/2013 (11:23 pm)
Will that work for first-person though? I've also wondered about this - not just for observers but for things like psychic powers that let you see through another character's eyes.
#5
05/22/2013 (2:00 am)
This is just what I'm doing in my current project.
In server side.
%client1.camera.setOrbitObject(%client1.player, "0 0" SPC mDegToRad(90), 0, 0, 0, true, "0 0 1", false); 
%client1.setControlObject(%client1.camera);
%client1.camera.mountObject(%client2.camera, 0);

The camera of %client2 mounted on %client1's camera. The %client2 sees what %client1 sees.

EDIT1: You have to join %client2 in game as an 'Observer'.
EDIT2: Sorry I'm realizing that this solution may have a drawback for you, you have to set %client1.camera as ControlObject...
#6
05/22/2013 (7:59 am)
Switching from player camera to an "overhead" mode camera works fine and you can even place the camera where you like - tried it onEnterTrigger(), but since I changed the control object I couldn't move the player out of the trigger to switch back. Obviously some experimenting to do there.

With Francisco's method I wonder if you couldn't make a dummy AI player as an observer camera placeholder client using the AIClient object. More experimenting.
#7
05/22/2013 (7:36 pm)
@Fransisco @Rechard
simply 'Orbit' and 'Overhead' mode in order to implement if the 'Camera.setOrbitMode()' can be used.

but, In order to fully implement the first person(shapebaseimage) drawback must share.
#8
05/22/2013 (9:11 pm)
<shrug> You got me - guess you'd better make one and show us what you mean.....
#9
05/22/2013 (9:26 pm)
@Rechard i'm sorry.. my bad english... T.T
#10
05/23/2013 (7:41 am)
Ok, now that I've had time to think about it I'm guessing that you want a camera that moves like Overhead or Orbit mode but still has collision like the third-person player camera?
#11
05/23/2013 (4:40 pm)
No, he wants a first person observer. As in, you see through the eyes of another character.
#12
05/23/2013 (5:08 pm)
@DB if I understand you correctly, couldn't he just do:

get the yaw/pitch of the player's camera and then have your own observer be mounted slightly in front of the player you want to watch? Then just update the position and rotation to make it look like you are watching.
#13
05/23/2013 (6:42 pm)
Or mount your camera at exactly the same place as the other player's camera....
#14
05/25/2013 (8:17 am)
That seems logical. I might give it a try in t3d-bones to see if the concept is sound. I remember trying to make this work myself, I actually used the separate GameConnection::viewObject (don't remember the exact name), which made sense. But wasn't very stable for some reason (well - obviously because it wasn't really designed to be reobust in all situations).