Problem:When I click a plane3D object, how can i get the mouse event position on plane3D?

Software: Away3D 4.x

happy3d, Newbie
Posted: 15 February 2012 11:23 AM   Total Posts: 6

I want to drag some plane by mouse.
Could someone show me an example about draging object in away3d4.0?

   

Avatar
Fabrice Closier, Administrator
Posted: 15 February 2012 01:11 PM   Total Posts: 1265   [ # 1 ]

Here some snippets..

private function initDrag() : void
  {
  //_drag3D = new Drag3D(_view, ObjectContainer3D(_sphere)); //third param optional default plane = xz plane
  //_drag3D.offsetCenter = true;// offsets mouse if true or drag sticks to object center
 
  //case of dragging a container and its children
  //_drag3D = new Drag3D(_view, _containerToDrag);
  _drag3D = new Drag3D(_view, _sphere);
  _drag3D.plane = Drag3D.PLANE_ZY;
  //_drag3D.debug = true;
  }
 
  public override function onCameraRender():void
  {
  _drag3D.updateDrag();
  //trace(_drag3D.getIntersect());
  }

   

happy3d, Newbie
Posted: 16 February 2012 01:45 AM   Total Posts: 6   [ # 2 ]

Thank you,I didn’t know Darg3D class,it’s useful! and i’m so shy about this problem..

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X