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

Drawing vector shapes—lines, circles, and rectangles


The integrated VectorVision library not only lets you create 3D text, it also provides a VectorShape3D class that allows drawing basic vector shapes such as lines, circles, and rectangles. The shapes are initially drawn in 2D and then projected in 3D space.

Working with vector shapes requires two classes, VectorShapeMaterial—located in the org.papervision3d.materials.special package—and VectorShape3D - located in the org.papervision3d.objects.special package. To create a vector shape material, use the VectorShapeMaterial class.

var material:VectorShapeMaterial = new VectorShapeMaterial();

The constructor of this class does not take any parameters.

When you want to draw a shape, you must instantiate VectorShape3D. The following code draws a line:

var line:VectorShape3D = new VectorShape3D(material);
line.graphics.lineStyle(2,0x00CCFF);
line.graphics.beginFill(0x666699)
line.graphics.moveTo(-300,-300);
line.graphics.lineTo(300,-300);
scene...
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}