I have a 3d point, defined by [x0, y0, z0].
This point belongs to a plane, defined by [a, b, c, d].
normal = [a, b, c], and ax + by + cz + d = 0
How can convert or map the 3d point to a pair of (u,v) coordinates ?
This must be something really simple, but I can't figure it out.
First of all, you need to compute your
uandvvectors.uandvshall be orthogonal to the normal of your plane, and orthogonal to each other. There is no unique way to define them, but a convenient and fast way may be something like this:Now a simple dot product will do:
Notice that this assumes that the origin of the u-v coordinates is the world origin (0,0,0).
This will work even if your vector
[x0 y0 z0]does not lie exactly on the plane. If that is the case, it will just project it to the plane.