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

Creating particle fields with the ParticleField class


The ParticleField class lets you create a field of particles in an easy way. The particles are positioned randomly within limits that you set. The following lines demonstrate how you can instantiate a particle field and add it to the scene:

var particleField:ParticleField = new ParticleField(material,1000,5, 1800,1800,1800);
scene.addChild(particleField);

When you create a particle field, you don't have to instantiate the Particles or Particle classes—the ParticleField class takes care of this.

The ParticleField constructor has one required and five optional parameters as shown in the next table:

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}
 

Parameter

Data type

Default value

Description

1

mat

ParticleMaterial

The material to apply to the particles. This can be any of the three types we have discussed.

2

quantity

int

200

Sets the number of particles.

3

particleSize

Number

4

Defines the size (that is, scale) of the particles.

4

fieldWidth...