Papervision3D Path Extrude - Based on Away3D
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

One Comment
Quite legit, sir. Thanks for the port.
One Trackback
[...] Others have been exploring this subject as well, you can find their experiments here and here and here. [...]