There are many identical objects in the scene,But their rotation angle has been reset
I want to get their rotation angle
My idea is to get the two vertices of a straight line in the object, and then get their rotation angle through "math.atan2" ,Is this plan feasible ,In addition, how to judge whether an object rotates or not is a troublesome problem. I want to traverse the vertices of all objects. If the X of vertex 1 is not equal to the X of vertex 2, it is rotating. Is this true and efficient
Asked
Active
Viewed 535 times
0
DaTuDou
- 41
- 3
-
1https://blender.stackexchange.com/questions/235444/rotate-a-plane-that-has-a-random-applied-z-rotation-so-that-its-edges-are-ortho#comment399238_235444 – batFINGER Aug 27 '21 at 03:35
-
For the 2D problem above, where the objects have been solely rotated around global Z axis the maths above is sound. If the mesh is rotated about say the line between diagonal verts of top face that axis will be on X = 1 plane (default cube) ie the x coords same at both ends, the cube will not be axis aligned. To solve this for any mesh requires finding a minimum bounding box. The answer here https://blender.stackexchange.com/a/121227/15543 involves choosing a face, aligning normal with global Z, and then aligning an edge with another axis. If selecting vers becomes a matter of – batFINGER Aug 27 '21 at 07:01
-
selecting 3. (3 verts -> plane) If the verts are all on same line, cannot make a plane. Using linear algebra (Vectors Matrices) pretty much removes the need for using trig methods. Anyway rather than go on, believe this question is a duplicate of, if not this one https://blender.stackexchange.com/questions/63506/set-object-local-axis-based-on-face-orientation ... – batFINGER Aug 27 '21 at 07:07
