Summary

This chapter gave an overview of the painter's algorithm, which is used by Away3D to draw a scene, starting with those 3D objects that are furthest from the camera and working its way forward. We then saw the method in which Away3D determines the distance of a 3D object from the camera, which then defines the sorting order of the 3D objects. We also saw some of the limitations of the algorithms used to calculate these distances.

While the default algorithms implemented by Away3D will correctly sort the 3D objects within a scene most of the time, these limitations can lead to situations where a scene is not rendered correctly. One such situation was demonstrated, and a number of solutions were then provided that allow us to control the way in which Away3D sorts the scene including:

  • The pushback and pushfront properties
  • The screenZOffset property
  • The ownCanvas property

In addition, we looked at the additional renderers provided by Away3D, which can be used to solve some sorting issues, thanks to their use of a more advanced sorting algorithm.

In the next chapter, we will explore the various materials that can be applied to 3D objects.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.134.229