# Plane equation to transformation matrix

This topic is 2563 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi,

I have the following problem:

I have a plane equation described by Ax+By+Cz=0. I would like to draw a part of this plane in OpenGL, but don't know how to convert A, B and C intro a transformationmatrix.

The original plane before multiplication is simply a quad (square) defined by the following points: (-1,0,-1), (1,0,-1), (1,0,1), (-1,0,1). Because D=0 there is no translation, so the middle of the plane should stay at (0,0,0).

A brief mathematical explanation would be fine.

thanks.

##### Share on other sites
I believe in order to define a plane you must have a constant d
[color=#1C2837][size=2]

[color=#1C2837][size=2]Ax+By+Cz + d = 0
[color=#1C2837][size=2]

[color=#1C2837][size=2]Work from there.
[color=#1C2837][size=2]

[color="#1c2837"]

##### Share on other sites
A plane given in Hessian form
p . n - d == 0
is infinite. It does have a normal defining its orientation and a distance from the origin of the reference co-ordinate system to the closest point of all points of the space that together build up the plane, but it does not have a (clear) tangent, bi-tangent, or origin (those values are more or less arbitrary). This is opposed to another representation form of a plane
O + u * t + v * b, u[sub]1[/sub] <= u <= u[sub]2[/sub], v[sub]1[/sub] <= v <= v[sub]2[/sub]
so that, assuming the typical |t| = |b| = 1 and t . b == 0,
t x b =: n
O . n =: d

Hence asking for a transformation that maps the given quad onto the plane gives ambiguous results.

You can pick any point p that fulfills
p . n - d == 0
as the translation part of the transformation. Perhaps you want to use the point closest to the origin for that purpose, then
p := d * n

Next, choose any (unit length) vector that is perpendicular to n to get, say, the tangent t. It looks like
t . n = 0
You'll notice that there is an infinite amount of possibilities, as already mentioned above.

Then utilize t x b =: n to get the bi-tangent, i.e.
b = -t x n

Next compose all these into a transformation matrix, e.g. for column vectors with the translation as 4th component. The quad in the OP has a normal in direction of the principal y axis that should be mapped to n, and lets use the x direction for t and hence the -z direction for b. So I'd expect something like
[ t n -b p ]

I'm not sure whether or not b need to be negated at last. Please double check this stuff.

1. 1
2. 2
3. 3
Rutin
21
4. 4
5. 5

• 14
• 30
• 13
• 11
• 11
• ### Forum Statistics

• Total Topics
631777
• Total Posts
3002307
×