STATE_light_calcualte_vertices_normals_automatically

 

 



#define SET_VERTEX_NORMAL_EQUAL_TO_AVERAGE_OF_ADJACENT_POLYGONS 1000
#define SET_VERTEX_NORMAL_EQUAL_TO_POLYGON_NORMAL 1001
#define DISABLE_AUTOMATIC_NORMAL_CALCULATION 1002
#define SET_VERTEX_NORMAL_USING_MIXED_METHOD 30   Any number between 0 and 180 can be used. Uses a mixture of the other two method according to Chandan methos optimum normal normals setting (chandan@3dstate.com)
												    since 2004 this is the default method

   By default the light engine ignores the normal values in the loaded file and
   calculate them automatically. The default normal calculatin mode is:
   SET_VERTEX_NORMAL_USING_MIXED_METHOD
   use this function to set one of the three modes. 
  
   SET_VERTEX_NORMAL_EQUAL_TO_AVERAGE_OF_ADJACENT_POLYGONS:
  		Use this mode to make 3d object look more round and less polygonal
  		This mode will set the normal of a vertex to be equal to the average of the normal of all
  		the adjacent polygons. For example the normal of points in a cube shape room
  		will all point to the center of the room.
  		Note that when using this mode, vertices that have the same x,y,z will
  		also have the same normal which menas that when lighting an object the edges where the polygons
  		connect each other wont be visible (smoother , rounder effect)
  
   SET_VERTEX_NORMAL_EQUAL_TO_POLYGON_NORMAL:
  		The points of a given polygon will have the same normal as the polygon.
  		Note that points with identical x,y,z coordinate might have a different normal
  		if the polygons to which they belong are not on the same plane.
  
   SET_VERTEX_NORMAL_USING_MIXED_METHOD:
  		The default. combines between the two other methods (SET_VERTEX_NORMAL_EQUAL_TO_AVERAGE_OF_ADJACENT_POLYGONS & SET_VERTEX_NORMAL_EQUAL_TO_POLYGON_NORMAL)
  		If the angle between two adjacent polygons is less then given threshold degrees than the average technique is used
  		if the angle between the polygons is more or equal to the given threshold (the default is 30) than the normals used for the points are the polygon normals
  		Actually any number between 0 and 180 can be used. The default is 30 but one can use other numbers as well
  		When 0 is given then it acts exactly like SET_VERTEX_NORMAL_EQUAL_TO_POLYGON_NORMAL
  		when 180 is given then it acts exactly as SET_VERTEX_NORMAL_EQUAL_TO_AVERAGE_OF_ADJACENT_POLYGONS
  		This methos was devised by Chandan Pawasker (chandan@3dstate.com)
  
   DISABLE_AUTOMATIC_NORMAL_CALCULATION:
  		Use the values as given in the world file.
  		Note that the file might not contain normal values
   
   Example A:
  		STATE_light_calcualte_vertices_normals_automatically(SET_VERTEX_NORMAL_EQUAL_TO_POLYGON_NORMAL);
  
   Example B:
  		  the SET_VERTEX_NORMAL_USING_MIXED_METHOD will be used but with a smaller threshold the the default (30)
  		  This will will increase the SET_VERTEX_NORMAL_EQUAL_TO_POLYGON_NORMAL methos effect
  		STATE_light_calcualte_vertices_normals_automatically(20);
  

 

 

Go to page 1      Select API

 

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