POV-Ray : Newsgroups : povray.general : Need help with Isosurface and Predefined Shapes Code Conversion : Re: Need help with Isosurface and Predefined Shapes Code Conversion Server Time
2 Aug 2024 04:18:38 EDT (-0400)
  Re: Need help with Isosurface and Predefined Shapes Code Conversion  
From: Mike Williams
Date: 22 Jan 2005 15:23:32
Message: <XsKm0HAkXr8BFwO+@econym.demon.co.uk>
Wasn't it mephuser who wrote:
>Need help with Isosurface and Predefined Shapes Code Conversion
>//Predefined Shape Code
>cylinder{<0,-0.5,0>, <0,0.5,0>, 0.215}
>// What does <0,-0.5,0> mean?
>// What does 0.215 mean?


Try running the following complete scene

The red cylinder is a cylinder.
The green cylinder is an isosurface.
The blue spheres are placed at points <0,-0.5,0> and <0,0.5,0> so you
can see how they relate to the cylinder.
The yellow bar is 0.215 units long, so you can see how that relates to
the cylinder.


global_settings {assumed_gamma 1.0}
camera { location  <0.3, 0, -5> look_at <0.3, 0, 0> angle 20}
background {rgb 1}
light_source {<-100,200,-100> colour rgb 1}

cylinder{<0,-0.5,0>, <0,0.5,0>, 0.215
  pigment {rgb <1,0,0>}
}

isosurface {
  function { x*x + z*z - 0.215*0.215 }
  max_gradient 0.7
  contained_by {box {<-.3,-.5,-.3><.3,.5,.3>}}
  pigment {rgb <0,1,0>}
  translate x*0.6
}

sphere {<0,-0.5,0>,0.04 pigment {rgb <0,0,1>}}
sphere {<0, 0.5,0>,0.04 pigment {rgb <0,0,1>}}

cylinder {<0,0.55,0><0.215,0.55,0>,0.02 pigment {rgb <1,1,0>}}


Post a reply to this message

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