|
![](/i/fill.gif) |
Hi.
The tutorial for the height_field primitive makes the user generate a sample
height field by rendering a trivial scene with a plane and a wrinkles
pattern.
I often felt the need of such a purely random height field, to serve as a
natural floor for a scene. I find the need for an external file somewhat
annoying: the file must either be carried around with the scene, or
re-generated, it is cumbersome.
I just found that patterns and pigments could be programatically queried
through the use of user-defined functions. Something like:
#declare height = function { pattern { wrinkles } }
This opens the possibility to use it directly as a height field, either with
an iso_surface (function { y - height(x, z, 0) }) or by building a mesh
(less elegant, but seems to be faster).
Are there drawbacks in doing so? Or more elegant solutions to this problem?
Post a reply to this message
|
![](/i/fill.gif) |