POV-Ray : Newsgroups : povray.binaries.images : Porous Rock : Re: Porous Rock Server Time
19 May 2024 10:25:00 EDT (-0400)
  Re: Porous Rock  
From: Dre
Date: 14 Jul 2008 02:00:42
Message: <487aeb8a@news.povray.org>
"Mike Williams" <nos### [at] econymdemoncouk> wrote in message 
news:+9fE### [at] econymdemoncouk...
> Wasn't it Dre who wrote:
>>"Tek" <tek### [at] evilsuperbraincom> wrote in message
>>news:4878f316$1@news.povray.org...
>>> "Rob Richards" <ari### [at] btinternetcom> wrote in message
>>> news:in4h74tllnc5r82ropj3sg006boujelu77@4ax.com...
>>>> Wow, thats fantastic. Can I ask how the isosurface was defined ? i.e.
>>>> is it a sphere - this pattern ? Or am i way off base !
>>>
>>> You're exactly right, sphere - pattern.
>>>
>>> --
>>> Tek
>>> http://evilsuperbrain.com
>>>
>>>
>>
>>Hmmm, there must be something I'm doing really wrong then as all I can get
>>out of this is a flat textured shape, I dont get any porous effects at 
>>all!
>>
>>If I render it as a hightfield it also looks totally wrong :(
>>
>>Meh, goes back to fiddle some more...
>
> It goes something like this:
>
> #version 3.6;
>
> global_settings {assumed_gamma 1.0}
>
> camera {location  <0,0,-10> look_at <0,0,0>}
>
> background {rgb <.8,.8,1>}
>
> light_source {<-30, 100, -30> color rgb 0.5}
> light_source {<0, 10, -30> color rgb 0.5}
>
> #declare P = function{pigment {
> #local Curve=1/8; // small values make it look porous
> #local Omega=0.5;
> #local Lambda=2;
> #local Octaves=8;
> pigment_pattern {
>  average
>  pigment_map {
>   #local octave=0;
>   #while ( octave < Octaves )
>    [pow(Omega,octave)
>     pigment_pattern {
>      crackle form <.9,0,0>
>      scale pow(Lambda,-octave)
>      colour_map {[0 rgb 1][1 rgb 0]}
>     }
>     poly_wave 1/Curve
>    ]
>    #local octave=octave+1;
>   #end
>  }
> }
> poly_wave Curve
> colour_map {[0 rgb 1][1 rgb 0]}
> }}
>
> #declare  S = function {x*x + y*y + z*z - 1}
>
> isosurface {
>  function { S(x,y,z) - P(x,z,y).grey*2 }
>        max_gradient 70
>        contained_by{sphere{0,1.5}}
>        pigment {rgb 1}
>  scale 3
> }
>
> I've not done any radiosity or other fancy rendering on this, so it
> renders a bit faster but doesn't look as good.
>
> Try tweaking the numbers in "grey*2" and "scale 3".
>
> -- 
> Mike Williams
> Gentleman of Leisure

Whoa, okay so I was waaaaaaay off base here!

But I now know where I went wrong (massivly wrong, hehehe).  I'm still 
learning how to use isosurfaces properly and that was my mistake, thanks 
very much for that bit of code, thats cleared that up for me nicely.

Now to start playing around!

Cheers Dre


Post a reply to this message

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