package { import away3d.containers.View3D; import away3d.lights.DirectionalLight3D; import away3d.materials.PhongBitmapMaterial; import away3d.primitives.Sphere; import away3d.core.utils.Cast; import flash.display.Bitmap; import flash.display.Sprite; [SWF(width="500", height="200", frameRate="60", backgroundColor="#FFFFFF")] public class Basic09_PhongBitmapMaterial extends Sprite { [Embed(source="resources/earthmap1k.jpg")] private var earthBitmap:Class; public function Basic09_PhongBitmapMaterial() { var view:View3D = new View3D({x:250,y:100}); addChild(view); var earthMaterial:PhongBitmapMaterial = new PhongBitmapMaterial( Cast.bitmap(earthBitmap) ); var sphere:Sphere = new Sphere({material:earthMaterial}); view.scene.addChild(sphere); // We'll need some light sources to see anything var light:DirectionalLight3D = new DirectionalLight3D(); view.scene.addChild(light); // Move the light away from the default 0,0,0 position so we'll see some reflection light.y = 500; light.x = -300; light.z = -200; view.render(); } } }