POV-Ray : Newsgroups : povray.general : Snail shells : Snail shells Server Time
3 Mar 2024 13:51:02 EST (-0500)
  Snail shells  
From: Thomas Fester
Date: 2 Dec 2023 16:45:00
Message: <web.656ba4e8dd0b55cfa206535f8a2a825f@news.povray.org>
Hello everybody,

recently I posted a video about snail shells, where I talk about producing
images like the one attached. I thought about including my code in the youtube
comments section, but there are technical problems. So I am including this code
right here. Please tell me, in case there are better forms of distributing such
scripts. Also suggestions for improving the readability of my code are
welcome...

Best regards,

Thomas

// Persistence of Vision Ray Tracer Scene Description File
// File: ?.pov

#version 3.6;


global_settings {
  assumed_gamma 1.0
  max_trace_level 25
 //radiosity {}
}




#declare Cameraz = camera {
  location  <1, 0, -10>
look_at   <0, 0,  0>
}



camera {Cameraz}



sky_sphere {
  pigment {
    gradient y
    color_map { [0.0 color rgb <1,1,1>] [0.5 color rgb <1,1,1>] [1.0 color rgb
<1,1,1>] }
  scale 2
  translate -1
  }
}



// create a regular point light source
light_source {
  0*x                  // light's position (translated below)
  color rgb <1,1,1>    // light's color
  translate <1, 1, -200>
}


light_source {
  0*x                  // light's position (translated below)
  color rgb <1,1,1>    // light's color
  translate <-100, 100, 00>
 }


//Light in the opening of the snail shell

light_source {
  0*x                  // light's position (translated below)
  color rgb <1,1,1>    // light's color
  translate <2, -2.5, 0>
 }


//---------------------------Objects-----------------------------------------------------------------

//Spiral parameters
#declare Inclination = 0.01045;
#declare HeightVariable = 0.105;
#declare RadiusVariable = 0.0355;
#declare ThicknessVariable = 0.04;


//Starting position on y-axix
#declare YStart = 3.9;




blob {
  threshold 0.6

#declare ticker = 0;
#while (ticker<400)


#declare Angle = 5.5 * ticker;

#declare Radius = RadiusVariable * exp(Inclination*ticker);
#declare DeltaY = HeightVariable * exp(Inclination*ticker);
#declare Gauge = ThicknessVariable * exp(Inclination*ticker);


sphere { <0, 0, 0>, 1.2*Gauge , 0.3       //This sphere produces the solid shell
translate <Radius, YStart - DeltaY, 0>
rotate <0, Angle, 0>
  pigment {
 color rgb<255/255, 160/255, 50/255>
  }
}


sphere { <0, 0, 0>, 0.9*Gauge , -1             //And this sphere is substracted
and produces the inner void
translate <0.9*Radius, YStart - DeltaY, 0>
rotate <0, Angle, 0>
  pigment {
    color rgb<255/255, 255/255, 255/255>   // solid color pigment
  }
}


// Decorations - "spikes"

#if (mod(ticker, 10) = 0)    //a spike is inserted every thenth element

sphere { <0, 0, 0>, Gauge/3 , 0.5
scale <4, 1, 1>
translate <Gauge, 0, 0>
rotate <0, 0, 50>                          //This rotation produces the upper
row of spikes
translate <Radius, YStart - DeltaY, 0>
rotate <0, Angle, 0>
  pigment {
    color rgb<20/255, 0/255, 0/255>   // solid color pigment
  }
}


sphere { <0, 0, 0>, Gauge/3 , 0.5
scale <4, 1, 1>
translate <Gauge, 0, 0>
rotate <0, 0, -15>                       //and this rotation produces the lower
row of spikes
translate <Radius, YStart - DeltaY, 0>
rotate <0, Angle, 0>
  pigment {
    color rgb<20/255, 0/255, 0/255>   // solid color pigment
  }
}


#else
#end


#declare ticker = ticker + 1;
#end

}




//Stripes


blob {
  threshold 0.6

#declare ticker = 0;
#while (ticker<396)


#declare Angle = 5.5 * ticker;

#declare Radius = RadiusVariable * exp(Inclination*ticker);
#declare DeltaY = HeightVariable * exp(Inclination*ticker);
#declare Gauge = ThicknessVariable * exp(Inclination*ticker);


#declare ticker2 = 0;
#while (ticker2< 10)


sphere { <0, 0, 0>, 0.1*Gauge , 1
scale <1, 0.5 4>
translate <0.8*Gauge, 0, 0>
rotate <0, 0, -25+ticker2*10>          //This rotation produces the various
stripes
translate <Radius, YStart - DeltaY, 0>
rotate <0, Angle, 0>
  pigment {
 color rgb<20/255, 0/255, 0/255>
  }
}


#declare ticker2 = ticker2 + 1;
#end


#declare ticker = ticker + 1;
#end

}


Post a reply to this message


Attachments:
Download '18decog.png' (296 KB)

Preview of image '18decog.png'
18decog.png


 

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