How to rotate a 3D plane?

I have a 3d plane (consisting of a number of points) that rotates at a strange angle. I want it to be flat and lay on the xy-plane. I have a plane equation, but I think my calculated angles are wrong or may use the wrong rotation matrix. By the wrong rotation matrix, I mean that I'm not sure which axis I need to rotate. attached image of my plane:

this plane rotates about one axis

I tried to calculate using the following formulas:

  • theta = -acosd ((point (n1, n2)) / (norm (n1) * norm (P2)));
  • Calculate spherical angles: theta and phi;

both methods give the same angle, I first rotated my plane around the z axis, and then around the y axis. The reduced plane is almost flat, but it still has some anlip.

, . , - , , .

+4
1

, z. , z () . . . , , , , z.

0

Source: https://habr.com/ru/post/1688651/


All Articles