Main Menu

MD2 file

Started by Manumoi, May 11, 2004, 09:20:08 AM

Previous topic - Next topic

Manumoi

Hello. As everybody in this forum, I think JPCT is pretty impressive as a java game engine.
I would like to know if someone has some source code (or made some doc) explaining how to use MD2 file.
Thanks,

Manu

EgonOlsen

Code/docs for using jPCT's MD2-support or for writing your own loader in whatever language?

manumoi

Code/docs for using jPCT's MD2-support
if you have some...

thanks

EgonOlsen

Should be quite easy in this case. You load and place the object like every other and animate it. Basically like this:

Object3D objAnim=Loader.loadMD2("md2/tris.md2", 1f);
TextureManager.getInstance().addTexture("myTexture", new Texture("md2/texture.jpg"));
objAnim.setTexture("myTexture");
objAnim.build();
theWorld.addObject(objAnim);
.
.
.
objAnim.animate(index, sequenceNumber);


Where index is a value between 0 and 1 and sequenceNumber the number of the animation sequence. Have a look at the Javadocs for more details about this.

Hope this helps.

manumoi

Great  :D

thanks you (for that ... and for JPCT in general)


manu