|
![](/i/fill.gif) |
kaneda wrote:
> As you can see, the texture-pattern changes depending on the cosinus. Does
> anyone have an idea how to prevent that? I really don't get why it does
> that :<
>
> Any solution would truly be great so thanks a lot in advance! :D
Hi Kaneda,
I'm going to assume you want the checker to follow the contour of the
isosurface. There is a way to do this.
To make it work, you will need to turn the pigment into a function and
then distort it with the same function you use to distort the
isosurface. I modified your code to show how this is done:
#declare chckr= // a pigment encased in function{...} brackets
function{
pigment {
checker
rgb .05, rgb 1
translate 0.5 // offset to prevent coincident surface artifacts
}
}
#declare f= // the ripple
function{
cos(sqrt(x*x+z*z))
}
isosurface {
function {
f(x,y,z) // the ripple
+ y // the y-facing surface
}
threshold 1
max_gradient 1.5
contained_by {box {<-4,-2,-4>,<4,2,4>}}
pigment{
function{
// note the ripple's function added to the
// y axis of the chckr function
chckr(
x,
y+f(x,y,z),
z
).grey
// all pigment functions must end in .grey,
// .x, .y or .z (r, g, b, respectively)
}
}
}
I hope this helps!
~Sam
Post a reply to this message
|
![](/i/fill.gif) |