Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1. public void Load(string heightMapFileName, float blockScale, float heightScale)
  2.     {
  3.         Initialize();
  4.  
  5.         vertexCountX = texture.Width;
  6.         vertexCountZ = texture.Height;
  7.  
  8.         this.blockScale = blockScale;
  9.         this.heightScale = heightScale;
  10.  
  11.         FileStream fileStream = File.OpenRead(Game.Content.RootDirectory + "/" + heightMapFileName + ".raw");
  12.  
  13.         int heightMapSize = vertexCountX * vertexCountZ;
  14.         heightMap = new byte[heightMapSize];
  15.  
  16.         fileStream.Read(heightMap, 0, heightMapSize);
  17.         fileStream.Close();
  18.  
  19.         GenerateTerrainMesh();
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement