I would like to have a camera that acts as the driver of a vehicle.
This means it shall follow an object and also mirror its rotation, but the camera should stay movable. For an example it should be possible to "walk" beside the object, but when the object rotates the camera should change its position and rotate, that the object is still seen from the same side.
The object which is followed should always be on the same position on the screen, but not necessarily in the center.
When I make to camera a child of the object I would like to be followed, the position of the camera follows my object but not the target.
How to implement a driver cam?
By sit do you mean when you can see through the window you are able to see through the windshield from insdie the car, thus being able to see the sterring wheel, front panel and other things that are inside the front of the car?
For a start you can use
This is just a basic start and then try different camera positions, I haven't really experminted with the camera functions yet. Or you could try this.
Put additonal code inside the ()'s. Although I'm not sure if setting it up like a First Person Shooter would be good, but you could try it.
For a start you can use
Code: Select all
scene::CameraSceneNode();
Code: Select all
scene::CameraSceneNodeFPS();
-
olivehehe_03
- Posts: 157
- Joined: Tue Mar 20, 2007 8:30 am
Like GameDude said, try using a ICameraSceneNode.
One other way you could do this would be to position the camera inside your car and then set the parent of the camera to the car so that the camera will follow the position and rotation of the car (since cameras don't really have rotation you might need to set the target of the camera to x units in front of the car). Then you'd need write some basic mouselook code so that the camera can look in whatever direction the player wants. Hope that helps.
One other way you could do this would be to position the camera inside your car and then set the parent of the camera to the car so that the camera will follow the position and rotation of the car (since cameras don't really have rotation you might need to set the target of the camera to x units in front of the car). Then you'd need write some basic mouselook code so that the camera can look in whatever direction the player wants. Hope that helps.
Tell me what you cherish most. Give me the pleasure of taking it away.