Author Topic: MD2 file  (Read 4351 times)

Manumoi

  • Guest
MD2 file
« 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
MD2 file
« Reply #1 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?

manumoi

  • Guest
MD2 file
« Reply #2 on: May 12, 2004, 04:04:46 am »
Code/docs for using jPCT's MD2-support
if you have some...

thanks

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
MD2 file
« Reply #3 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.

manumoi

  • Guest
MD2 file
« Reply #4 on: May 13, 2004, 12:35:14 am »
Great  :D

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


manu