Hello everyone.
I am very new to away3D development and currently using away3D 3.6.0
(since there is to few documentation for away3D 4 for my needs)
I ran into a problem that I can't figure out.
I have an object3D that is rotated 90° on the Y-axis. In that scenario
object.rotationX and object.rotationZ are doing *exactly* the same
thing, which seems to suggest to me, that rotationZ is using the
global axis and rotationX the object's local axis.
Test Project: (Main.as)
package
{
import flash.display.Sprite;
import flash.events.Event;
import away3d.containers.View3D;
import away3d.primitives.Cube;
public class Main extends Sprite
{
private var view:View3D;
private var cube:Cube;
public function Main()
{
view = new View3D({x:stage.stageWidth * .5, y:
stage.stageHeight * .
5});
addChild(view);
cube = new Cube();
cube.rotationY = 90;
view.scene.addChild(cube);
addEventListener(Event.ENTER_FRAME, enterFrame);
}
private function enterFrame(e:Event):void
{
view.render();
cube.rotationX += 10;
cube.rotationZ -= 10;
// object won't move at all
// comment out any one of the two and it will rotate
around the
same axis
}
}
}
Please someone explain to me what is happening ... and how I can
always use global rotation values instead of local ones.