Exemplo n.º 1
0
 public Camera(Point3 at, Point3 lookat, Vector3 up, double flength, ImageSize size)
     : this(at, lookat, up, flength, size.Width, size.Height)
 {
 }
Exemplo n.º 2
0
        /// <summary>
        /// Just return p.GetHashCode()
        /// </summary>
        /// <param name="p"></param>
        /// <returns>function value</returns>
        public static double Noise(Point3 p)
        {
            var r = p.GetHashCode();

            return(Math.Abs(r / int.MaxValue));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Rectified perlin noise
        /// </summary>
        /// <param name="p"></param>
        /// <returns>function value</returns>
        public static double PerlinRidged(Point3 p)
        {
            var r = ImprovedNoise.noise(p.x, p.y, p.z);

            return(Math.Abs(r));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Basic perlin noise
        /// </summary>
        /// <param name="p"></param>
        /// <returns>function value</returns>
        public static double Perlin(Point3 p)
        {
            var r = ImprovedNoise.noise(p.x, p.y, p.z);

            return(r / 2 + 0.5);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Layered onion texture
        /// </summary>
        /// <param name="p">point</param>
        /// <returns>function value</returns>
        public static double Onion(Point3 p)
        {
            var r = Math.Sqrt(p.x * p.x + p.y * p.y + p.z * p.z);

            return(r - Math.Floor(r));
        }
Exemplo n.º 6
0
 /// <summary>
 /// Good old Perlin noise
 /// </summary>
 /// <param name="p">point</param>
 /// <returns>function value</returns>
 public static Vector3 Perlin(Point3 p)
 {
     return(ImprovedNoise.noiseVector(p.x, p.y, p.z));
 }