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...