Hello everyone,
I’ve created a very simple test app with Away3D: an sphere with a earth texture.
I don’t know why but this single primitive is chopping my app and it is not very smooth. Could anyone help me?
((I am using Away3D 4.0))
this is my code:
[SWF(frameRate="60")]
public class GettingStartedWithAway3D extends Sprite
{
private var _view : View3D;
private var _camera:Camera3D;
private var _ctr : ObjectContainer3D;
private var _light : PointLight;
[Embed(source="../embeds/earth1024.jpg")]
public function GettingStartedWithAway3D()
{
super();
_view = new View3D();
// Setup camera
_camera = new Camera3D();
_camera.position.y = -500;
_camera.x = 0;
_camera.y = 170;
_camera.z = -145;
_view.camera = _camera;
this.addChild(_view);
this.addEventListener(Event.ENTER_FRAME, _handleEnterFrame);
_ctr = new ObjectContainer3D();
_view.scene.addChild(_ctr);
var material2 : BitmapMaterial = new BitmapMaterial(new Albedo2().bitmapData);
_ctr.addChild(new Sphere(material2, 200, 50, 30)).y = 0;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, onStageResize);
}
private function onStageResize(event : Event) : void
{
_view.width = stage.stageWidth;
_view.height = stage.stageHeight;
}
private function _handleEnterFrame(ev : Event) : void
{
_ctr.rotationX -= .01;
_view.render();
}
}