Tile textures misaligned after rotation of vertices

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 :slight_smile:

Thanks!
Frey

Check your cutting out of the texture… you’re not in the middle of the quad… even the ramp above does not look like the roadway is precisely in the middle.

I put red dots on the sides. They aren’t the same. Start there.

9566188--1353298--nope.png

1 Like