Exemplo n.º 1
0
        //// ===========================================================================================================
        //// Methods
        //// ===========================================================================================================

        public override Color ColorAt(Point point)
        {
            double perlinX = _perlin.CalculateOctavePerlin(point.X, point.Y, point.Z, Octaves, Persistence);
            double perlinY = _perlin.CalculateOctavePerlin(point.X, point.Y, point.Z + 1, Octaves, Persistence);
            double perlinZ = _perlin.CalculateOctavePerlin(point.X, point.Y, point.Z + 2, Octaves, Persistence);

            double newX = point.X + (perlinX * Scale);
            double newY = point.Y + (perlinY * Scale);
            double newZ = point.Z + (perlinZ * Scale);

            Point patternPoint = Pattern.Transform.Invert() * new Point(newX, newY, newZ);
            Color color        = Pattern.ColorAt(patternPoint);

            return(color);
        }