STATE_object_md3_create_from_file

 

 


  When loading an md2 objects the engine builds the different animation sequences according to the
  names of the frame.
  With md3 it is different. The frames associated with each sequences are usually given in a different file
  usually animation.cfg
   md3 is also very differnt in that that many models are built from 2 or three separate md3 models
    for example one md3 model for the legs and one md3 model for the torso and one for the head.
  This function is the same as STATE_object_create_from_file only that one can also give the animation.cfg
  and the engine will build the animation accordingto this file.
  The animation.cfg files are simple text files. You can find many on the Internet (look for Quake3 md3)
   below is an example 

/*
   first frame, num frames, looping frames, frames per second (the 4 number fields below)
0	30	0	25		   BOTH_DEATH1
2	1	0	25		   BOTH_DEAD1
90	40	0	20		   TORSO_GESTURE
151	1	0	15		   TORSO_STAND
152	1	0	15		   TORSO_STAND2
153	8	8	20		   LEGS_WALKCR
161	12	12	20		   LEGS_WALK
  

  Return value: The function returns a handle to the created object

  Parameters:
  	file_name: the file of the md3 object. Example: "..\\my_models\\dog.md3"
    
    animation_cfg_file: the file which gives the names of the different sequences and the fram numbers associated with each frame.
  						see example above
  
  	sequence_token: The animation.cfg files describe the sequences for several models. The token is used to associate
  					the loaded model with the relevant sequences.
  					for example if we load an md3 that is only the legs then we only want
  					to take the sequences (from the animation.cfg) that start with "LEGS_"
  

   Example
  		DWORD obj=STATE_object_md3_create_from_file("woman1.md3", "animation.cfg", "TORSO_");

 

 

Go to page 1      Select API

 

Copyright © 2007 3DSTATE Corporation. www.3dstate.com