Open source Java blender3d file format reader (vertex extractor e.g. for JOGL)

To load the vertices of a .blend file from one scene for use in JOGL (you don’t need jogl to build it though) I wrote this Java library, see http://code.google.com/p/libjavablender/downloads/list
for source code. You just have to contruct triangles with 3 vertices at a time in the generated list to display your .blend model. Enjoy!

Colors are in and some bugfixes. The lib is more or less finished. Needs a fast machine. There’s a main method commented out for your convenience.

Hi

It could be useful to import Blender models in various scengraphs, thanks. Are there some parts of a Blender file you don’t handle yet?

Edit.: Please can you use the versioning system so that I can really see the changes in the source code?

Yes, there’s header parsing and file-block parsing but no SDNA, no scene functionality yet. Do note that the first versions were written out of the blue, I misinterpreted some things.

I’ve put it in the git repo : git clone https://code.google.com/p/libjavablender/ with better parsing than before.

Thanks it’s better now. On which version of Blender do you perform your test?

It would be fine to be able to use your source code to convert MD3 models into Blender models and then into Collada (by using Blender build-in Collada exporter). I cannot edit some of my models because old versions (< 2.50) of Blender have some major limitations when exporting models to Collada and lots of “old” importers and exporters are quite broken and unmaintained since its version 2.50.

After it works, I’ll try to speed it up e.g. the String filebuffer->char[], I’m using the monkeys.blend file, version 2.61.

The code is more or less usable to extract all vgroup[XXX…] vertex arrays except for 1 bug and except for scene parsing. Here is the latest tarball : http://code.google.com/p/libjavablender/downloads/list

You can run the commented main method with ‘java javablender/Blender monkeys.blend’.

HTH

Take the latest tarball here or use the git repo :
http://code.google.com/p/libjavablender/downloads/list

It should be more or less usable except for 1 bug. Can be sped up. Enjoy.

There’s a BoundingBox class which extends gateways (doors) and bullets. You have collision checks for bullets with enemies, bullets remove themselves offscreen, then you have a level map with falling off a list of boundingboxes with easy collision detection, no jumping (just make a list of coords to implement it if you like) and then have a look at StateImageLibrary.java which gets an image from a list of images one after the other placed in that very same list at level startup time. There’s midi music support and everything is GPLed. Oh, and the Metroid dude images have been paid for for this game.

Here’s the latest tarballs : http://code.google.com/p/asteris/downloads/list

Enjoy.

???

Please explain properly

The source code is very easy to understand is what I mean. Read it and you can make yourself a platform shooter game.

Merged three topics… :point: