- Home /
 
               Question by 
               gonzalitosk8 · Feb 09, 2020 at 11:27 PM · 
                meshprocedural meshuv mappinguv coordinates  
              
 
              need guide in uv texture
I am making a procedural system of buildings. In question, there is something that I am doing wrong, since the UV does not work. when using a triplanar shader, the same thing happens ... the texture is stretched at a certain angle.
photo:
Codigo Uv:
 Vector2[] uvs = new Vector2[SelectedMesh.verts.Count];
 for (int i = 0; i < uvs.Length; i++) {
 
     Vector3 heading = new Vector3(SelectedMesh.verts[i].x,       SelectedMesh.verts[i].y, SelectedMesh.verts[i].z);
 
     Vector3 direction = heading / heading.magnitude;
 
     uvs[i] = new Vector2(((SelectedMesh.verts[i].x / direction.z) - (SelectedMesh.verts[i].z / direction.x)), SelectedMesh.verts[i].y);
 
 }
 
 SelectedMesh.BuildingMesh.uv = uvs;
 
                 
                sin-titulo.png 
                (353.6 kB) 
               
 
              
               Comment
              
 
               
              Your answer
 
 
             Follow this Question
Related Questions
UV V coordinate Not showing on Texture. 1 Answer
Texture on custom mesh splits at edge. 1 Answer
uv Tiling y error 2 Answers
Update a texture at runtime using UV 0 Answers
Vertex Colors not smooth enough? 0 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
               
 
			 
                