package { import away3d.containers.View3D; import away3d.lights.DirectionalLight3D; import away3d.materials.PhongColorMaterial; import away3d.primitives.Sphere; import flash.display.Sprite; import flash.geom.Vector3D; [SWF(width="500", height="200", frameRate="60", backgroundColor="#FFFFFF")] public class ExPhongColorMaterial extends Sprite { public function ExPhongColorMaterial() { var view:View3D = new View3D({x:250,y:100}); addChild(view); // The same, using verbose syntax var colorMaterial:PhongColorMaterial = new PhongColorMaterial(0xFFA500); var sphere:Sphere = new Sphere(); sphere.material = colorMaterial; view.scene.addChild(sphere); // We'll need some light sources to see anything var light:DirectionalLight3D = new DirectionalLight3D(); // Move the light away from the default 0,0,0 position so we'll see some reflection light.direction = new Vector3D(500,-300,200); view.scene.addLight(light); // Render the view view.render(); } } }