Java Model Importer - Design Discussion

Hi everyone,

I’m currently working on a library for importing various model types. The idea is that with a single easy command ModelImporter.import(Path to file), it will return an object representing the scene. The scene currently consists of all the individual meshes in an array with the ability to retrieve an individual mesh by index or name, and any lights, cameras, textures etc defined within the import. If anyone has ever used the AssImp library (which is written in C++) then I basically want to try and create that but in pure Java.

I wanted to spark a discussion on how to structure the scene object in such a way that it makes it fast and efficient for people to handle things like animations and the like. At the moment the scene consists of a mesh array containing each mesh defined within the scene, and each mesh contains various primitive array types for things like vertices, normals, indices and so on. This works fine if all you want to do is render a static mesh with a texture, as I can just do Mesh.getVertices() and buffer those into the VBO, followed by Mesh.getUVs(), Mesh.getIndices() and so on. However, I want to support animation as well, and I’m not sure how efficient this type of structure is going to be when you throw that into the mix.

I was wondering if anyone would be able to offer some ideas on what the structure might look like, to make it as easy and fast as possible to extract the vertex information you need, interpolate it based on animation data and get it buffered into the VBO with the minimum of fuss? Remember that I want this to be format-agnostic, so format-specific stuff should be avoided if possible.

Thanks in advance!