STATE_group_light_group

 

 


   Obselete .(works only in software mode)
   Set the brightness of each polygon of the group according to the intensity of the light source.
   values for ambient and are in the range [0-400]
   values for light_intensity light_intensity are in the range [0-400]
   see STATE_polygon_set_brightness() for explanation of what those values mean
   ambient is the minimum light intensity that is, if the light source has zero intensity or points
   to the opposite direction , the polygon will have the ambient intensity. This is the light that reflects
   from the surroundings.
   Examples:
   A)	direction[0]=1; direction[1]=0; direction[2]=0;
  		STATE_group_light_group(grp, direction,20, 400)   A very strong source of light in a dark environment
  
   B)	direction[0]=1; direction[1]=1; direction[2]=0;   The direction is diagonally
  		STATE_group_light_group(grp, direction, 100, 100)   An average source of light in an average lit environment
  
   Note that actually one can also try negative values for the ambient and the light_intensity.
   note that the formula is final_intensity= ambient + angle_between_polygon_and_light_direction* light_intensity
   where angle_between_polygon_and_light_direction is normalized to the range [0-1]
   a negative light_intensity means that our light source gives darkness instead of light ! (a great new invention !)

 

 

Go to page 1      Select API

 

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