Hi all,
I’m facing a problem that uv-textured tiles in my world do not fit together correctly when a rotation is applied to the tiles.
I’m writing a city builder game with tiles forming a chunk mesh like in a voxel based system (verts, tris and uvs).
The following screenshots shows road tiles where the rotated tile textures do not fit to the other tiles.
If no rotation is applied to a tile it looks correct. So how I calculate the rotation must be wrong.
This is my tileset atlas:
I tested it with a rotated version of a tile which was rotated in the tileset image already. No misalignment in this case because no vertice rotation was needed. So i’m pretty sure there is something wrong with my rotation method.
This is how I construct the mesh and how I rotate the tiles with RotateVerticesAroundPivot()
:
I hope someone can help me out
Thanks!
Frey