Original Post
🔒 Locked
[D3D] Picking a line
Advertisement
Point: That's easy. Transform it into screen space, compare to mouse position. If distance is less than something (less than a pixel, for example), consider it picked.
Line: Transform both endpoints into screen space, use 'distance between point and line' calculation (google it) to find out how far the mouse position is from the line, and if close enough also check that it's not beyond the two endpoints (i.e., it's on the line segment).
Line: Transform both endpoints into screen space, use 'distance between point and line' calculation (google it) to find out how far the mouse position is from the line, and if close enough also check that it's not beyond the two endpoints (i.e., it's on the line segment).
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement