Panda3D and C++

Hey everyone,

I’m currently studying computer science in Holland and we’re gonna make a game using the Panda 3D engine. While I was doing some research on the site I found out that you can call panda3D from C++. Since C++ is way more popular in the game design world than python, I thought it would make more sense to do the programming in C++. However I can’t find any documentation on how to call Panda3D from C++. Does anyone know about some documentation I can’t find? All help would be greatly appreciated.

Cheers, Okke

Hello Okke,

I’d be willing to bet the majority of the community here is using Python with Panda3d to develop their game or application. Panda3d was originally designed with scripting (although not Python at first) in mind so you aren’t going to find any documentation on using C++ for stuff like game logic.

I think the question has been asked before though on the forums so a quick search may help.

Steve

Right. In general, the Python documentation will work for C++ as well, but you have to get used to our renaming convention from C++ to Python. For instance, the Python method setPos() is called set_pos() in C++.

You can also read the C++ .h and .cxx files. The interfaces are defined in the .h files, and each method’s usage is documented in the corresponding .cxx file. This is the same documentation that is used to generate the automatic API docs here on the website, though it might be easier for a C++ coder to read it directly from the source.

I’m not really sure whether it’s true that “C++ is way more popular in the game design world than python.” Certainly it was true five years ago, and it might still be true now, but the world keeps changing.

Even if C++ is still the language of choice in the game industry, it doesn’t really seem like a good reason to choose a particular language to use, unless you are mainly interested in strengthening your skills for the job market. However, there are many legitimate reasons for choosing a language like C++ for a project; and many other reasons for choosing a language like Python. I won’t presume to guess what language would be best for you.

If you decide to use Python, I think you will find the game coding will be a lot easier and that development goes a lot faster overall. If you decide to use C++, you will find Panda equally capable (it is, after all, itself written in C++), but you will have a bit more of a learning curve to apply to learn the interface, since the demos and examples available here are almost all written in Python.

David

First of all, I would like to thank both of you for your replies. As you, drwr, stated, it would make sense to pick c++ to strengthen my skills for the job market. This was exactly my intention.
However, I have decided to do this project in python. Since python is complete new and c++ relatively new for me, it would cost too much effort to try and translate from python to c++. Perhaps if there is some extra time near the end of the project, i will have a go at c++.
Thanks again for the effort.

Happy coding, Okke