Papervision3D Path Extrude

Papervision3D Path Extrude - Based on Away3D

This movie requires Flash Player 9

Usage example:

materialsList = new MaterialsList();
materialsList.addMaterial( topMat,”top” );
materialsList.addMaterial( bottomMat,”bottom” );
materialsList.addMaterial( rightMat,”right” );
materialsList.addMaterial( leftMat,”left” );
materialsList.addMaterial( frontMat,”front” );
materialsList.addMaterial( backMat,”back” );

   var segmentPoints:Array = new Array();
   //generate points
   var aPoints = [];
   //here a U form
   aPoints.push(new Number3D(-100, 100, 0));
   aPoints.push(new Number3D(-100, 0, 0));
   aPoints.push(new Number3D(-50, 0, 0));
   aPoints.push(new Number3D(-50, -150, 0));
   aPoints.push(new Number3D(0, -150, 0));
   aPoints.push(new Number3D(50, -150, 0));
   aPoints.push(new Number3D(50, 0, 0));
   aPoints.push(new Number3D(100, 0, 0));
   aPoints.push(new Number3D(100, 100, 0));
   //generate path
   var aPath:Path =
   new Path([
   new Number3D(-400, 0, -150),
   new Number3D(-200, 300, 0),
   new Number3D(0,0,0),
   null, new Number3D(200, -300, 0),
   new Number3D(400, 0, 0),
   null, new Number3D(600, 300, 0),
   new Number3D(800, 0, 0),
   null, new Number3D(1000, -300, 0),
   new Number3D(1200, 0, 150)
   ]);
   //scale variation
   var aScale = [];
   aScale.push(new Number3D(1, 1, 1));
   aScale.push(new Number3D(2, 1, 2));
   aScale.push(new Number3D(2, 1, 2));
   aScale.push(new Number3D(3, 1, 3));
  �
   aPath.worldAxis = new Number3D(0,0,1);
   pathextrude= new PathExtrude(materialsList, aPath, aPoints, aScale,
               {flip:false,
               excludeFaces:”",
               closepath:false,
               reverse:false,
               aligntopath:true,
               coverall:true,
               scaling:1,
               hSegments:1,
               wSegments:1,
               subdivision:6,
               closewall:true,
               thickness:30
               });
   scene.addChild(pathextrude);

 

SourceCode:
Path Extrude Download

This entry was posted in Papervision3D and tagged , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

One Comment

  1. Posted January 6, 2009 at 7:01 pm | Permalink

    Quite legit, sir. Thanks for the port.

One Trackback

  1. [...] Others have been exploring this subject as well, you can find their experiments here and here and here. [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*