MATLAB: How do I get 3D coordiantes from a user-click?

Posted by Tim on Stack Overflow See other posts from Stack Overflow or by Tim
Published on 2010-05-06T20:14:38Z Indexed on 2010/05/06 20:18 UTC
Read the original article Hit count: 147

I'm using Matlab to create a small chess game for one of my courses this semester. The thing I'm having trouble with is having the user be able to select one of the chess pieces.

To simplify things, I'm making it so that the user selects a piece by clicking on the square that the chess piece resides on rather than clicking the piece itself (which I assume would be much more difficult). I know how to get the x and y coordinates of the view-port, but how do I transform these coordinates into 3-space coordinates?

I know that there are multiple x,y,z coordinates associated with each view-port coordinate, but I'm only interested in the x,y,z coordinate where z = 0 (since the board itself is in the x,y plane that intersects the z axis where z = 0).

Thanks!

© Stack Overflow or respective owner

Related posts about matlab

Related posts about matrices