POV-Ray : Newsgroups : povray.general : Constructing isosurface functions : Re: Constructing isosurface functions Server Time
29 Jul 2024 12:14:18 EDT (-0400)
  Re: Constructing isosurface functions  
From: David Given
Date: 16 Jul 2011 18:09:21
Message: <4e220c11@news.povray.org>
On 16/07/11 14:47, Christian Froeschlin wrote:
[...]
> 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.

Yes, of course. (That works fine.)

> 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.

Yes, this was it; I had failed to notice the clipping in your original.

I appear to be totally failing to get my head around the way these work;
I can look at a function and (eventually) figure out why it's producing
the result it is, but I can't figure out what function I need to produce
the result.

Here's a fascinatingly failed attempt to perturb the spheres into random
locations:

http://twitpic.com/5r9ejh/full

#declare f_obj  = function(x,y,z) {f_sphere(x,y,z,0.05)}
#declare f_grid = function(x,y,z) {f_obj(2*f_noise3d(x, y, z)-1, y,
2*f_noise3d(x, y, z)-1)}

Which is cool, and an effect worth remembering, but not what I was
looking for.

I've been having a look at pigment functions instead; as I can think
about these in a forwards direction I'm having better luck. I can create
a perturbed terrain that's just below my planet's surface which sticks
out above at particular points. Given that my trees are only going to be
viewed from a distance, extended ovoids will do fine, and something like
crackle would help here.

This just gives me the problem of how to try and vary the density of
trees according to some external function (probably going to be a
heightmap lookup table combined with random noise). This requires me to
make my crackle lumps get closer or further apart from each other. So
far this is evading me...

Here's another interesting image I managed to generate:

http://twitpic.com/5r29s1/full

The isosurface that's modelling the spheres is, more or less:

  terrain - 10m + leopard(x, y, z)

Leopard produces a rectilinear grid of blobs, and right now the camera's
at about 20⁰N, so you can see the lines are all slanted. (Life would be
so, *so* much easier if planets were flat.) The blobs are all about 100m
across, and I hate to think how many of them are visible in that image.

-- 
┌─── dg@cowlark.com ─────
http://www.cowlark.com ─────
│
│ "I have a mind like a steel trap. It's rusty and full of dead mice."
│ --- Anonymous, on rasfc


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.