From MeshBuilder.CreatePlane how to get the equation of mathematical Plane

I am interested to find the a,b,c,d parameters of a plane ax + by + cz + d = 0, from a plane mesh formed by MeshBuilder.CreatePlane.
Ideally, I need to find the normalized normal(a,b,c) and the distance (d) of the plane from the origin.
Please suggest a way.

PS: I have the normal, but I don’t know to get the parameter ‘d’ from the mesh position . So now the problem now gets reduced to how to obtain the parameter d of the mathematical plane.

To calculate d, you can simply take any point (x,y,z) that is on the plane and do: d=-ax-by-cz.

For eg, vertices = mesh.getVerticesData("position") will retrieve all the vertices, and (vertices[0], vertices[1], vertices[2]) is a point on the plane. However, it is in the local coordinate system of the mesh, you will have to transform this point with the mesh world matrix to get a point in world coordinates.

2 Likes