Are the cone and sphere intersecting correctly in my code?

Click For Summary
SUMMARY

The discussion focuses on detecting intersections between a cone and a sphere using a specific algorithm outlined on GameDev.net. The user is experiencing inconsistencies in intersection results, prompting a review of both the mathematical principles and the implementation of the code. The core issue revolves around calculating the closest point on the cone to the sphere's center, which is critical for determining intersection based on the sphere's radius. The user has already conducted preliminary tests to identify the problem area.

PREREQUISITES
  • Understanding of geometric intersection algorithms
  • Familiarity with 3D coordinate systems
  • Knowledge of vector mathematics
  • Experience with programming in a game development context
NEXT STEPS
  • Research "cone-sphere intersection algorithms" for detailed mathematical approaches
  • Study "vector projection techniques" to find the closest point on the cone
  • Explore "3D geometry libraries" that may simplify intersection calculations
  • Investigate "unit testing for geometric algorithms" to validate intersection logic
USEFUL FOR

This discussion is beneficial for game developers, mathematicians working with 3D geometry, and anyone involved in collision detection algorithms in computer graphics.

chrom68
Messages
12
Reaction score
0
I am looking to test detect if a cone (described by an apex, angle theta and axis) and a sphere (defined by a sphere centre and a radius) intersect.

Please see here for a complete description (because i can't post the code here):

http://www.gamedev.net/community/forums/topic.asp?topic_id=513868

I am having trouble doing a simple test using this algorithm at the bottom of the link, which brings into question either the code or the validity of the math principles used. Intersections and Misses of the cone and sphere detections aren't consistent. Any advice on what is wrong with the math or the code?
 
Physics news on Phys.org
I've narrowed down the problem to looking for the closest point on the cone, to the sphere's centre (most likely a perpendicular distance away). The sphere's centre could be inside or outside the cone, hence the radius is the key to knowing whether there is an intersection or not. I've performed a test which allows me to do this, so now i need some help on getting the closest point.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 9 ·
Replies
9
Views
7K
  • · Replies 2 ·
Replies
2
Views
564
Replies
4
Views
3K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
2
Views
3K
Replies
3
Views
5K