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

Quadtree rendering


Quadtree rendering is an alternative for the default BasicRenderEngine, which is the render engine we've used so far. We will not go into the algorithm used by this renderer. All we need to know about this rendering type is that most of the time it solves z-sorting issues. It's been mentioned earlier that quality often costs CPU power. That definitely counts for quadtree rendering as this is a real CPU killer. However, its use is very simple, so let's see how it works.

First we create a new project, based on the ViewportLayersExample class from the beginning of this chapter. Add the following import at the top of your document class:

import org.papervision3d.render.QuadrantRenderEngine;

Then, add the following to the init() method:

renderer = new QuadrantRenderEngine();

This code replaces the BasicRenderEngine, which was instantiated automatically by the BasicView class, with a QuadrantRenderEngine instance. That's all you have to do in order to render with the quadtree...

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}