www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Manumoi on May 11, 2004, 09:20:08 am

Title: MD2 file
Post by: Manumoi on May 11, 2004, 09:20:08 am
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
Title: MD2 file
Post by: EgonOlsen on May 11, 2004, 11:43:41 pm
Code/docs for using jPCT's MD2-support or for writing your own loader in whatever language?
Title: MD2 file
Post by: manumoi on May 12, 2004, 04:04:46 am
Code/docs for using jPCT's MD2-support
if you have some...

thanks
Title: MD2 file
Post by: EgonOlsen on May 12, 2004, 05:04:06 pm
Should be quite easy in this case. You load and place the object like every other and animate it. Basically like this:

Code: [Select]
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.
Title: MD2 file
Post by: manumoi on May 13, 2004, 12:35:14 am
Great  :D

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


manu