Jump to content
  • Advertisement
Sign in to follow this  
Thomas M

Rectangle on Plane

This topic is 3766 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

I have a Plane, which is given by a point and a normal, and two points (PosMin, PosMax) which are also on the plane. How can I calculate the two Vectors "defining" the Rectangle on the plane? (The two vectors which fulfill PosMin + v1 + v2 = PosMax)

Share this post


Link to post
Share on other sites
Advertisement
There are no 'the' two vectors. Given your constraints, there are an infinite number of possible rectangles.

Share this post


Link to post
Share on other sites
you cant really. You'll need a second vector to decide the orientation on the plane.

For all you know, v1 could be (PosMax - PosMin), and v2 = Vector(0, 0, 0);

Share this post


Link to post
Share on other sites
Well, the two points on the plane should the min/max position of the rectangle.

What I'm searching for is the resulting Rectangle if I intersect the plane with the AABB defined by PosMin/PosMax.

[EDIT] isn't the orientation of the plane given by the normal?

ah, the equation posmin + v1 + v2 = posmax isn't what i'm searching for.

i'm actually searching for the other two points (not posmin, posmax) on the borders of the rectangle.

Share this post


Link to post
Share on other sites
Quote:
Original post by Thomas M
Well, the two points on the plane should the min/max position of the rectangle.

min/max in what coordinate system? You have a plane, but still have a degree of freedom on that plane. To visualize this, try it on a piece of paper, or Paint.

Draw two points. Now draw a rectangle with those two points. Okay, you drew one. Now draw another one, a different one. I think you'll find that it's possible. Rotate the paper if it helps. Now draw another one, and another one, etc. So which one is the 'right' one? :)

Share this post


Link to post
Share on other sites
posmin and posmax are in the same 3d coordinate system the plane is (x, y, z).

for each point in the rectangle it should be posmin.x < x < posmax.x, posmin.y < y < posmax.y and posmin.z < z < posmax.z.

imagine there is an AABB defined by posmin and posmax, i'm searching for the rectangle which results if i intersect my plane with the AABB.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!