August 2018
Beginner
334 pages
10h 19m
English
We will implement a function to evaluate a location given its height and surrounding points:
public static float GetHeightQuality (Vector3 location, Vector3[] surroundings)
{
// next steps
}
float maxQuality = 1f; float minQuality = -1f; float minHeight = Mathf.Infinity; float maxHeight = Mathf.NegativeInfinity; float height = location.y;
foreach (Vector3 s in surroundings)
{
if (s.y > maxHeight)
maxHeight = s.y;
if (s.y < minHeight)
minHeight = s.y;
}
float quality = (height-minHeight) / (maxHeight ...
Read now
Unlock full access