Bonzai Engine Forum

Bonzai Engine & Tools => Bonzai Engine => Topic started by: jjzazuet on September 24, 2012, 12:57:16 PM

Title: Implementing new model loaders
Post by: jjzazuet on September 24, 2012, 12:57:16 PM
Hello.

I'm currently trying to implement a model loader for Unreal PSK models.

A quick look at Bonzai's JavaDoc tells me that I should start by creating a new implementation of:


What I'm not so sure about is how to perform create the actual Bonzai native model or how to register this new PSK model loader implementation with the engine.

Is there any documentation which covers this subject?

Thanks for your time and help!

JZM
Title: Re: Implementing new model loaders
Post by: jerome_j on September 24, 2012, 03:37:51 PM
You'll have to implement IModelReader interface and register it to BonzaiEngine singleton similarly to:

A basic implementation of IModelReader interface:

For static model, you'll have to create Mesh, GeometryData, VertexData, Material objects and store them in the model object.
There's some helpers for creating GeometryData/VertexData for converting various format of geometry and also generaing normals GeometryIndexed (http://bonzaiengine.com/javadoc/jouvieje/model/reader/GeometryIndexed.html).