Home

Tutorials

Portfolio

Blog

 

Highlights

 

Using primitives in Papervision 3D

Page 4

1 | 2 | 3 | 4 | 5 |Next

Adding each of the other primitives is fairly simple. I've listed the basic code for each below, with an explanation of the parameters for each primitive.

var can:Cylinder=new Cylinder(null,100,200,10); 
can.x=-500;
can.y=-300;

The 3 parameters used for the cylinder are materials, radius, height and segments.

var flat:Plane=new Plane(null,200,200); 
flat.x=0;
flat.y=-300;

The 3 parameters used for the plane are materials, width and height.

var jet:PaperPlane=new PaperPlane(null,2);
jet.x=500;
jet.y=-300;

The 3 parameters used for the paper plane are material and scale.

Don't forget to add each of the objects to your scene using the following syntax:

scene.addChild(instancename);

Finally we will add the cube...

1 | 2 | 3 | 4 | 5 |Next