POV-Ray : Newsgroups : povray.text.scene-files : Needle [WIP] Server Time
1 Nov 2024 05:20:19 EDT (-0400)
  Needle [WIP] (Message 1 to 2 of 2)  
From: Corey Woodworth
Subject: Needle [WIP]
Date: 15 Mar 2002 15:04:15
Message: <3c9253bf@news.povray.org>
#version 3.5;

#include "colors.inc"
#include "finish.inc"
#include "rad_def.inc"
#include "metals.inc"

/* I'm having some serious problems getting the materials right,
particularly the clear plastic,
it's supposed to be whitish and kinda milky. Everthing
seen through it should be a little on the blury side as well. I'm trying to
do some 3S but not the slightest clue how. The current media settings don't
work at all and i've tried what seems like hundreds. Please help! ;) */

global_settings {
  assumed_gamma 1.0
  max_trace_level 5
  radiosity{
      media on
      pretrace_start 0.08
      pretrace_end   0.01
      count 1000

      nearest_count 20
      error_bound .4
      recursion_limit 1
      brightness 1.2

      low_error_factor 0.01
      minimum_reuse 0.0

      always_sample off
  }
}

// ----------------------------------------

camera {
  location  <0.0, .06, -.1>
  direction 1.5*z
  right     x*image_width/image_height
  look_at   <0.0, 0.0,  0.0>
}

sky_sphere {
  pigment { rgb <.8,.8,1>  }
}

/*
light_source {
  0*x                 // light's position (translated below)
  color rgb 1.0       // light's color
  translate <-30, 25, -30>   // <x y z> position of light
}                   */

// ----------------------------------------

plane {
  y, // <X Y Z> unit surface normal, vector points "away from surface"
  -.005 // distance from the origin in the direction of the surface normal
  pigment { rgb <.9,.9,1>  }
}



// ---------------------------------------- Needle
#declare syringe = object {
  union {
    // Clear Plastic
    difference {
      merge {
        //shaft
        cylinder {
          0*x,  .055*x,  .0025
        }

        //tip
        cylinder {
          .055*x,  .065*x,  .001
        }

        // bottom
        prism {
           bezier_spline
           -0.0019,
           0,
           24,

           // (--- the <u,v> points ---)
          <-.005,.0075>,<-.005,.0075>,<-.004,.0095>,<0,.0095>,
          <0,.0095>,<0.004,.0095>,<.005,.0075>,<.005,.0075>,
          <.005,.0075>,<.005,.0075>,<.005,-.0075>,<.005,-.0075>,

          <.005,-.0075>,<.005,-.0075>,<0.004,-.0095>,<0,-.0095>,
          <0,-.0095>,<-0.004,-.0095>,<-.005,-.0075>,<-.005,-.0075>,
          <-.005,-.0075>,<-.005,-.0075>,<-.005,-.0075>,<-.005,.0075>

          rotate <0,0,1>*90
        }
         //Triad
         prism {
           bezier_spline
           -0.00025,
           0.00025,
           16,

           // (--- the <u,v> points ---)
           <.055,.0025>,<.055,.0025>,<.0625,.0025>,<.0625,.0025>
           <.0625,.0025>,<.0625,.0025>,<.0645,.002>,<.0645,.0009>
           <.0645,.0009>,<.0645,.0009>,<.055,.0009>,<.055,.0009>
           <.055,.0009>,<.055,.0009>,<.055,.0025>,<.055,.0025>
           rotate x*5
        }
         //Triad
         prism {
           bezier_spline
           -0.00025,
           0.00025,
           16,

           // (--- the <u,v> points ---)
           <.055,.0025>,<.055,.0025>,<.0625,.0025>,<.0625,.0025>
           <.0625,.0025>,<.0625,.0025>,<.0645,.002>,<.0645,.0009>
           <.0645,.0009>,<.0645,.0009>,<.055,.0009>,<.055,.0009>
           <.055,.0009>,<.055,.0009>,<.055,.0025>,<.055,.0025>
           rotate x*125
         }
         //Triad
         prism {
           bezier_spline
           -0.00025,
           0.00025,
           16,

           // (--- the <u,v> points ---)
           <.055,.0025>,<.055,.0025>,<.0625,.0025>,<.0625,.0025>
           <.0625,.0025>,<.0625,.0025>,<.0645,.002>,<.0645,.0009>
           <.0645,.0009>,<.0645,.0009>,<.055,.0009>,<.055,.0009>
           <.055,.0009>,<.055,.0009>,<.055,.0025>,<.055,.0025>
           rotate x*-115
         }
      }
      //chamber
      merge {
          //shaft
          cylinder {
            -0.003*x,  .054*x,  .0015
        }
          //tip
          cylinder {
           .05*x,  .066*x,  .0005
        }
      }

      hollow on
      material {
        texture {
          pigment {  rgbt <1,1,1,.9>  }
          finish {
            ambient 0
            specular 1
            roughness .3
          }
        }

        interior {
          media {
           #declare Color=<1,1,1>;
           #declare opacity=.3;
           #declare Diffuse=.8*opacity;
           scattering {1,10*Diffuse}
           absorption rgb <.25,.25,0>
           intervals 50
           samples 1,150
           method 3
           density {bumps
                scale .00005}
          }
        ior 1.04
        }
      }
    }

    //needle
    difference {
      cylinder {
        .054*x, .073*x, .0001
      }
      union {
        cylinder {
          .053*x, .074*x, .00005
        }
          box {
          <-.001, -.001, -.001>
          < .001,  .001,  .001>
          rotate z*75
          translate x*.073
          translate y*.001
        }
      }
       texture {T_Chrome_4C}
    }

    //rubber needle holder
    cylinder {
      .064*x,  .065*x,  .000499
      pigment { color <.9,.9,1> }
      finish {Dull}
    }

    //plunger
    union {
      cylinder {
        -.0075*x,  -.0085*x,  .005
      }
      box {
        <-.008, -.00045, -.00145>
        < .047,  .00045,  .00145>
      }
      box {
        <-.008, -.00145, -.00045>
        < .047,  .00145,  .00045>
      }
      cylinder {
        .047*x,  .0478*x,  .00149
      }
      cylinder {
        .0475*x,  .0485*x,  .0005
      }
      pigment { color rgb <1,1,1> }
      finish  { Shiny
                ambient .5
      }
    }

    //rubber piece
    union {
      cylinder {
        .0482*x,  .0492*x,  .00149
      }
      sor {
      10,

      <0.0012, 0.0491999>
      <0.001, .0492>
      <0.00149, 0.05045>
      <0.0012, 0.0517>
      <0.0012, 0.0517001>
      <0.0012, 0.0536>
      <0.0012, 0.0536001>
      <0.0013, 0.0538>
      <0.00149, 0.054>
      <0.00149, 0.054>

      rotate z*-90
      }
    pigment { color Black }
      finish {Dull}
    }
  }
}

object {
  syringe
  translate x*-.03
  translate y*-.0012
  rotate z*-2.6
  rotate y*60
}


Post a reply to this message

From: Hugo
Subject: Re: Needle [WIP]
Date: 15 Mar 2002 17:13:30
Message: <3c92720a@news.povray.org>
Hi Corey,

I tried to improve the media and maybe you haven't tried this:

      material {
        texture {
          pigment {  rgbf <1,1,1,.8>  }
          finish {
            ambient 0
            specular .7
            roughness .25
          }
        }

        interior {
          media {
           #declare Color=<1,.98,.96>;
           #declare opacity=36;
           #declare Diffuse=.6*opacity;
           scattering {1,10*Diffuse extinction
(1/(Diffuse+.0001))*opacity*1.75}
           absorption rgb (1-Color)*10*Diffuse
           intervals 14
           samples 1,150
           method 3
        //   density {bumps
        //        scale .00005}
          }
        ior 1.04
        }
      }
    }


.... I disabled radiosity in my tests... Well, I don't think the above looks
perfect but at least it renders more quick.. I'm not so experienced with
media.. Maybe someone else will help you too.

Regards,
Hugo


Post a reply to this message

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