|
![](/i/fill.gif) |
David Given wrote:
> ...which demonstrates what you can do with isosurfaces. Alas, I haven't
> found source for that one...)
I made a less impressive cityscape here:
http://news.povray.org/povray.binaries.images/thread/%3C4a358a3b@news.povray.org%3E/?ttop=341111&toff=300
I wasn't too happy with it but the height function is just:
#local f_cells = function {pattern {cells}}
#local f_base = function {pattern {hexagon rotate 90*x scale 0.005
turbulence 0.5}}
#local f_scape = function(x,y,z)
{
0.6* f_cells(x*30,y*30,z*30) *
select( f_base(x,y,z)-0.2, 0, 1.0)
}
The scene used a height_field but an isosurface should also work.
The windows are just texture (using slope pattern you can give
different textures to vertical walls).
> For example, if I replacing the sin(x) with mod(x, 2)-1 then I get the
> same result... but now I only get half the balls, and those balls have
> in turn been halved. Given that mod(x, 2)-1 and sin(x) both return
> values in the domain [-1..1] I'm slightly confused by this.
The problem with mod is that returns negative fractions for
negative numbers so your expression actually returns values
in the domain [-3,-1] for negative x. That's why half of the
balls are missing. You can use abs(mod(x,2))-1.
But I didn't see the ball halving problem. Note that the
lower part of the spheres was missing in my example due to
the contained_by clipping at the y=0 plane.
Also I shied away from using mod because it has undefined
gradient at the boundaries that may or may not be a problem
for the isosurface rendering later. Of course, it probably
evaluates faster than sin.
Post a reply to this message
|
![](/i/fill.gif) |