tag:blogger.com,1999:blog-6184383319550035753.post142917030846805455..comments2024-03-27T23:29:27.484-06:00Comments on Game Programming and Development: Using Vector Mathematics, Line segment against sphere intersection testNichttp://www.blogger.com/profile/11938742522409928163noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-6184383319550035753.post-71973240359710573422021-01-29T13:52:37.405-07:002021-01-29T13:52:37.405-07:00Also, I think it should be:
return ((sphereRadius...Also, I think it should be:<br /><br />return ((sphereRadius * sphereRadius) >= sphereToLineLenSquared);<br /><br />because both should be squared so they can be compared in the same units.Ph0t0nhttps://www.blogger.com/profile/02101638293717665312noreply@blogger.comtag:blogger.com,1999:blog-6184383319550035753.post-39066471984711433522017-11-13T20:47:43.478-07:002017-11-13T20:47:43.478-07:00Really helpful article. I actually had one doubt t...Really helpful article. I actually had one doubt though, what if there are 2 intersection points. i.e what if the line segment just passes through the sphere?Anonymoushttps://www.blogger.com/profile/01380110773527912602noreply@blogger.comtag:blogger.com,1999:blog-6184383319550035753.post-56099372130591314252013-05-14T10:04:43.128-06:002013-05-14T10:04:43.128-06:00Hello
Thanks for the post. It was very useful for...Hello<br /><br />Thanks for the post. It was very useful for me.<br /><br />I just wanted to say that I think the final return instruction is wrong (line 29). <br /><br />should be:<br />return (SqrLengSphereToLine <= SphereRadius);<br /><br />From the text you write, <br /><br />"And finally we see here that the radius of the sphere is indeed greater than the distance from the point on the line segment closest to the center of the sphere, which verifies the sphere is intersecting the line segment.<br />"<br /><br />We can see you mean to have the condition as I suggest?<br /><br />Regards<br /><br />MiguelAnonymoushttps://www.blogger.com/profile/11708024744550460896noreply@blogger.com