Page 1 of 1

Adding a FPS Camera to a Model

Posted: Fri Jan 02, 2009 2:58 am
by Daystar
Hello all, I am trying to figure out how to attach a FPS camera to a model centered in its head, then I wanted to control the camera and the model with a event receiver instead of a KeyMap. Can anyone help me with this?

Posted: Fri Jan 02, 2009 3:36 am
by lucifer1101
well you will have to set up the model as the parent of the camera and then place the camera at the models head, i believe thats how its done...

Posted: Fri Jan 02, 2009 12:59 pm
by Daystar
But how do you do that?

Posted: Fri Jan 02, 2009 7:26 pm
by Ion Dune
Actually, assuming you have a mesh and a camera with a collision response animator, it would be best to just attach the mesh to the camera though you will probably have to adjust the rotation manually. To do this is quite simple:

Code: Select all

character->setParent( camera ) ;
Then you'll have to figure out how to get the rotation right (I don't think it is updated for fps cameras, but you may be lucky).

However, none of this would work as well as if you used a real physics engine and a custom camera class - but I don't know if that's a possibility for you.

Posted: Tue Jan 06, 2009 12:01 am
by IrrNoob