Posted By

burakkirkil on 07/29/12


Tagged


Versions (?)

Z-Ordering


 / Published in: ActionScript 3
 

Z-Ordering

  1. public var faces:Array;
  2.  
  3. public function ReorderChildren()
  4. {
  5. for(var ind:uint = 0; ind < 6; ind++)
  6. {
  7. faces[ind].z = faces[ind].child.transform.getRelativeMatrix3D(root).position.z;
  8. this.removeChild(faces[ind].child);
  9. }
  10. faces.sortOn("z", Array.NUMERIC | Array.DESCENDING);
  11. for (ind = 0; ind < 6; ind++)
  12. {
  13. this.addChild(faces[ind].child);
  14. }
  15. }

Report this snippet  

You need to login to post a comment.