Home

Tutorials

Portfolio

Blog

 

Highlights

 

Using primitives in Papervision 3D

Page 3

1 | 2 | 3 | 4 | 5 |Next

Next we'll create a cone primitive with Papervision 3D.

To do this, simply add the following 3 lines to the previous code.

var cornet:Cone=new Cone(null,100,200,10);
cornet.x=500;
cornet.y=300;

The 4 parameters inside the brackets of the first line sets the material, radius, height and segments of the cone.

Finally we need to add the cone to the scene with the following:

scene.addChild(cornet);

This should result in an image displaying both a sphere and a cone.

Adding the other primitive shapes is almost as simple, apart from the cube, which is handled a little differently.

Next we'll create each of the other primitives and position them in the scene...

1 | 2 | 3 | 4 | 5 |Next