• 0

[c#/XNA] Vectors, Planes


Question

I have groups of planes, defined as:

Vector3 normal;
float distance_from_origin;

I need to use where these planes intersect to create sides, defined as:

Vector3 vertex1;
Vector3 vertex2;
Vector3 vertex3;

Those sides then make up an object (I can do that once I have the sides).

Converting my group of planes into a group of sides is what I need help with.

I tried to do it myself but... I just have no idea where to start...

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Didn't try it myself, but here's what I would attempt, intuitively:

Find intersections between planes. This gives you lines.

Find intersections between lines. This gives you the vertices of the object.

What is it you are trying to achieve ?

Link to comment
Share on other sites

  • 0

Didn't try it myself, but here's what I would attempt, intuitively:

Find intersections between planes. This gives you lines.

Find intersections between lines. This gives you the vertices of the object.

What is it you are trying to achieve ?

The problem I'm having is I don't know how to check for if planes intersect or if lines intersect.

Link to comment
Share on other sites

  • 0

The problem I'm having is I don't know how to check for if planes intersect or if lines intersect.

Two planes intersect unless they are parallel (coplanar), that is, unless their normal vectors are colinear. In this case the cross-product of those vectors will be 0, so it's very easy to detect.

Two lines p1 + m1(d1), p2 + m2(d2) intersect if they are not colinear and there exists a point in common between them, that is, a point that satisfies both

p = p1 + m1(d1)

p = p2 + m2(d2)

Hence you're looking for the couple m1, m2 that satisfies

p1 + m1(d1) = p2 + m2(d2)

Check out:

http://www.netcomuk.co.uk/~jenolive/vect18d.html

and

http://mathforum.org/library/drmath/view/63719.html

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.