OrthographicLens.unproject

Software: Away3D 4.x

movieclip, Newbie
Posted: 13 April 2015 08:05 AM   Total Posts: 10

away3d.cameras.lenses.OrthographicLens.as

51   override public function unproject(...):Vector3D
...
56 v.x = nX + translation.x;
57 v.y = nX + translation.y; //should be v.y = -nY + translation.y;
58 v.z = sZ;
59 v.w = 1;
...

*away3d-core-fp11-4.1.6

   

movieclip, Newbie
Posted: 13 April 2015 04:22 PM   Total Posts: 10   [ # 1 ]

Example:

public class AwayUnprojectTest extends Sprite
 {
  
private var _view:View3D;
  private var 
_camera:Camera3D;
  private var 
_trident:Trident;
  
  public function 
AwayUnprojectTest()
  
{
   init
();
  
}

  
private function init():void
  {
   _view 
= new View3D();
   
addChild(_view);
   
_camera = new Camera3D(new OrthographicLens(800));
  
// _camera = new Camera3D(new PerspectiveLens()); // PerspectiveLens works well
   
_camera.position = new Vector3D(-500,1000,-1000);
   
_camera.lookAt(new Vector3D());
   
_view.camera _camera;
   
   
_trident = new Trident();
   
_view.scene.addChild(_trident);
   
   
addEventListener(Event.ENTER_FRAMEonEnterFrameHandler);
  
}

  
protected function onEnterFrameHandler(event:Event):void
  {
   _trident
.position _view.unproject(mouseXmouseY500);
   
_view.render();
  
}
 } 
   

DawnKing, Newbie
Posted: 19 January 2016 03:41 AM   Total Posts: 1   [ # 2 ]

You’are right! Thank you!
And I find the github pull at https://github.com/away3d/away3d-core-fp11/pull/692

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X