POV-Ray : Newsgroups : povray.text.scene-files : ball of rings lathe Server Time
22 Jun 2024 07:01:12 EDT (-0400)
  ball of rings lathe (Message 1 to 1 of 1)  
From: nospam
Subject: ball of rings lathe
Date: 4 Dec 2003 17:12:12
Message: <3fcf5f5d.9042747@localhost>
Faster than CSG for making many rounded-edge rings.

Pete

-- 
#version 3.5;
#declare rotate_seed = seed(79633834);
#declare use_rad = true;


global_settings {
  assumed_gamma 2.2
  noise_generator 2
  #if (use_rad = true)
    radiosity {
      /* uses v3.5 radiousity syntax */
      always_sample off // You can force POV-Ray to only use the data
                        // from the pretrace step and not gather any
                        // new samples during the final radiosity
                        // pass.  This may reduce splotchiness.
                        // It can also be usefull when reusing
                        // previously saved radiosity data.
      brightness 1
      count 144  // number of rays that are sent out whenever a new
                 //  radiosity value has to be calculated
      error_bound 0.3   // lower than 0.1 is not recommended
      low_error_factor 0.4 // work harder during pretrace
      max_sample 1.0    // scale level of overly bright samples to
                        // not exceed this
      recursion_limit 2
      normal on         // whether or not radiousity accounts
                        // for normals
    }
  #end
}


camera {
  location 0
  direction <0, 0, 2>
  up <0, 1, 0>
  right <(image_width / image_height), 0, 0>
  translate <-0.75, 0.5, -5>
}


background {
  color rgb 1
}

  
#declare main_texture = texture {
  pigment { color rgb <0, 0.5, 1> }
  finish { ambient 0 diffuse 1 }
}


sphere {
  0, 1
  texture { main_texture }
}


#macro do_ring(r4dius, thick, trans)
  #local thin = thick / 2;
  lathe {
    cubic_spline
    6,
    <r4dius, -thick>,
    <r4dius, thick>,
    <r4dius + thin, thick>,
    <r4dius + thin, -thick>,
    <r4dius, -thick>,
    <r4dius, thick>
    transform trans
  }
#end


union {
  #declare cc = 0;
  #declare o_rad = 2.0;
  #while (cc < 30)
    do_ring(
      2 - (cc * 0.025),
      0.02,
      transform {
        rotate x*rand(rotate_seed)*360
        rotate y*rand(rotate_seed)*360
        rotate y*rand(rotate_seed)*360
      }
    )
    #declare cc = cc + 1;
  #end
  texture { main_texture }
}


#if (use_rad = false)
  light_source {
    <-3000, 3000, -2000>
    color rgb 1
  }
#end


/* actual end of this file */


Post a reply to this message

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