Author Topic: Convert MD2 models to JPCT Native Format  (Read 3924 times)

Offline hytparadisee

  • int
  • **
  • Posts: 86
    • View Profile
    • http://peterhi.com
Convert MD2 models to JPCT Native Format
« on: May 11, 2007, 04:52:22 am »
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

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Convert MD2 models to JPCT Native Format
« Reply #1 on: May 11, 2007, 10:23:44 am »
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

Offline hytparadisee

  • int
  • **
  • Posts: 86
    • View Profile
    • http://peterhi.com
Re: Convert MD2 models to JPCT Native Format
« Reply #2 on: May 11, 2007, 11:02:52 am »
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

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Convert MD2 models to JPCT Native Format
« Reply #3 on: May 11, 2007, 11:08:23 am »
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)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Convert MD2 models to JPCT Native Format
« Reply #4 on: May 11, 2007, 11:08:45 am »
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.