Attempting to apply a simple bitmap material to a sphere doesn't work
in Molehill? Really?! Flash Builder is already setup properly etc.
Here's the code:

package {
        import away3d.containers.View3D;
        import away3d.materials.BitmapFileMaterial;
        import away3d.primitives.Sphere;

        import flash.display.Sprite;
        import flash.events.Event;
        import flash.geom.Vector3D;

        public class molehill extends Sprite {

                private var view:View3D;
                private var sphere:Sphere

                public function molehill() {
                        var image:BitmapFileMaterial = new 
BitmapFileMaterial('image.jpg')
                              image.bothSides = true;
                        view = new View3D(); addChild(view)
                        view.camera.position = new Vector3D(0,0,0)
                        sphere = new Sphere()
                        sphere.radius = 2000;
                        sphere.segmentsW=24;
                        sphere.segmentsH=24;
                        sphere.material = image;
                        view.scene.addChild(sphere)
                        addEventListener(Event.ENTER_FRAME, frame)      }

                private function frame(e:Event):void{view.render()}
        }
}

Reply via email to