Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Papervision3D Essentials

You're reading from  Papervision3D Essentials

Product type Book
Published in Sep 2009
Publisher Packt
ISBN-13 9781847195722
Pages 428 pages
Edition 1st Edition
Languages

Table of Contents (18) Chapters

Papervision3D Essentials
Credits
About the Authors
About the Reviewers
1. Preface
1. Setting Up 2. Building Your First Application 3. Primitives 4. Materials 5. Cameras 6. Moving Things Around 7. Shading 8. External Models 9. Z-Sorting 10. Particles 11. Filters and Effects 12. 3D Vector Drawing and Text 13. Optimizing Performance

Summary


Z-sorting is about sorting triangles and deciding in which order the triangles need to be drawn on the viewport. Drawing a render happens from furthest triangles to the closest triangles, based on their position in relation to the camera. This is known as the painter's algorithm.

There are several ways to affect the order in which objects are rendered.

We learned about viewport layers, which are similar to layers in Photoshop, for example. These layers can be ordered in three ways:

  • ViewportLayerSortMode.Z_SORT

  • ViewportLayerSortMode.ORIGIN_SORT

  • ViewportLayerSortMode.INDEX_SORT

The z-sorting issues we've seen with the mill and floor were solved by index sorting. Based on the position of the camera, we changed the layer index order. This is not the solution for all z-sorting problems. But for the example discussed in the chapter, it worked great.

Besides adding and sorting viewport layers as children of the viewport, we've also seen how we can nest viewport layers as children of other...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}