Reputation: 7788
Picking an object.
How can I convert my mouse coordinates (actually 0,0 since the mouse is locked to the mid) to world coordinates?
How do I get the actual view direction?
pseudo code
int mx,my = convert(Mouse.getX()), convert(Mouse.getY())
int mz = ??
int dx, dy, dz = ?? # direction of view
drawRay(mx, my, mz,
dx, dy, dz + 10) # 10 shall be the range to pick
# later check for intersections
Upvotes: 1
Views: 246