Hi
I’m comming back to away after not using it for a looong time. I’m trying to do this tutorial: http://away3d.com/tutorials/Setting_Up_Your_Scene wich is VERY basic. However, I can’t get it to work correctly. As you can see on the image, the views y position seems to be off by almost a half screen.
What is coursing this?
Thanks,
Jakob
My code:
package
{
import away3d.containers.*;
import away3d.entities.*;
import away3d.materials.*;
import away3d.primitives.*;
import away3d.utils.*;
import flash.display.*;
import flash.events.*;
import flash.geom.Vector3D;
[SWF(backgroundColor="#000000", frameRate="60", width="640", height="960")]
public class flaraway extends Sprite
{
[Embed(source="../assets/checker.png")]
public static var checker:Class;
private var view:View3D;
private var plane:Mesh;
public function flaraway()
{
super();
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
view = new View3D();
addChild(view);
view.camera.z = -600;
view.camera.y = 500;
view.camera.lookAt(new Vector3D());
plane = new Mesh(new PlaneGeometry(700, 700), new TextureMaterial(Cast.bitmapTexture(checker)));
view.scene.addChild(plane);
addEventListener(Event.ENTER_FRAME, thisEnterFrame);
stage.addEventListener(Event.RESIZE, stageResize);
stageResize();
}
private function thisEnterFrame(e:Event):void
{
plane.rotationY += 1;
plane.y +=1;
view.render();
}
private function stageResize(event:Event = null):void
{
view.width = stage.stageWidth;
view.height = stage.stageHeight;
}
}
}