Hello. I've tried to create a simple scene with a colored sphere on a
SpriteVisualElement and add it to a BorderContainer.
But as a result I get just a WHITE rectangle. (As I understood, even a
rough scene would have been black).
I've tried to set backgroundAlpha="0" for the application and
backgroundFill=new SolidColor(0,0) for the BorderContainer.
It's my first away3D project and I'm also new to flash, so maybe,
there are just simple mistakes. Look through my code, please.
canvas is my BorderContainer.
away3DCanvas = new SpriteVisualElement();
view = new View3D();
view.x=canvas.width/2;
view.y=canvas.height/2;
view.camera.z=-300;
away3DCanvas.width=view.width=canvas.width;
away3DCanvas.height=view.height=canvas.height;
away3DCanvas.addChild(view);
objectContainer = new ObjectContainer3D();
material = new ColorMaterial(0xe4972a, 0.5)
view.scene.addChild(objectContainer);
objectContainer.addChild(new Sphere(material));
canvas.addElement(away3DCanvas);
view.render();
I've looked through the BasicTemplate.as stored here and there a
Camera3D and a Scene3D are also created. But I get errors on this,
because camera and scene properties of the View3D are read-only. In
the sample-code for broomstick from the away3D site these objects are
not created too.
So, what the problem can be? Thank you.