STATE_3D_animation_create_for_editing

 

 


   ===============================================================================
   === More 3D animation functions (beginners can skip this group of functions)===
   ===============================================================================
  
   Use the function below for the following purposes:
   1) To change your 3d animation in real time
  		For example your game character has been beaten severly
  		you can now modify in real-time the points of the animation
  		to create a swollen face \ damaged body etc ...
  		To modify the 3D animation polygons use STATE_3D_animation_set_triangle_xyz()
  
   2) To create various effects. For example you can build the first frame as a duplication of a house
  		the second frame can be a car. When the engine will interpolates between the frames it will
  		create 3D morphing animating gradually from a house to a car.
  		You could get the same effect by building an md2 animation
  		(using one of the md2 editors available on the Internet) with two frames.
  		and loading the aniamtion into the engine (for example STATE_object_create_from_file("woman.md2") )
  
  	3) To write converters from other 3d animation formats to STATE.
  	   To do so simply, create an empty 3d animation using STATE_3D_animation_create_for_editing()
  	   Set the points of all the polygons in each frame to their right value
  	   according to the file format you want to import.
  	   Use STATE_3D_animation_set_triangle_xyz() and STATE_3D_animation_set_triangle_bmp_uv()
  	   to set the polygons. When finished call STATE_3D_animation_save()
  		Example:
  			  converting a 3D frames based animation from your favorite format to STATE anim3d format
  			void main()
  			{
  				DWORD anim3d=STATE_3D_animation_create_for_editing("my_anim", 600, 20);
  
  				int num_of_frames=STATE_3D_animation_get_number_of_frames(anim3d);
  				int num_of_triangles=STATE_3D_animation_get_number_of_triangles(anim3d);
  
  				for(int frame=0; frame<	num_of_frames; frame++) {	
  					for(int tri=0; tri

 

 

Go to page 1      Select API

 

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