POV-Ray : Newsgroups : povray.text.scene-files : source for spiky spheres Server Time
29 Oct 2024 22:48:32 EDT (-0400)
  source for spiky spheres (Message 1 to 1 of 1)  
From: Pete
Subject: source for spiky spheres
Date: 8 Sep 2001 21:22:09
Message: <3903.649T211T12703144PeterC@nym.alias.net>
Source for that image I posted on the binaries group.

-- spiky4.pov --
--

#declare ntsc = false;

#declare rseed = seed(81499475);





global_settings {

  assumed_gamma 1.8

  number_of_waves 11

  max_trace_level 14

}





camera {

  location 0

  direction <0, 0, 1.5>

  #if (ntsc = true)

    right <(320/200) * (10/11), 0, 0>

  #else

    right <(640/480), 0, 0>

  #end

  up <0, 1, 0>

  rotate z*-15

  rotate x*-6

  rotate y*-20

  translate <32 + 2, -2, 0>

}





#declare wall_pig1 = pigment {

  bozo

  turbulence 1.3

  color_map {

    [ 0.4 color rgb 1 ]

    [ 1.0 color rgb 0.5 ]

  }

  scale 1/4

}





torus {

  32, 4

  pigment {

    gradient <0, 1, 0>

    scale 4

    pigment_map {

      [ 0.0 wall_pig1 ]

      [ sin(radians(22.5)) wall_pig1 ]



      [ sin(radians(22.5)) wall_pig1 rotate <23, 64, 18>
        translate <2, 0, 3> ]

      [ sin(radians(45)) wall_pig1 rotate <23, 64, 18>
        translate <2, 0, 3> ]



      [ sin(radians(45)) wall_pig1 rotate <70, -13, 84> ]

      [ sin(radians(45 + 22.5)) wall_pig1 rotate <70, -13, 84> ]



      [ sin(radians(45 + 22.5)) wall_pig1 translate <15, 18, 2> ]

      [ sin(radians(90)) wall_pig1 translate <15, 18, 2> ]

    }

    warp {

      repeat <0, 4, 0> offset <40, 0, -14> flip <0, 1, 0>

    }

  }

  finish { ambient 0 diffuse 1 }

  inverse

}





union {

  #declare rotz = 0;

  #while (rotz < 360)

    torus {

      32 + 4 * cos(radians(rotz)), 0.05

      translate <0, 4 * sin(radians(rotz)), 0>

    }

    #declare rotz = rotz + (360 / 16);

  #end

  #declare roty = 0;

  #while (roty < 360)

    torus {

      4, 0.05

      rotate x*90

      translate <32, 0, 0>

      rotate y*roty

    }

    #declare roty = roty + (360 / 64);

  #end

  pigment { color rgb 0.8 }

  finish {

    ambient 0 diffuse 1

    specular 2.0

    metallic

  }

}







#declare spikeball = union {

  sphere { 0, 1 }

  #declare elivation = 0;

  #while (elivation < 90)

    #declare modradius = cos(radians(elivation));

    #declare incr_factor = 360 / int(modradius * 30);

    #declare roty = 0;

    #while (roty < 360)

  sphere {
    <1, 0, 0>, 0.2
    scale <1, 1/3, 1/3>
    rotate z*elivation
    rotate y*roty
  }

      #if (elivation > 0)

  sphere {
    <1, 0, 0>, 0.2
    scale <1, 1/3, 1/3>
    rotate z*-elivation
    rotate y*roty
  }

      #end

      #declare roty = roty + incr_factor;

    #end

    #declare elivation = elivation + (90/8);

  #end

  // lastly: spike for top and bottom poles

  sphere { <1, 0, 0>, 0.2 scale <1, 1/3, 1/3> rotate z*90 }

  sphere { <1, 0, 0>, 0.2 scale <1, 1/3, 1/3> rotate z*-90 }

}





#declare spike_texture = texture {

  pigment { color rgb 1 }

  finish {

    ambient 0 diffuse 1

  }

}





object {

  spikeball

  rotate z*19

  rotate y*23

  translate <30, 0, 9>

  texture { spike_texture }

}





object {

  spikeball

  rotate z*-72

  rotate y*19

  translate <30, -1.6, 13>

  texture { spike_texture }

}





object {

  spikeball

  rotate z*31

  rotate y*-17

  translate <26, -1.0, 18>

  texture { spike_texture }

}





#declare spot_hue = <0, 0.4, 1>;





light_source {

  <25, 0, 14>

  color rgb spot_hue * 0.8 + 0.2

  fade_power 1.0

  fade_distance 3

  looks_like {

    union {

      sphere {

        0, 0.1

        pigment { color rgb spot_hue * 0.5 + 0.5 }

        finish { ambient 1 diffuse 0 }

      }

      sphere {

        0, 1

        hollow

        pigment { color rgbt 1 }

        finish { ambient 0 diffuse 0 }

        interior {

          media {

            emission 1

            density {

              spherical

              scale 1/2

              color_map {

                [ 0.0 color rgb 0 ]

                [ 1.0 color rgb spot_hue* 2 ]

              }

            }

          }

        }

      }

    }

  }

}





/* actual end of this file */


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.