开发者

Tracing a ray from the camera to the mouse pointer in GLUT

开发者 https://www.devze.com 2023-02-21 18:31 出处:网络
I\'m no开发者_StackOverflowt really sure if it makes sense but I need to do and there is a chance there won\'t be any obstacle in front.Is\'s not clear what you mean by tracing but :

I'm no开发者_StackOverflowt really sure if it makes sense but I need to do and there is a chance there won't be any obstacle in front.


Is's not clear what you mean by tracing but :

1 You may be looking for gluUnProject to go from screen coordinates to space coordinates. With the help of the Z buffer for distance from camera, you can get the coordinates of 3D point which is seen at the specified pixel.

2 you want to draw a 3D line from camera origin to some 3D point at the mouse cursor. Well it's just a point at the mouse cursor.

0

精彩评论

暂无评论...
验证码 换一张
取 消