3rd Person Camera

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
DarkWhoppy
Posts: 386
Joined: Thu Sep 25, 2003 12:43 pm
Contact:

3rd Person Camera

Post by DarkWhoppy »

I've been trying for a hour or two.. still can't get a camera to follow my player as he moves around like a 3rd person camera. Could someone help me out here? :?:
Yo

Post by Yo »

there's been quiet a lot of 3rd person camera stuff in the forum lately.
maybe we need a tutorial which concentrates on the camera topic, any volunteers? :)
DarkWhoppy
Posts: 386
Joined: Thu Sep 25, 2003 12:43 pm
Contact:

Post by DarkWhoppy »

Well, mine is almost working. It'll follow the player aroud but not the correct way... Maybe I will if I can get it all working straight 8)
WingedWarrior
Posts: 8
Joined: Mon Nov 10, 2003 2:34 pm

Post by WingedWarrior »

Hi,

DarkWhoppy, have you got it it working yet :?: .

I been able to get something working that follows a player arounds, (rotates left and right around player, moves etc :) ), but am really struggling with the up/down rotation.

Once I have this working I will post the code, so any help :idea: to overcome this last problem would be great.
roninmagus
Posts: 91
Joined: Fri Oct 31, 2003 5:03 am

is it possible to do it this way?

Post by roninmagus »

Could you not just set a point in front of the player, then update the camera to look at that point each movement?

As the player rotates, rotate the point around the player. As he moves, update the point with the same movement.

This is just an idea, I am new to irrlicht. Can't wait to get home to play with the library :)
daveandrews.org - A Christian Programmer's Weblog | Dusty Engine - A Task Engine for Irrlicht
Tequilla
Posts: 40
Joined: Mon Nov 10, 2003 3:42 pm
Location: Germany
Contact:

Post by Tequilla »

I haven't tried that out yet, but I think up/down rotation is easy:
(For this code you must ínsert the correct namespaces and the camera must be a child of your player-model)
// In Eventreceiver:
if (event.EventType == EET_MOUSE_INPUT_EVENT) {
vector3d campos = vector3df(0,0,0);
campos->rotateYZBy(event.MouseInput.Y * 180 / ResY, your_model->getPosition());
your_camera->setPosition(campos);
}

I think, that's all. Just if you're wondering:
By doing "event.MouseInput.Y * 180 / ResY" you can rotate by 180 degrees around the player, independent of the resolution.
Perhaps you have to play arround with with the rotate-function. Perhaps you have to add 90 or 180 degrees or something else to get the effect you wish.

Good luck!
Cleves
Posts: 224
Joined: Mon Sep 08, 2003 6:40 pm

Post by Cleves »

Hey guys,

I'm trying to do a chase camera but i can't get any results,any one can give me some help?

Thanks :D
elvencode
Posts: 33
Joined: Thu Oct 02, 2003 11:10 am
Location: Italy
Contact:

Post by elvencode »

there's an example in this site http://www.gametutorials.com/Tutorials/ ... GL_Pg1.htm

it's in OpenGL, i hope it helps
Post Reply