POV-Ray : Newsgroups : povray.general : Constructing isosurface functions : Re: Constructing isosurface functions Server Time
29 Jul 2024 12:22:30 EDT (-0400)
  Re: Constructing isosurface functions  
From: David Given
Date: 15 Jul 2011 17:32:38
Message: <4e20b1f6$1@news.povray.org>
On 15/07/11 21:05, Christian Froeschlin wrote:
[...]
> It depends whether you can express the placement pattern with
> a simple function. Generating millions of min and selects will
> make the result much slower than using object copies. On the other
> hand, a function that has a periodicity can be used to multiply
> object instances. For example, here's a million object copies
> placed in a grid that renders reasonably fast:

Yes, precisely!

(I'm particularly impressed by this image:

http://news.povray.org/povray.binaries.images/attachment/%3C47ec0047%40news.povray.org%3E/isocity-part.jpg?ttop=333517&toff=800

...which demonstrates what you can do with isosurfaces. Alas, I haven't
found source for that one...)

What I've got are two massive heightfield images that contain
displacement and distribution density. I want to randomly place my
objects on the terrain, at the correct height for the terrain,
distributed according to the density. Just to make life more
interesting, my terrain is spherical. (Yes, it's a planet.)

[...]
> #declare f_grid = function(x,y,z) {f_obj(sin(x*10)/10,y,sin(z*10)/10)}

This is just the kind of thing I'm looking for. Except... how does it
work? I know that y=sin(x) repeatedly crosses the X axis, so I assume
you're using this to control the location of the balls, but I'll admit
that I have trouble with the bizarrely reverse thinking needed to
understand isosurfaces.

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.

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