|
|
Dave Matthews wrote:
>I'm not sure that this discovery adds much to the stockpile of useful POVRay
>techniques, but I thought I'd share it anyway.
>
>I wanted to directly warp an isosurface -- not add or subtract a noise
>function, but apply the "black_hole," "turbulence," etc. to the isosurface
>function itself.
>
>By going through Mike Williams' "Isosurface Tutorial,"
>http://www.econym.demon.co.uk/isotut/index.htm, I came up with the
>following (but don't blame him if I missed some incredibly easy method of
>doing the same thing):
>
>Use the function in question as a pigment, but run it through a "high-low"
>filter, so that it doesn't repeat itself for values >1 and < -1. If the
>function has a threshold of 0, I do this:
>
>#declare My_F = function { stuff };
>
>#declare Warped_F =
> function {
> pigment {
> function {min(max(-0.5, My_F(x,y,z)),0.5) + 0.5}
> warp { warping stuff }
> }
> };
>
>isosurface { function { Warped_F(x,y,z).gray - 0.5 }
> threshold 0
> other isosurface stuff
> }
>
>Depending on the function, sometimes I've had to use "0.5 -
>Warped_F(x,y,z).gray" .
>
>Question: Is there an easier way of directly "warping" an isosurface?
>
>Question #2 (I'll answer this): Why not just add/subtract a pigment?
>(Answer: I don't know. Maybe I'm just being difficult.)
>
OK, now I see that I could simply use "pattern" instead of "pigment" and not
need the .gray at all.
(Don't know how I missed this, it's right in Mike Williams' tutorial.)
Post a reply to this message
|
|