POV-Ray : Newsgroups : povray.newusers : Isosurface blemished : Re: Isosurface blemished Server Time
15 May 2024 20:54:47 EDT (-0400)
  Re: Isosurface blemished  
From: Doctor John
Date: 27 Jan 2014 14:30:27
Message: <52e6b3d3$1@news.povray.org>
On 27/01/14 19:19, John Greenwood wrote:
> I tried to use an isosurface with a moderately complex formula but got very
> weird results, so I started with a working example with the object of adding the
> complexity bit by bit.
> 
> I started with the code below and found I was getting black features on the
> surface. There are five versions of the function line, the first renders ok but
> the rest give increasingly worse results.
> 
> #version 3.7;
> global_settings { assumed_gamma 1.0 }
> #default{ finish{ ambient 0.1 diffuse 0.9 }}
> 
> #include "colors.inc"
> #include "functions.inc"
> 
> //-------------------------------------------
> 
> #declare CamLoc = < 0, 0,-10>;
> 
> camera {
>  location CamLoc
>         right     x*image_width/image_height
>  look_at < 0, 0, 0>
>  angle 42
> }
> 
> light_source {CamLoc color White*0.35}
> light_source {<-50, 150,-75> color White}
> 
> background { color rgb<1,1,1>*0.35 }
> 
> 
> /*
> box {<-4,-3, 1>, < 4, 3, 2>
>  texture {
>   pigment {checker color rgb < 0.05, 0, 0.35>, color White}
>   finish {ambient 0 diffuse 1}
>  }
> }
> */
> //-------------------------------------------
> #local Yo = 0.08;
> #local Zo = .635;
> #local Xa = 0.75;
> #local Yb = 1.6;
> #local Rr = 2.560;
> #local Ko = 0.23;
> 
> 
> #declare IsoFinish =
> finish {
>  ambient 0 diffuse 1
>  specular 1 roughness 0.02
>  brilliance 2
> }
> 
> #declare  Shape =
> isosurface {
> // function {sqrt(x*x + y*y + z*z) - 1}
> // function {sqrt(pow((x/Xa),2) + pow((y),2) + z*z) - 1}
> // function {sqrt(pow((x/Xa),2) + pow((y/Yb),2) + z*z) - 1}
> // function {sqrt(pow((x/Xa),2) + pow((y/Yb),2) + pow((z/Zo),2)) - 1}
>   function {sqrt(pow((x/Xa),2) + pow((y/Yb),2) + (z/Zo)*(z/Zo)) - 1}
>  threshold 0
>  contained_by {box {<-1,-1,-1>, < 1, 1, 1>}}
>  texture {
>   pigment {color  rgb<0.8,0,0>}
>   finish {IsoFinish}
>          }
>         }
>  object {Shape rotate <0, 0, 45> translate <-2, 2, 0>}
>  object {Shape rotate <0, 45, 0> translate <-2, 0, 0>}
>  object {Shape rotate <0, 45, 45> translate <-2, -2, 0>}
> 
>  object {Shape rotate <-45, 0, 0> translate <0, 2, 0>}
>  object {Shape rotate <0, 0, 0> translate <0, 0, 0>}
>  object {Shape rotate <45, 0, 0> translate <0, -2, 0>}
> 
>  object {Shape rotate <45, 45, 45> translate <2, 2, 0>}
>  object {Shape rotate <0, -45, 0> translate <2, 0, 0>}
>  object {Shape rotate <45, 45, 0> translate <2, -2, 0>}
> 
> 
> 
> 
You've forgotten to specify max_gradient for your isosurface. Try a
value of around 1.6

John
-- 
Protect the Earth
It was not given to you by your parents
You hold it in trust for your children


Post a reply to this message

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