Get coordinates of mouse click in 3D scene

Software: Away3D 4.x

jth133, Newbie
Posted: 23 June 2015 01:40 PM   Total Posts: 5

EDIT: Figured it out smile

Hey everyone,

I’m running into an issue that I think probably has a relatively simple solution but is outside the realm of my mathematical know-how.

I have a scene set up for a game in which the camera is positioned above the playing field, looking directly down. As an example, the coordinates of the camera might be: x:25,000, y:10,000, z:0).

What I’m trying to do is determine the position of a mouse click in the scene. Since I’m looking straight down at the map, I need a way to determine the X/Z coords based on the X/Y position of the mouse click on the stage and the position of the camera.

Does anyone know a formula that would provide this information?

   

Kicker, Member
Posted: 23 June 2015 08:43 PM   Total Posts: 52   [ # 1 ]

You can directly access this information by listening to MouseEvent3D events.
Then, in your listener, just retreive event.localPosition.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X