STATE_object_set_rotated

 

 


  The default. The object is not rotated/turned automatically
#define OBJECT_ROTATED_TYPE_DISABLE 0 

  This is ideal for trees, people images, bilboards, posts, pillars 
  Specially useful with objects containing one polygon with a bitmap of a tree, a person etc ...
  The object direction is indipendent of the camera (the viewer) direction.
  it is only influenced by the camera location
#define OBJECT_ROTATED_TYPE_TREE 1 

  This is ideal for object that might also be looked at from above or for texts that need 
  specially useful with objects containing one polygon with a bitmap showing some text or symbols
#define OBJECT_ROTATED_TYPE_SYMBOL 2 

   *** quite useful 
   A rotated object is an object that is automatically positioned so
   that it always face the camera. 
   This technique is specially usefull if your object contains only one polygon and
   this polygon has a bitmap (with transparent background) of a tree, a person, a symbol, text etc ...
   One can of course do without this function and turn/rotate the object manually before each render
   but it is easier to use this function.
   An alternative for using rotated objects is to use rotated polygons
   The function STATE_object_set_rotated() was added only after version 7.39
   There are some advantages in using this function rather than rotated polygons.
  
   Changing the object side which faces the camera:
  		If the side of the object that is automatically facing the camera is not the one you want then 
  		do the following:
  		Option1 :
  			  This code should be called once for the specified object.
  			STATE_object_rotate_x/y/z(my_object, offset_angle, OBJECT_SPACE) 
  			STATE_object_redefine_axis_system()   redefining the object axis system according the former STATE_object_rotate_x/y/z() functions
  
  		Option2:
  			Before each render turn the object.
  			for example turn it by 90 degrees to get a different side
  
  		
  
   Parameters:
  			object_handle:
  				The object handle
  
  			rotated_type:
  				One of the following
  					OBJECT_ROTATED_TYPE_DISABLE, OBJECT_ROTATED_TYPE_TREE, OBJECT_ROTATED_TYPE_SYMBOL
  					See above for the specific meaning of each type
  
   See also 
  		STATE_object_redefine_axis_system(), STATE_polygon_set_rotated()
  
   Example
  		STATE_object_set_rotated(my_object, OBJECT_ROTATED_TYPE_SYMBOL);
  

 

 

Go to page 1      Select API

 

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