我想做的事
挑选一个对象。
要求/条件
- 我的鼠标总是在屏幕中央。
- 只选择第一个/最近的对象
我想知道的
如何将我的鼠标坐标(实际上是 0,0,因为鼠标锁定在中间)转换为世界坐标?
如何获得实际的视图方向?
我认为我必须做的
伪代码
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