- Home /
Hexagon grid UV mapping
Hi guys,
I've written a script that generates a series of triangles that form hexagons in a grid formation. Each triangle has it's own individual vertices to be able to individually texture each triangle. Unfortunately, I have not figured out how uv mapping this grid would work.
In the system a 4x4 grid would look like the bellow picture. The hexagons are generated from top left to bottom right. Each hexagon is generated clockwise from the right triangle comprising the top point corner of the hexagon.
I am specifically wondering how I would think of the UV for the grid. Would the bottom left of the grid be 0,0 while the top right of the grid is 1,1? And if so does that mean that each hexagon UV is 1 divided by 13 times the total number of hexagons.
Alternatively, would each triangle have an individual set of UVs due to them being separate.
I would really appreciate if someone could help me have an idea on how I could write this as I don't have a clue where to start with this.
How you UV map the triangles depends on how you plan to texture them (e.g., are the triangles using a texture atlas, a different material for each triangle, etc.). If your intent is to map each triangle separately, it probably makes more sense to consider the UV coordinates of each triangle's vertices on an individual basis.
I agree. setting the UVs for each hex tile seperately is easy. Just have you textures be at least large enough that they emcompass a hex tile, then you just need to set the top and bottom middle vertices' UVs to 0.5/1 and 0.5/0, and the four others are at 0.25 and 0.5 heights respectively.
Thanks guys, I'm pretty sure I know how to implement it now. :)
Your answer
![](https://koobas.hobune.stream/wayback/20220613182352im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Hexagon mesh subdivided into triangles 1 Answer
Hexagonal map on terrain 1 Answer
How can I convert the texture coordinates of the multi-spite to 0-1? 0 Answers
Update a texture at runtime using UV 0 Answers
C# PackTextures & UV Mapping 2 Answers