Thank you for his response, Pierce.
It that you say has logic and is the first thing that I tried but
did not know how to do it because I think that it is necessary to
modify some class of away3d and there already I get lost. The OOP
still is a bit a mystery for me.
Might it put on the object inside two containers and move each of
them in an axis?
I have this that does not work very well:
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="31", quality="MEDIUM", width="500", height="300")]
public class Main extends Sprite
{
private var _view:View3D;
private var cubo:Mesh;
private var mouseIsDown:Boolean;
private var lastMouseX:Number;
private var lastPanAngle:Number = 0;
public function Main()
{
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
addEventListener(Event.ENTER_FRAME, _onEnterFrame);
addEventListener( MouseEvent.MOUSE_DOWN, _MouseDown );
addEventListener( MouseEvent.MOUSE_UP, _MouseUp );
_view = new View3D();
addChild(_view);
_view.camera.z = -300;
_view.camera.lookAt(new Vector3D());
cubo = new Mesh(new CubeGeometry(100,100,100));
_view.scene.addChild(cubo);
}
private function _onEnterFrame(e:Event):void
{
if (mouseIsDown)
{
cubo.rotationY = 0.5 * ( _view.mouseX - lastMouseX );
}
cubo.rotationY = (cubo.rotationY * 0.4) + lastMouseX;
_view.render();
}
private function _MouseDown( event:MouseEvent ):void
{
mouseIsDown = true;
lastPanAngle = cubo.rotationY;
lastMouseX = stage.mouseX;
}
private function _MouseUp( event:MouseEvent ):void
{
mouseIsDown = false;
}
}
}
But I not know how to drag the object correctly and with effect
“easing”.
Might someone say me something that should me clarify a bit the
things?
Thank you.
Pardon by my English.