- Home /
How can I calculate the UVs of a triangular mesh?
Hello,
I'm currently working on a sphere world, built subdividing an icosahedron, in which every triangle is a mesh. Now, I've got the vertex, triangles and normals generation working perfectly, but I can't understand how to calculate the UVs of said triangles.
How could I proceed? I know there's a way to calculate the UVs of the whole icosphere, but i just need to do it for triangular meshes that are floating in a 3D space.
Thank you in advance!
Answer by Summit_Peak · Jun 08, 2018 at 01:56 PM
You might consider using Triplanar Texturing to set the UV coordinates.
There is a description here (See Example 1-3):
https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch01.html
This is exactly what I needed! Thank you very much!
I'd like to add another resource i found while reading yours: an advanced tutorial on catlikecoding (the others in this series are pretty amazing too) https://catlikecoding.com/unity/tutorials/advanced-rendering/triplanar-mapping/
Your answer
Follow this Question
Related Questions
Transfer lighting and other information from 3D sphere to 2D plane 0 Answers
Triangle and vertex count after dividing them n times. 0 Answers
Two textures on a sphere depending on latitude 0 Answers
Spherical Terrain Object? 4 Answers
Instantiate on the surface of a sphere using Physics.Raycast 1 Answer