Distance between polygons in 3d? (points of contact as a function of time)

AI Thread Summary
To represent a polygon in 3D for collision detection, it's essential to express its points as equations based on vertex positions and velocities. The proposed equation involves calculating the time of contact by setting the distance between polygons to zero and solving for time. While most 3D programs use triangles for efficiency, the focus here is on precision and predicting contact points, which complicates the process. Finding the minimum distance between two triangles involves more complex calculations than for points or lines, and the discussion suggests that parametrizing the points could be a potential solution. Ultimately, the goal is to determine when the trajectories of the polygons will intersect.
Requerent
Messages
8
Reaction score
0
I was just wondering, is there a way to write a polygon as an equation in 3d? (Yes, a polygon, NOT a polyhedra)

It's intended to be a part of a collision detection program, so I need to be able to represent all points on a given polygon as an equation. Each polygon is being acted upon by forces as a function of time, so if I set the distance to 0 and solve for time, I get the time of contact.

How can I represent a polygon in such a way? I know the position of all vertices that make up this polygon (and the one it is to be compared to). It looks something like this-

Position.A + Velocity.A * Time = Position.B + Velocity.B * Time
so,
Time = (Position.A-Position.B) / (Velocity.A-Velocity.B)

Where position is a polygon and velocity is a vector. It's more complicated than this, but all I need is a way to plug a polygon into position.
 
Mathematics news on Phys.org
Requerent said:
It's intended to be a part of a collision detection program, so I need to be able to represent all points on a given polygon as an equation. Each polygon is being acted upon by forces as a function of time, so if I set the distance to 0 and solve for time, I get the time of contact.

Practically every 3D program since the advent of computers represents all objects as a collection of triangles. Is there some need to do it a different way?

Here's some nice links for collision detection. This site actually has quite a few nice programming articles for computer graphics:

http://www.gamedev.net/reference/list.asp?categoryid=45#199
 
Last edited by a moderator:
Oh, polygon implies triangle =/ (i'm not a math person- sorry).

Most of those systems use a corrective technique, and focus on efficiency. I'm focusing on precision and prediction, which is not very efficient.

Advanced techniques use a convex hull through minkowski addition, I don't understand this one bit, and don't really want to figure it out until I can do proper face to face comparisons. Sadly, the way I'm comparing is not the way others typically do it. In such a way, I need a little help making my own as opposed to learning how others do it.

Most of those articles focus on Narrow phase isolation efficiency and 2D corrective techniques (or on stuff that I'm not quite ready for).

Would my problem be easier to explain in terms of triangles?

I think part of my problem is that I can't just set the distance to 0 and solve. I need to find the point of contact between two triangles and then solve for time. For lines/points it's easy, but for triangles I'm at a loss.
 
So you're looking for a way to find the distance between the two nearest points on a triangle?

Well, there's a nifty equation for a triangle. Given endpoints p0, p1, and p2, the triangle is the set of all points p such that:

Angle(p0, p, p1) + Angle(p1, p, p2) + Angle(p2, p, p0) = 360º

(where Angle(A, B, C) is the angle between line segments AB and BC).

I'm not sure how useful that equation would be to find a minimum distance.

You can parametrize both points in 4 variables, so it might be possible (but difficult) to do a calculus minimum-value style analysis.
 
Err, the distance between two Triangles, not two points on a triangle.

The distance between two triangles will change as a function of time. So I intend to set the distance to 0 and solve for time to see when their trajectories will touch.
 
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...
Back
Top