Jump to content

  • Log In with Google      Sign In   
  • Create Account


Intercepting a line


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Hachaso77   Members   -  Reputation: 231

Like
0Likes
Like

Posted 29 March 2013 - 01:18 PM

I have drawn a line from 0, 0, 0  to 0, 1, 0. So in other words it drawn going upward.

 

How can I check of some object intercept my line ?

 

Any detailed description or tutorial?

 

 



Sponsor:

#2 Waterlimon   Crossbones+   -  Reputation: 2434

Like
0Likes
Like

Posted 29 March 2013 - 01:23 PM

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, 29 March 2013 - 01:24 PM.

o3o


#3 Hachaso77   Members   -  Reputation: 231

Like
0Likes
Like

Posted 29 March 2013 - 02:37 PM

Ohh 

 

I want to check of a Sphere is intercepting my Line.

More then that I don't know. Solutions to the problem?



#4 landagen   Members   -  Reputation: 376

Like
0Likes
Like

Posted 29 March 2013 - 03:29 PM

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.








Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS