Forum

Math Question

Hello,

Im having a mathematical problem here. I have 2*4 points in 3D each set forms a plane. Now I want to find a matrix how the two planes correspond. My goal is to find a matrix so when Im feeding in points on planeA with applyMatrix the points get “projected” on planeB.

I already tried some stuff but sofar without success. Any idea how to do this?

the planes are not the same size and are rotated.

Meeeerci.

Have a nice weekend robi

the problem that if you have set of points basically means your matrix is distorted so you won’t get away with something like decompose in that case, this type of relations should be solved with ParallelEpiped or LookAt node prolly… But it not really clear what you tryingto achive, like to project one plane on to another?
This normally done by world transform * (view * projection)
so since you don’t have a projection you can try multiply first plane transform on 2-d plane transform but i’m not really sure it’s gonna work like that…
Id try to take a teapot and align it on the plane with parrallep so at list you can see something

in your screenshot the left plane looks distorted or is it the prespective?

do you want to be able to have such “distorted planes”?

anyway some distortions can also be done with 4x4 matrices. so lets assume for now that you have 2 matrices for your 2 planes.

then it is easy to get points from one plane to the other…

you could have those points in world space or in object space of plane1. if you don’t already have those points in object space of plane1 you need to do that by multiplying with the inverse of the world matrix of plane 1.

now you just interpret those points as relative to plane 2.

if you need them in world space you need to multiply them by the world matrix of plane 2.

if you want to do both steps you can also multiply the points by the matrix product of inversePlane1 * Plane2…

i attached an example how to deal with 4 points even if they are not on one plane.

map demo.zip (11.2 kB)

cool greg, i’m trying to do something similliar on shader, an it seems you need inverse because you apply view transform on shader on vertices basicly so inverse would mean you just remove that transform but you have quite proper example of Parallep i must admit, cool, i used it to distort object space mostly but never like that

never used it like that either :) glad you like it!

Thanks guys for your help.
@gregsn that approach is really great!

I was using the normals of the planes to get a rotation and wanted to map the xy with a homography but this is much more elegant!

BIG THANKS

robi