How can I assign a different texture to each triangle in a mesh ?

I made a grid like mesh, full of triangles, making a 2D plane. However, when I apply a texture with a material, all the squares produced by two triangles in my mesh show the same texture (Not knowing what UV was, I set each uv to the same coordinates as the Vertice.)

How could i make it so that each triangle or quad draw with a specific texture ? I’m guessing first of all that i need to put all my textures in a single texture, then give my material that texture, then maybe i can tell each triangle what part of the texture to draw, but how do i do so ?

Thank you
Tabc3dd

Yes, you use UV coordinates to tell the triangles which part of the texture to use.

–Eric

So how does a UV coordinate work ?

if I set for example uv[5] to (6,8), does that mean that vertice[5] will draw the texture from the point of coordinate (6,8) ?

Thank you
Tabc3dd

UV coordinates are normalized from 0…1, with 0,0 being the bottom-left of the texture, and 1,1 being the top-right.

–Eric

Thank you :), that might explain why it didn’t work. Is there a way to use unnormalized coordinates or do i need to divide everything by the height and width ?

Tabc3dd

You don’t need to divide anything; 1,1 is always the top-right of a texture regardless of size.

–Eric