I'm completly lost. I can't see any major difference between the demo code and mine except for the sprite is in a external swf.
Here is my code (ripped off some unrelated stuff):
public class EngineDelegate extends EventDispatcher
{
private var scene:Scene3D;
private var camera:Camera3D;
private var _view:View3D;
public function get view() : View3D
{
return _view;
}
public function EngineDelegate(stage:Stage)
{
scene = new Scene3D();
camera = new Camera3D({z:-30000});
_view = new View3D({scene:scene, camera:camera});
_view.forceUpdate=true;
}
public function insertObject(object:NavigationObject3D) : void
{
var plane:Plane = new Plane({
width:800,
height:600,
yUp:false,
segmentsW:4,
segmentsH:4,
bothsides:true
});
plane.extra = object;
plane.position = object.initialPosition;
plane.material = createMaterial(object);
plane.rotationZ = object.initialRotationZ;
if(object.mouseEnabled)
{
plane.addEventListener(MouseEvent3D.MOUSE_UP,
onPlaneClick);
}
scene.addChild(plane);
pos.watch(plane);
}
private function createMaterial(object:NavigationObject3D) :
IMaterial
{
if(object.texture is Bitmap)
{
var mat:BitmapMaterial = new
BitmapMaterial(Bitmap
(object.texture).bitmapData);
mat.smooth = true;
return mat;
}
else
{
var mat2:MovieMaterial = new
MovieMaterial(Sprite(object.texture),
{interactive:true, smooth:true});
return mat2;
}
}
}
I'm doing something wrong? The movieMaterial does work if the sprite
is in a external swf?
Thanks for your help....
