This works fine for me:

// Sphere
[Embed(source='../embeds/Hal2000.jpg')]
private var assetSphere:Class;
sphereMat = new BitmapMaterial( new assetSphere().bitmapData );
sphere = new Sphere(sphereMat,2000,30,30);
view.scene.addChild(sphere);





On 15 April 2011 09:49, Lucid <[email protected]> wrote:

> 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