Third person camera

Hi everyone,

I am new to Panda3D and I need some help. I want to set up a third person camera. Maybe I’m getting in way over my head, but I really want to give it a try. I looked around the forums already, but I couldn’t find a topic about exactly what I’m looking for. Here is what the camera should do:

Stay in a position behind the character at all times
When the mouse moves along the x axis, the camera will rotate to adjust the view (because the character will also be turning to face the mouse’s direction)
When the mouse moves along the y axis, the camera will turn upwards or downwards to adjust the view.

The effect will be a third person camera like in the games Oblivion or Gears of War. Is there a Panda3D function for this? If I have to code it myself, could someone please tell me how? Thanks in advance.

Welcome :smiley:.

You don’t have to code it yourself from scratch, it’s been done. Like in this example:

discourse.panda3d.org/viewtopic.php … ming+ralph

You may want to start with the tutorials in the samples folder that comes with Panda and read the manual first. Good luck.

Thanks kayn! I’ll take your advice and work with the sample programs.

Oh yeah, I forgot to mention; if you’re not familiar with Python you should definitely learn it.

There are a bunch of tutorials, books, etc. all over the internet (and libraries). What I used to get started was:

docs.python.org/tut/tut.html

Reading through that and doing the tutorials should help you understand the basics. The hard part is using that knowledge in Panda (for me at least).

Kayn, the tutorial you linked to is quite old, for Python 2.0.

The updated tutorial is here:

docs.python.org/tut/tut.html

Oops, sorry. I have the different versions bookmarked, and that was one of my earlier ones (maybe my first). I can be an idiot sometimes.

Really? I tried the old tutorial and it worked perfectly and was exactly what I needed. But I’ll try the new tutorial instead since it’s more up to date. Thanks Arkaein, and thanks again kayn.

Edit: Oops, I thought when you said “tutorial” you meant the third person camera topic. Now I see that you meant the Python tutorials. Sorry for the mixup.

As for learning Python, it’s not hard for me so far. I have about three years experience with C++ and Python has a lot of similarities.