Sign in to follow this  

How can i do mouse_over event on a line object i created?

This topic is 4866 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have a line object that i have created (in vb). I want to find out when the mouse on the screen goes over the line, i want to highlight the line but how can i check that the mouse cursor is over it? Btw the line has 3d coordinates and i have three different view boxes which have: side on view (x-y plane), plan view (x-z plane), and front view (z-y plane).

Share this post


Link to post
Share on other sites
Since a line is infinitely thin, you can't really have the mouse "over" it. However, you can check if it's close (less than 2 pixels away for example). For a 2D line, you'd use the point-to-line distance formula (just Google for it). Since your line is actually a line segment probably, not an infinitely long line, you might want to search for distance from point to line segment. For a 3D line, first project it onto 2D, then check for nearness to the 2D line segment you get.

Share this post


Link to post
Share on other sites

This topic is 4866 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this