C++ Samples, devpak, Java Port

the installation comes w/ some python examples, but i’d rather write in c++. are there any c++ samples we can download?

for that matter, has anyone created a devpak w/ a simple panda3d template?

are there Java bindings for Panda3d?

So far our emphasis has been on documenting the Python interface to Panda, so no, there aren’t yet any samples written in C++. However, it’s not hard to translate the Python code to C++, since there’s almost a one-to-one translation; you just have to understand the renaming scheme, where C++ methods like wrt_reparent_to() become wrtReparentTo() in Python.

Also, I think you will find the C++ code is well-commented and organized, and once you learn how it is distributed, substantially easier to read than many other open source projects out there.

However, you do have to be prepared to compile from the command line; as a platform-independent project, it is very important for us not to tie our build scripts to any one development environment. This is part of why there is not a devpak for Panda at this time. But the reward for this inconvenience is that a given application can be written for Windows, and compile and run without modification on Linux (and, eventually, OSX).

No one has asked for Java bindings before. Are you interested in contributing them?

David

very very much appreciated!

as far as contributing to a java port - i think that’s a little above my capabilities. I know it would probably involve JNI and maybe SWIG… but that’s about all i know. the more i learn about programming, the more i learn i don’t know. someone said that… not me.

anyways, i really like what you guys are doing here, and i would love nothing more than to be a part of it. unfortunately, i have very little time for nearly anything. I think that for now, i will spend my time becoming more familiar w/ Panda and hopefully i’ll soon have something to show off.

besides, since you guys are obviously striving for crossplatformability (is that a word?), a java port is somewhat less appealing… although, i do like coding in Java more than c++. since i still don’t know much of python, i think i should be taking a look at it and expanding my horizons.

I do recommend learning Python. I don’t know anyone who has tried using Python and doesn’t love it.

For myself, I used to be a staunch C++ advocate, but now it feels like programming in C++ is slogging through the swamp, when I could be swinging in the trees with Python.

Of course, everyone’s entitled to their own opinion. :slight_smile:

David

Actually, we do have at least one C++ sample: pview. It’s a simple program, yes, but it’s a fully functioning C++ panda program, so at least it’s a starting point.

Let me chime in and say that I think David has it absolutely correct. Python is the way to go IMHO. I love trying out new langs, as you always seem to learn a new way of doing things. I’ve programmed in C, C++, Perl, Java and if it counts, PHP. I had on my list to try Python, Ruby and Squeak. But now that I’ve tried Python, I don’t know if I’m going ot be moving on. I’ve finally found a langage that gets out of my way, and let’s me program. :slight_smile: The code reuse is so easy, and the contructs are simple yet powerful. You just get stuff done!

There are a couple of things you have to get used to, like no semicolons (Which you don’t need 99% of the time) and the use of indentation to do code blocks. (Which good code does anyway)

I couldn’t more highly recommend a language to try. = ) And since you do know how to program, there is a great reference out there for Python. The 2.2 version is at:

rgruet.free.fr/PQR2.2.html

(I prefer the Modern css myself :slight_smile:

Best Wishes,
-Nick

I am learning Java because my work and hobby (for J2ME), so I really want Java binding because I don’t have time to learn Python now.

Hmm… I was looking for c++ examples, and I’ve found this thread.

Most people here adviced using python while working with Panda. Does it mean that c++ programmers should rather use irrlicht or other c++ dedicated stuff? I’m about to begin a project now, so I would like to know that before I start.

My strong suggestion would be - write a program in python (which will go 10 times faster than writing it in C++), then if something’s running too slowly, translate the parts you need to into C++ (my guess is that will be no more than 3 or 4 classes). You’ll save huge amounts of time.

It would be good suggestion… But I just prefere to stay with “old good c++”. Mostly becaouse making python bindings for other libraries I need to use would take to long.

So, the answer is to give up “fight” with panda3d and try something else, isn’t it?

Honestly, I can’t say. David feels that writing a game in panda using C++ is easy. I’ve never tried it myself. It looks straightforward enough. But, there is the question of the manual being in python. It’s really up to you.