jPCT - a 3d engine for Java > Support
MD2 file
(1/1)
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:
--- Code: ---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);
--- End code ---
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
Navigation
[0] Message Index
Go to full version