コード例 #1
0
ファイル: Perlin1DNoise.cs プロジェクト: Thumann/sharplike
        public override void Generate()
        {
            Interpolator i = null;

            switch (this.InterpolationMethod)
            {
            case Noise.InterpolationMethod.None:
            {
                i = new ClosestInterpolator();
                break;
            }

            case Noise.InterpolationMethod.Linear:
            {
                i = new LinearInterpolator();
                break;
            }

            case Noise.InterpolationMethod.Cubic:
            {
                throw new NotImplementedException();
            }

            case Noise.InterpolationMethod.Cosine:
            {
                throw new NotImplementedException();
            }
            }

            noise          = new PerlinNoise(octaves, persistence, i, this.Length, 1, 1, 1);    // Use 1 for the unused dimension sizes.
            this.Generated = true;
        }
コード例 #2
0
ファイル: PerlinNoise.cs プロジェクト: eropple/sharplike
        public PerlinNoise(Int32 octaves, Double persistence, Interpolator i, Int32 x, Int32 y, Int32 z, Int32 w)
        {
            m_octaves = octaves;
            m_persistence = persistence;

            interp = i;
            sx = x;
            sy = y;
            sz = z;
            sw = w;

            data = new Double[x,y,z,w];
        }
コード例 #3
0
ファイル: PerlinNoise.cs プロジェクト: Thumann/sharplike
        public PerlinNoise(Int32 octaves, Double persistence, Interpolator i, Int32 x, Int32 y, Int32 z, Int32 w)
        {
            m_octaves     = octaves;
            m_persistence = persistence;

            interp = i;
            sx     = x;
            sy     = y;
            sz     = z;
            sw     = w;

            data = new Double[x, y, z, w];
        }