better system for texture terrain.
This commit is contained in:
parent
3aa6b5bc83
commit
443b3a319d
9 changed files with 120 additions and 69 deletions
|
|
@ -8,7 +8,6 @@ namespace LandblockExtraction.LandBlockExtractor {
|
|||
public Vector4[] farcolor { get; set; }
|
||||
public Vector2[] texturecoord { get; set; }
|
||||
public Vector4[] terraintype { get; set; }
|
||||
public float[] realtype { get; set; }
|
||||
|
||||
public VerticesStruct(int blockSize) {
|
||||
position = new Vector3[blockSize * blockSize];
|
||||
|
|
@ -17,13 +16,12 @@ namespace LandblockExtraction.LandBlockExtractor {
|
|||
farcolor = new Vector4[blockSize * blockSize];
|
||||
texturecoord = new Vector2[blockSize * blockSize];
|
||||
terraintype = new Vector4[blockSize * blockSize];
|
||||
realtype = new float[blockSize * blockSize];
|
||||
}
|
||||
|
||||
public float[] Vertices() {
|
||||
int length = position.Length;
|
||||
float[] vertices = new float[length * 21]; // 3 pour position, 4 pour color, et 4 pour farcolor
|
||||
for (int i = 0, vi = 0; i < length; i++, vi += 21) {
|
||||
float[] vertices = new float[length * 20];
|
||||
for (int i = 0, vi = 0; i < length; i++, vi += 20) {
|
||||
vertices[vi] = position[i].X;
|
||||
vertices[vi + 1] = position[i].Y;
|
||||
vertices[vi + 2] = position[i].Z;
|
||||
|
|
@ -44,7 +42,6 @@ namespace LandblockExtraction.LandBlockExtractor {
|
|||
vertices[vi + 17] = terraintype[i].Y;
|
||||
vertices[vi + 18] = terraintype[i].Z;
|
||||
vertices[vi + 19] = terraintype[i].W;
|
||||
vertices[vi + 20] = realtype[i];
|
||||
}
|
||||
return vertices;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue