I’ve made a polygon with a set of points and i’d like to know the “absolute” rotation of the resulted mesh, thats to say the three values of the rotation of the mesh compared to the origin [0,0,0]
To determine the “absolute” rotation of a polygon mesh compared to the origin [0, 0, 0], you can calculate the rotation angles around the three axes (x, y, and z) using the mesh’s normal vectors.
Calculate the average normal vector of all the polygons in the mesh. This can be done by summing up the normal vectors of each polygon and normalizing the result.
Convert the normal vector to Euler angles, which represent rotations around the x, y, and z axes. The conversion method depends on the coordinate system and conventions used in your specific application or programming language.
The resulting Euler angles will give you the rotation values around the x, y, and z axes. These angles represent the “absolute” rotation of the mesh compared to the origin [0, 0, 0].
Note that this method assumes that the mesh is oriented in a way that aligns with the global coordinate system, and the normal vectors of the polygons accurately represent the mesh’s orientation.
Next I would search or ask the chatbot to give me the formula to calculate the tangenz between two vectors:
To calculate the tangent of the angle between two vectors, you first need to find the dot product of the vectors and their magnitudes. Here are the steps:
Calculate the dot product of the two vectors: DotProduct = Vector1 · Vector2 (Note: · denotes the dot product)
Calculate the magnitudes of the vectors: Magnitude1 = |Vector1| Magnitude2 = |Vector2| (Note: | | denotes the magnitude or length of a vector)
Calculate the tangent of the angle between the vectors: Tangent = DotProduct / (Magnitude1 * Magnitude2)
The resulting value, “Tangent,” will give you the tangent of the angle between the two vectors.