POV-Ray : Newsgroups : povray.general : Mapping Textures on irregular shapes : Re: Mapping Textures on irregular shapes Server Time
3 May 2024 05:41:11 EDT (-0400)
  Re: Mapping Textures on irregular shapes  
From: Alain Martel
Date: 1 May 2020 21:03:35
Message: <5eacc6e7$1@news.povray.org>
Le 2020-05-01 à 12:53, Josh a écrit :
> Alain Martel <kua### [at] videotronca> wrote:
>> Le 2020-04-30 à 20:10, Josh a écrit :
>>> "Josh" <nomail@nomail> wrote:
>>>> I've found a way to create and use a df3 file as an isosurface. Works well. I'm
>>>> trying now to add noise to it and it makes the shape disappear. Any ideas? The
>>>> shape shows up fine without the +f_noise3d(x,y,z)*2 statement... Does anyone
>>>> know what is happening?
>>>>
>>>> #include "functions.inc"
>>>> #declare Fnct00 = function {
>>>>       pattern { density_file df3 "aster1.df3" interpolate 0
>>>>       }
>>>> }
>>>> #declare Fnct01 = function (x,y,z) {
>>>>       0.025-Fnct00(x,y,z)
>>>> }
>>>> #declare BaryteGreen = srgb <0.6157,0.7686,0.3725>;
>>>> #declare Iso00 = isosurface {
>>>>       function { Fnct01(x,y,z) + f_noise3d(x,y,z)*2}
>>>>       contained_by { box { -5,5 } }
>>>>       threshold 0
>>>>       accuracy 0.0005
>>>>       max_gradient 6
>>>>       all_intersections
>>>>       texture {
>>>>         pigment { color BaryteGreen }
>>>>         finish { ambient <0.03,0.02,0.0> diffuse 0.8,0.4 phong 0.7 }
>>>>       }
>>>> }
>>>>
>>>> Josh
>>>
>>> Just to clarify, I've tried adding f_noise3d, subtracting it, nothing seems to
>>> allow me to perturb the surface of my df3 shape like I can if my function is
>>> just a simple sphere...
>>>
>>> Josh
>>>
>>>
>>
>> Play with the coordinates passed to the function and see what happen.
>>
>> A starting point :
>> function { Fnct01(x+sin(y*2+z*3),y-cos(x*7),z+cos(y*5)) }
> 
> That produced interesting results. It split the shape up and duplicated it a
> bunch of times. I'll have to think about it.
> 
> In the meantime, does anyone know what the isosurface function would be for a
> rounded box?
> 
> Thanks!
> 
> Josh
> 
> 
You can reduce the intensity of the effect as follow :

function { Fnct01(x+sin(y*2+z*3)/2,y-cos(x*7)/5,z+cos(y*5)/10) }

You can sear the object :
function { Fnct01(x+y/2,y,z) }

Or progressively scale it :
function { Fnct01(x*sin(y*2)*cos(z*3)/2,y*cos(x*7)/5,z*cos(y*5)/10) }


Post a reply to this message

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