how would one make a tiny model viewer using Panda3d?

Panda has bunch of dlls. Although most of their names are self explanatory, I have no idea what others are for. Is there some kind of list showing which dll is used for what? Or do I need to read the source?

The thing is resently I asked myself a question: how would I make a 3d model viewer like all the others with just few megabytes of size, powered by Panda? I would only need the core panda3d stuff, only opengl renderer, no collisions, no physics, audio, shaders, nothing else. If you use Packpanda, you end up with few hundred megs of extracted folder, use ppackage and you need internet connection, same for pdeploy, which is also buggy and experimental. And also, I dont want to have all the data in an exe, but rather in folders.
And this isnt just about model viewers. Just about any small game created like this will end up too big for what it uses.

I would like to know what I can delete manually to keep the size to minimum

If you really want a stripped-down version of Panda3D, you’ll need to compile your own version.

But why not create a .p3d file, and use “pdeploy” to create a “standalone” version? It will contact the internet to grab compressed and optimised versions of the required Panda3D libraries.

  1. its a buggy program
  2. have you EVER seen a viewer access internet the 1st time to be able to run? because I havent. Maybe this isnt a big deal, but I hate it.

No, he means that pdeploy will contact the internet when you run it, and bind the compressed and optimized versions into your standalone version.

Once built, the standalone version will run without further need to contact anything.


That’s in “installer” mode, yeah. The bugs will be fixed in the upcoming release of Panda3D.

I remember I couldnt get pdeploy to work even after all the help from David. I think the “installer” mode worked fine though. But for such a simple program I prefer to distribute it as an archive.

Also, does standalone mode merge all the files into a single exe file? Is there a way to disable this?

Do the snapshot builds have the bugs fixed, or do you mean they arent fixed yet?

Maybe I should compile my own version of Panda, at least for now.
I thought my program would still work if I removed some dlls which it never uses anyway.

It has been fixed, but the snapshot builds won’t work yet.

Another question for model viewer:

If I wanted to add my own formats like obj or md5, where should I start? I don’t mind if its only possible with C++.
How hard would it be to add formats which store textures in them (or like with obj, store materials in another file)?

I know there might not be a single answer for these questions, I just dont know where to start.

To view these models in Panda, you would have to write a converter to a Panda model format. Today that would mean egg, so you would need to write a program that converts obj to egg (or md5 to egg). For formats that store embedded images, you’d have to write the images to a disk file first, or extend egg to support embedded image data itself.

Or, you can wait until the Collada importer is finished, and write your converter to go obj to dae. It depends on how patient you are, of course. :slight_smile:

In any case, if you wrote your converter in C++, using the tools in Pandatool (similar to lwoegg and xfileegg), you can write it as an OBJToEggConverter class, which means you can integrate it tightly with the existing Panda loader to allow it to transparently load .obj files directly, the same way it loads .lwo and .x files directly today. If you’d prefer to write the converter in Python or some other language, then you won’t be able to do this.


Let me get this straight: when Collada becomes the standard, then the structure of Panda3D’s internal vertex and geometry data objects is going to change?

I rather go with the first option.

I dont think I can wait a year for this one.

Till now I never thought how this worked. So you write a command line program and Panda calls it every time you load with loader and converts it to egg? Isnt this a bit slow?
Or did I not understand it correctly?
The bold text is the part I didnt understand.

Anyway, I should browse Panda’s source for this one. What classes should I look at and what class should I inherit from?


You could use the existing dae2egg in the meantime, which will be improved and maintained until the alternative is finished.

That’s how we currently do most of our importers. And no, Panda3D doesn’t internally call the command-line program - it just interfaces with the SomethingToEggConverter derivative and directly loads the resulting EggData structure.

Also, the second time the same file is loaded, it is of course read from the model-cache (which stores as .bam).

The SomethingToEggConverter class. You should take a look at the other importers in pandatool.

I think that currently dae doesnt even support normals properly, so I don’t mind just porting my whole code for dae when its done. In an other thread you said it will be ready for panda 2.0, and drwr once said that will be in the far future (or something like that).

Is this simply put- they use the same classes?

Well I didnt expect a tutorial for such a thing.


Where’d you get that idea? Of course they are supported properly.

Good, because there isn’t one.

Oops, normal maps.

I “didnt”, not I “dont”.

COLLADA supports bump maps through an FCollada extension, I believe.

I’m confused. Are you trying to say that you expect someone to write a tutorial now?

But there are many other things currently not supported by collada, arent there?

I simply said

Which means I know there isnt. If I said “I don’t expect” then you could say that. Otherwise it doesnt make sense.

Will adding new format require recompiling the whole engine?

If I were to take the dxfegg and just fool Panda by changing its extension to .obj, what would I need to do to add it to loader?

Hm, is only “libp3ptloader.dll” used by the loader? Im hoping to replace this with my version rather than recompile the engine.

libp3ptloader is the dll that integrates all of the loaders in pandatool with the model loader.

Sounds like what I need.
So can I just

with more formats?