示例#1
0
    /// <summary>
    /// Returns the height of the terrain at a given point
    /// </summary>
    /// <param name="x">The x coordiate of the point to sample</param>
    /// <param name="z">The z coordiate of the point to sample</param>
    /// <returns>A height between 0 and 255, inclusive</returns>
    public double GetTerrain(double x, double z)
    {
        var noise = ProcNoise.Noise(x / 100, z / 100 + 3000) * 20;

        noise *= (1 - Math.Abs(ProcNoise.RawNoise(x / 30 + 2000, z / 30)));

        return(noise);
    }
    /// <summary>
    /// Returns the height of the terrain at a given point
    /// </summary>
    /// <param name="x">The x coordiate of the point to sample</param>
    /// <param name="z">The z coordiate of the point to sample</param>
    /// <returns>A height between 0 and 255, inclusive</returns>
    public double GetTerrain(double x, double z)
    {
        var noise = ProcNoise.Noise(x / 400 - 3000, z / 400) * 25;

        noise += ProcNoise.Noise(x / 50, z / 50 - 3000) * 25;

        noise *= (1 - Math.Abs(ProcNoise.RawNoise(x / 70, z / 70 + 3000)));

        return(noise);
    }
示例#3
0
 /// <summary>
 /// Returns the height of the terrain at a given point
 /// </summary>
 /// <param name="x">The x coordiate of the point to sample</param>
 /// <param name="z">The z coordiate of the point to sample</param>
 /// <returns>A height between 0 and 255, inclusive</returns>
 public double GetTerrain(double x, double z)
 {
     return(ProcNoise.Noise(x / 100, z / 100) * 10 + Math.Abs(ProcNoise.RawNoise(x / 50, z / 50)) * 5);
 }