1
\$\begingroup\$

I have an origin point, and normal vector of a 3D plane. I want to calculate 4 vertices to use as the corners of a 2 triangle quad to render the plane.

\$\endgroup\$
  • 1
    \$\begingroup\$ Looks like you're kind of missing a vector here. Without it, there is an infinite possibility of placement (as if you would "rotate" your quad around that normal vector). \$\endgroup\$ – Vaillancourt Mar 6 at 3:20
  • \$\begingroup\$ could I get a second vector parallel to the plane by getting a perpendicular vector to the normal? using dot or cross ? \$\endgroup\$ – kevzettler Mar 6 at 20:16
  • 1
    \$\begingroup\$ Jay gives you a solution for what you propose; this will give you a quad. If that's all you need, thats great! It may not be oriented the way you want. I suggest you try it and either comment on the answer, edit your question or post a follow up question if you need something more precise. \$\endgroup\$ – Vaillancourt Mar 6 at 20:52
2
\$\begingroup\$

Here's one way that I can think of to do it.

Find a point on the plane a other than the origin, o. The vector a - o lies on the plane, so is guaranteed perpendicular to the plane normal. Normalise the vector a - o and call it x.

Take the cross product of x and the plane normal and call it y. y is guaranteed to be perpendicular to both x and the plane normal.

The four points of a square are now o + x, o + y, o - x, o - y.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.