Drag Mesh with the mouse

Software: Away3D 4.x

TaktiTech, Newbie
Posted: 31 July 2014 07:20 AM   Total Posts: 2

 

Hi,
I am trying to drag a mesh object with the mouse but has some problems
how can i drag the object with a timer event or enter frame event?
i need the object to follow the mouse on the X and the Y
This is what i tried with MouseEvent3D but with no luck
PLEASE HELP


PlayerHandle = new Mesh(new CubeGeometry(200, 100, 5));
_view.scene.addChild(PlayerHandle);
PlayerHandle.mouseEnabled = true;
PlayerHandle.addEventListener(MouseEvent3D.MOUSE_MOVE, HandlePlayerHandler);

public function HandlePlayerHandler(me3d:MouseEvent3D):void
{
  PlayerHandle.x = me3d.scenePosition.x; 
}

public function UpdateScene(e:Event):void
{
  _view.render();
}

   

Avatar
Fabrice Closier, Administrator
Posted: 02 August 2014 11:02 AM   Total Posts: 1265   [ # 1 ]

Try the Drag3D class, it’s made for this… it will only require an “update();” before your render

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X