POV-Ray : Newsgroups : povray.binaries.images : hilbert2d utility : Re: hilbert2d utility Server Time
3 May 2024 01:11:20 EDT (-0400)
  Re: hilbert2d utility  
From: Bald Eagle
Date: 30 May 2018 06:45:00
Message: <web.5b0e8080ff7db64c10874a080@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> I thought (think) of a colour map as 1D, so not sure how that relates ("maps")
> to 2D, however..


That what the Hilbert curve does, right?   Maps 1D input to 2D output?

> > I suppose if the Hilbert curve is a "curve" that is continuous function and can
> > go from a value to a 2D coordinate, then perhaps there is the inverse of the
> > function that can go from 2D coordinates to the 0-1 values in a color map.
>
> there is. example code on https://en.wikipedia.org/wiki/Hilbert_curve.
>
> interestingly, the animated gif in the top right of that page is "coloured in".
> is that similar to what you're thinking of?

Sure - but the way to think about a pigment_pattern is as an equation - for any
<x, y, z> plugged in, you should get some 0-1 out.  Then POV-Ray takes that
value and further processes it with a color map, texture map, material map,
normal, heightfield height, etc.


> the output of the 'xy2d()' code could be scaled to the 0..1 range.  would that
> do the trick?

That's literally all there is to it.

If you can find code for the 3D version, then that would provide a full
space-filling function.


Post a reply to this message

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