STATE_group_rotate_to_match_polygon

 

 


   The function get three arguments.
   group_handle: the group to rotate
   polygon_in_the_group: a polygon that belongs to the group
   reference_polygon: any polygon.
   inverse_flag: YES or NO. If YES the Normal of the reference polygon is inversed (as if we took the back side of the reference polygon)
   The function rotates the group so that "polygon_in_the_group" will
   be parallel to "reference_polygon"
   returns OK, VR_ERROR.
   A NULL group handle means the whole world
   Note this very nice trick:
  		If the reference polygon also belongs to the group we can call
  		this function several times consecutively.
  		example say we have a box and we call this function as follows:
  		STATE_group_rotate_to_match_polygon(grp, left_poly, front_poly);
  		after the first call the box will rotate in 90 degrees so the left
  		polygon is now were the front poly was. BUT the front poly is part of
  		the group ,so it was rotated too. consecutive calls to this function
  		will cause a 90 degrees rotation each time. like a dog trying to catch its tail.

 

 

Go to page 1      Select API

 

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