Hi,

I have a polygon in 3D space. All the vertices of this polygon are in same plane. (It is a 2D polygon but rotated in 3D space). Obviously, the normal of all these vertices are same. I need to calculate UV coordinates for these vertices.

I could think of an approach.

Approach:

- Rotate this these vertices in such a way that it becomes XY plane.
- Calculate UV for each vertex.
- Rotate back.

Is there any better approach?

If not, I need a code snippet to rotate it to make it XY plane.

Thanks in advance.