I think they are right.. the faces underneath are overlayed with the faces on top for some reason..
const float tBlockSize = 1f / 16f;
private void TopFace(int xOffset,int yOffset, int zOffset)
{
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0, 0)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 1 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0 + tBlockSize, 0)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 1 + zOffset), Color.White, new Vector2(0, 0 + tBlockSize)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 1 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0 + tBlockSize, 0)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 1 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 1 + zOffset), Color.White, new Vector2(0 + tBlockSize, 0 + tBlockSize)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 1 + zOffset), Color.White, new Vector2(0, 0 + tBlockSize)));
}
private void BottomFace(int xOffset, int yOffset, int zOffset)
{
yOffset--;
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 1 + zOffset), Color.White, new Vector2(0, 0 + tBlockSize)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 1 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0 + tBlockSize, 0)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0, 0)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 1 + zOffset), Color.White, new Vector2(0, 0 + tBlockSize)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 1 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 1 + zOffset), Color.White, new Vector2(0 + tBlockSize, 0 + tBlockSize)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 1 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0 + tBlockSize, 0)));
}
private void FrontFace(int xOffset, int yOffset, int zOffset)
{
yOffset--;
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0, 0)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 1 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0 + tBlockSize, 0)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 1 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0, 0 + tBlockSize)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 1 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0 + tBlockSize, 0)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 1 + xOffset, worldPos.Y + 1 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0 + tBlockSize, 0 + tBlockSize)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 1 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0, 0 + tBlockSize)));
}
private void BackFace(int xOffset, int yOffset, int zOffset)
{
yOffset--;
zOffset++;
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 1 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0, 0 + tBlockSize)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 1 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0 + tBlockSize, 0)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0, 0)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 1 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0, 0 + tBlockSize)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 1 + xOffset, worldPos.Y + 1 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0 + tBlockSize, 0 + tBlockSize)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 1 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0 + tBlockSize, 0)));
}
private void RightFace(int xOffset, int yOffset, int zOffset)
{
yOffset--;
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 1 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0, 0 + tBlockSize)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 1 + zOffset), Color.White, new Vector2(0 + tBlockSize, 0)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0, 0)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 1 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0, 0 + tBlockSize)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 1 + yOffset, worldPos.Z + 1 + zOffset), Color.White, new Vector2(0 + tBlockSize, 0 + tBlockSize)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 1 + zOffset), Color.White, new Vector2(0 + tBlockSize, 0)));
}
private void LeftFace(int xOffset, int yOffset, int zOffset)
{
yOffset--;
xOffset++;
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0, 0)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 1 + zOffset), Color.White, new Vector2(0 + tBlockSize, 0)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 1 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0, 0 + tBlockSize)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 0 + yOffset, worldPos.Z + 1 + zOffset), Color.White, new Vector2(0 + tBlockSize, 0)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 1 + yOffset, worldPos.Z + 1 + zOffset), Color.White, new Vector2(0 + tBlockSize, 0 + tBlockSize)));
vertexList.Add(new VertexPositionColorTexture(new Vector3(worldPos.X + 0 + xOffset, worldPos.Y + 1 + yOffset, worldPos.Z + 0 + zOffset), Color.White, new Vector2(0, 0 + tBlockSize)));
}