|
|
"Kenneth" <kdw### [at] gmailcom> wrote:
>
> In case you want to try the quick test (no need for 'high-quality' settings
> here):
> -----------
> #declare BUMPS_F =
> function{pattern{bumps scale .2}}
>
> #declare GRANITE_F =
> function{pattern{granite scale 3}}
>
> #declare SIN_F = function(x){sin(7*pi*x)}
>
> isosurface{
> function { sqrt(pow(x,2)+pow(y,2)+pow(z,2))-.7 // sphere
>
> // switch these around...
> + BUMPS_F(x,y,z)*.5
>
> - GRANITE_F(x,y,z)*.5
>
> - SIN_F(x)*.2
>
> }
>
> threshold 0
> accuracy .01
> max_gradient 8
>
> contained_by{box{-1.1,1.1}}
> pigment{ rgb 1}
> }
Just to be complete:
Here is an instance where the order of functions does matter, *when* using
additional parentheses. This is to be expected of course. As Alain pointed out
earlier (paraphrasing),
+(A - B) is different from -(B + A)
+ (BUMPS_F(x,y,z)*.5
- GRANITE_F(x,y,z)*.5)
- SIN_F(x)*.2
vs.
- (GRANITE_F(x,y,z)*.5)
+ (BUMPS_F(x,y,z)*.5)
- SIN_F(x)*.2
Post a reply to this message
|
|