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

A template class for all the examples


Because the examples have a lot in common, we will first create a template class (based on the BookTemplateExample), which we can reuse as a starting point for each example.

The template class for this chapter looks like this:

package {
import flash.events.Event;
import org.papervision3d.view.BasicView;
import org.papervision3d.core.geom.Particles;
import org.papervision3d.core.geom.renderables.Particle;
public class ParticleTemplate extends BasicView
{
private var numberOfParticles:uint;
private var easeOut:Number = 0.3
private var reachX:Number = 0.1
private var reachY:Number = 0.1
private var reachZ:Number = 0.5;
public function ParticleTemplate()
{
super(stage.stageWidth,stage.stageHeight);
stage.frameRate = 40;
init();
startRendering();
}
private function init():void
{
//code to be added
numberOfParticles = 1000;
for(var i:uint = 0; i < numberOfParticles; i++)
{
//code to be added
}
}
private function randPos():Number
{
template classcreatingreturnMath...
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 $15.99/month. Cancel anytime}