#### Archived

This topic is now archived and is closed to further replies.

# Planes and Points and Normals

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

## Recommended Posts

Forgive me, I am a maths retard, but I have to use some maths for a simple sphere-polygon collision system I need to write. I am currently just trying to test if a sphere hits a plane in space by getting the distance between the plane and the centre of the sphere and checking to see if it is smaller than the radius. The problem is it is not working and i have come to the conclusion it must be in my calculation of the distance between the plane and the *centre* of the sphere. My plane is defined by a normal N to the plane and a point on the plane P...Is it correct that the distance from some point *not* on the plane B, to the plane is: distance = Nx*Bx + Ny*By + Nz*Bz + D where: D = -(Nx*Px + Ny*Py + Nz*Pz) ?? Thanks. I will have more maths questions over the next week.

##### Share on other sites
To get the distance between a poly (say three points v1, v2, v3)and sphere (I assume we mean centre point p) just use :

distance = normal.DotProduct(pt-v1);

then
collision occured

1. 1
2. 2
Rutin
20
3. 3
khawk
16
4. 4
A4L
14
5. 5

• 11
• 16
• 26
• 10
• 11
• ### Forum Statistics

• Total Topics
633756
• Total Posts
3013707
×