Sign in to follow this  

Ellipsoid Collision Problem

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Given a triangle intersecting an ellipsoid with Normal 'n' and knowing the points A for the center of the ellipsoid, B for the closest point in the triangle to the point A, C as point B projected onto the ellipsoid surface and of course knowing the radii of the ellipsoid, how can I determine the lenght of the green line on the picture, given that the line is parallel to the triangle normal? The idea is that the ellipsoid, if moved along the normal direction the "lenght" of this line, would come to rest on the triangle's point B. Ideas? Thanks!

Share this post


Link to post
Share on other sites
I don't know if this will work as it seems simple but:

Use the equation x^2/a^2 + y^2/b^2 = 1. (a = semimajor axis, b = semiminor axis) and since you know the coordinates of B (in your diagram) set the x comonent of B to a point on the ellipse (equation above) and solve for y. You will then receive two values for y and (from the point of view in your picture, you would want the negitive value, but if not i'm sure you could figure a way to get the right one), then with the coordinates of your new point and B just use the equation

d = sqrt((x2 - x1)^2 + (y2 - y1)^2)

to get the length of the green line.

There should also be other methods to get this but I think they would all take a similiar approach (i.e. find a point P on the ellipse where P.x = B.x and solve to get P.y, then calculate the distance between P and B).

Some sites that may help you.
As always.
In the 'Equations/Graphing' section.

Good luck.

Share this post


Link to post
Share on other sites
Ok, haven't worked the math out on this, but here is my instinct:

If B is on the side of the triangle, then AC must be parallel to n. This is because the shortest distance between a line and a point is always along the perpendicular line that passes through the point. In this case, the green line is really BC, and since in the problem statement you say you know both B and C the solution is just the distance between the two.

If B is actually a vertex of the triangle, then it strikes me that the problem would not be well defined because there would be a choice of two line segments to solve it for.

Share this post


Link to post
Share on other sites
Quote:
Original post by intrest86
Ok, haven't worked the math out on this, but here is my instinct:

If B is on the side of the triangle, then AC must be parallel to n. This is because the shortest distance between a line and a point is always along the perpendicular line that passes through the point. In this case, the green line is really BC, and since in the problem statement you say you know both B and C the solution is just the distance between the two.

If B is actually a vertex of the triangle, then it strikes me that the problem would not be well defined because there would be a choice of two line segments to solve it for.


No, thats not right, the segment AC is not parallel to n because the closest point in the plane to A is not B, I tried that and the result is always off (IE B always intersects the ellipsoid if done that way, sometimes more sometimes less.

McCoy:

I think your idea may work, but I would have to find which coord I am missing all the time, in this case the normal is 0,0,1 but I may need to find out the same thing for any normal.

I think what I want is a sphere-ray intersection to find the point where the line intersects the surface then find the distance to the plane from that point.

Thanks guys.

Share this post


Link to post
Share on other sites
Yup, solved it, what I did was to use the sphere-ray intersection algorithm on a unit radius sphere dividing the input vectors by the radii (in such a way that all vectors reside in a coordinate system in which the ellipsoid is a unit sphere), aply rotation and then get it back to real world coords... its more complicated than it sounds, I am pretty happy with the results as you may imply from the following image filename [smile]:

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

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