Convert MD2 models to JPCT Native Format

Started by hytparadisee, May 11, 2007, 04:52:22 AM

Previous topic - Next topic

hytparadisee

Before I ask. Is it true that loading models in JPCT Native format is much faster than MD2?  ???

Let's say I loaded the model (usually with animation) using Loader.loadMD2(...) and got the Object3D, what should i do next to export it to the Native JPCT format. And once exported, how do i load it back again to get the Object3D for use?
Today I finally found a problem to my soluuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuution

raft

i do store animations in serialized form (java's native format ;)) loading it is really faster. storage space is slightly higher but you can reduce it using low precision serializing or not serializing normals. see Mesh class for details

beware of one drawback, each time Egon changes something in mesh class serialized form breaks. i dont know why he insists on not adding a serialVersionUID to his classes  ???

r a f t

hytparadisee

So we can save our models like that? At first i thought JPCT has its own xml file format (like jME).
Today I finally found a problem to my soluuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuution

raft

sure. most of the jPCT classes are serializable so you can save them using standard java serialization mechanism. for animations, save the Animation as a whole then during load set it with the Object3D.setAnimationSequence(Animation)

EgonOlsen

It has an xml-format, but i don't recommend it for saving animations because xml is usually bloated. Loading won't be faster but slower. Loading MD2-files already is fast, because MD2 is a quite optimized format in terms of size.