package { import flash.display.Sprite; import org.papervision3d.materials.WireframeMaterial; import org.papervision3d.objects.primitives.Arrow; import org.papervision3d.objects.primitives.Cone; import org.papervision3d.objects.primitives.Cube; import org.papervision3d.objects.primitives.Cylinder; import org.papervision3d.objects.primitives.PaperPlane; import org.papervision3d.objects.primitives.Plane; import org.papervision3d.objects.primitives.Sphere; import org.papervision3d.materials.utils.MaterialsList; import org.papervision3d.view.BasicView; public class Index extends Sprite { public function Index():void { var basicview:BasicView = new BasicView(); var material:WireframeMaterial = new WireframeMaterial(0xFF0080,50,1); //-------------------------------------------------------------------------- // Plane //-------------------------------------------------------------------------- var plane:Plane = new Plane(material, 100, 100, 2, 2); plane.x = 200; plane.y = 200; //-------------------------------------------------------------------------- // Sphere //-------------------------------------------------------------------------- var sphere:Sphere = new Sphere(material, 100, 8, 6); sphere.x = -200; sphere.y = -200; //-------------------------------------------------------------------------- // Cube //-------------------------------------------------------------------------- /*** Cubeの場合だとMaterialsListでの指定に注意 ***/ var cube:Cube = new Cube(new MaterialsList({all : material}), 500, 500, 500, 1, 1, 1); //--------------------------------------------------------------------------- // Cone //--------------------------------------------------------------------------- var cone:Cone = new Cone(material, 100, 100, 8, 6); cone.x = -200; cone.y = 200; //--------------------------------------------------------------------------- // Cylinder //--------------------------------------------------------------------------- var cylinder:Cylinder = new Cylinder(material, 100, 100, 8, 6, -1); cylinder.x = 200; cylinder.y = -200; //--------------------------------------------------------------------------- // paperPlane //--------------------------------------------------------------------------- var paperPlane:PaperPlane = new PaperPlane(null, 4); //--------------------------------------------------------------------------- // Arrow //--------------------------------------------------------------------------- var arrow:Arrow = new Arrow(null); arrow.y = -400; //-------------------------------------------------------------------------- // 登録 //-------------------------------------------------------------------------- addChild(basicview); basicview.scene.addChild(plane); basicview.scene.addChild(sphere); basicview.scene.addChild(cube); basicview.scene.addChild(cone); basicview.scene.addChild(cylinder); basicview.scene.addChild(paperPlane); basicview.scene.addChild(arrow); basicview.startRendering(); } } } papervision初めの1歩