Update for AtlasBuilder ok

Need to improuve duplicate vertex for mapping texture.
This commit is contained in:
Troispoils 2024-02-27 17:04:09 +01:00
parent 4777783ffb
commit b9a2b87fe9
11 changed files with 160 additions and 33 deletions

View file

@ -5,17 +5,19 @@ namespace LandblockExtraction.LandBlockExtractor {
public Vector3[] position { get; set; }
public Vector4[] color { get; set; }
public Vector4[] farcolor { get; set; }
public Vector2[] texturecoord { get; set; }
public VerticesStruct(int blockSize) {
position = new Vector3[blockSize * blockSize];
color = new Vector4[blockSize * blockSize];
farcolor = new Vector4[blockSize * blockSize];
texturecoord = new Vector2[blockSize * blockSize];
}
public float[] Vertices() {
int length = position.Length;
float[] vertices = new float[length * 11]; // 3 pour position, 4 pour color, et 4 pour farcolor
for (int i = 0, vi = 0; i < length; i++, vi += 11) {
float[] vertices = new float[length * 13]; // 3 pour position, 4 pour color, et 4 pour farcolor
for (int i = 0, vi = 0; i < length; i++, vi += 13) {
vertices[vi] = position[i].X;
vertices[vi + 1] = position[i].Y;
vertices[vi + 2] = position[i].Z;
@ -27,6 +29,8 @@ namespace LandblockExtraction.LandBlockExtractor {
vertices[vi + 8] = farcolor[i].Y;
vertices[vi + 9] = farcolor[i].Z;
vertices[vi + 10] = farcolor[i].W;
vertices[vi + 11] = texturecoord[i].X;
vertices[vi + 12] = texturecoord[i].Y;
}
return vertices;
}