Sign in to follow this  

Intercepting a line

Recommended Posts

Use google?


What kind of intersection you want to check for?

Some specific like line-plane (line-triangle?)?


Or do you want to know how to properly check for intersection with a big model with many triangles?


Or perhaps you want something like raycasting?

Edited by Waterlimon

Share this post

Link to post
Share on other sites

Here is how I would do it:


the distance from one point to another is sqrt( (X2 - X1)^2 + (Y2 - Y1)^2 + (Z2 - Z1)^2 )


The equation for your line is  0xi + 1yj + 0zk => yj


So you would want to see if that line ever comes closer to the center of the sphere than the radius of the sphere.  So basically, is there any value of y (for your line) that would make the distance calculation above be less than or equal to R.

Share this post

Link to post
Share on other sites

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