Initial commit
This commit is contained in:
		
							
								
								
									
										27
									
								
								ProceduralTerrain/Assets/Scripts/HeightmapGenerator.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								ProceduralTerrain/Assets/Scripts/HeightmapGenerator.cs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
using UnityEngine;
 | 
			
		||||
using System.Collections;
 | 
			
		||||
 | 
			
		||||
public class HeightmapGenerator : MonoBehaviour 
 | 
			
		||||
{
 | 
			
		||||
	public int Width = 100, Height = 100;
 | 
			
		||||
	public float[,] Mesh;
 | 
			
		||||
 | 
			
		||||
	// Use this for initialization
 | 
			
		||||
	void Start () 
 | 
			
		||||
	{
 | 
			
		||||
		Mesh = new float[Width, Height];
 | 
			
		||||
 | 
			
		||||
		// Initialize with perlin noise
 | 
			
		||||
		for (int x = 0; x < Width; ++x)
 | 
			
		||||
			for (int y = 0; y < Height; ++y)
 | 
			
		||||
				Mesh [x, y] = Mathf.PerlinNoise (x, y);
 | 
			
		||||
 | 
			
		||||
		// Generate mesh
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	// Update is called once per frame
 | 
			
		||||
	void Update () 
 | 
			
		||||
	{
 | 
			
		||||
	
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,8 @@
 | 
			
		||||
fileFormatVersion: 2
 | 
			
		||||
guid: 8cbe14072ae596c4f84cea677f95f8d5
 | 
			
		||||
MonoImporter:
 | 
			
		||||
  serializedVersion: 2
 | 
			
		||||
  defaultReferences: []
 | 
			
		||||
  executionOrder: 0
 | 
			
		||||
  icon: {instanceID: 0}
 | 
			
		||||
  userData: 
 | 
			
		||||
		Reference in New Issue
	
	Block a user