Re: Turn Plane into Matrix
How are you representing the plane? You could be represeting it as an angle from each axis or as a vector normal to the plane, in which case i don't think it would be too tough to get the angle for an object.
Re: Turn Plane into Matrix
Sounds like you want the plane's NORMAL
how are you representing the plane?
if it's already as "Ax + By + Cz = D" then the normal is just (A, B, C)
if you have the three points, you can use the vectors between them, find their cross product which also happens to be the normal to the plane!
Once you've got the normal, which is just a 3D vector, you can do a conversion from that to spherical coordinates to get whichever angle you want :D
For example, say you want the elevation...
if in your game world, up/down is +/- Y (for example, the ground is the XZ plane), then to get elevation, you have one vector for your plane, and one for the base plane (in this case, the normal is just (0, 1, 0))
Then, you find the angle between the normals, using the dot product. This (or 180 degrees - this...depends what you want) is then the angle between the planes, which is your plane's elevation