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.
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
Take the cross product of
x and the plane normal and call it
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.