C3DMesh::LoadMD2

Top  Previous  Next

Syntax:

 

LoadMD2(C3DScreen pScreen, string  filename, string  texturefile), int

 

Purpose:

Loads a mesh from a MD2 format file.

 

Parameters:

pScreen - A C3DScreen object

filename - The filename of the MD2 mesh.

texture - The associated skin texture for the MD2 mesh.

 

Returned value(s):

TRUE if the mesh could be loaded, FALSE otherwise

 

Application:

IF(pMesh2.LoadMD2(GETSTARTPATH + "super.md2",GETSTARTPATH + "super.bmp"))
    pMesh2.EnableLighting(false)
    pMesh2.SetNamedAnimation("run",2000,timeGetTime())
    pMesh2.SetAnimationMode(ANIM_LOOP)
ENDIF

 

Class Hierarchy

C3DObject

-------C3DMesh

 

Additional Info:

Frame based animation of the MD2 mesh is fully supported using the built in animation commands of the 3D libray. Linear interpolation is used for in-between frame animation.

 

The named animations available for the SetNamedAnimation method are:

 

"stand", "run", "attack", "pain1", "pain2", "pain3", "jump", "death1", "death2"

"death3", "flip", "salute", "taunt", "wave", "point", "crstand", "crwalk", "crattack"

"crpain", "crdeath"