- Home /
I would like to calculate the rotation from a generated mesh (kind of the normal but also not)
For my project I need to calculate the forward vector of a mesh. This mesh is created through LiDAR and I slice the top off. My current solution is to calculate it through the normals of the mesh but this resulted in not what I wanted.
Technically I need the angle of origin to the meshes edge.
In the image below you can see the the white and blue line which are the normals from the raycast hit.
What I want to achieve is. As you can see the white and blue is rotated on the Y but not on the X and Z. I tried making a euler based off the y and leaving the x and z empty but seems like that didn't work.
The forward vector from the mesh itself but then from a flat surface since LiDAR isn't always flat.
One of the ways I was thinking is to take the top left vertices and top right and get the angle from that.