what is an good way to define a bounded plane to make line intersections easy?

1k Views Asked by At

I want to define a bounded plane, ie a rectangle in 3d space. I realize it could be defined just by declaring its 4 vertices, but I will be using a line intersection algorithm many times on this shape so I want the definition to be somewhat useful for that purpose. Is there some standard way to define something like this?

1

There are 1 best solutions below

0
On

It is worth to define one corner as base point, and two perpendicular vectors for neighbor sides.

For example A, V=AB, U=AD. In this case

B = A + V
D = A + U
C = A + U + V
N = V x U   (normal to the plane is cross product of vectors)

Any point belonging to the plane has equation

P = A + v * V + u * U

And both coefficients v and u are in range 0..1 for points inside bounds