|
|
"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
|
|
|
|
hi,
"Bald Eagle" <cre### [at] netscapenet> wrote:
> 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.
it should be relatively straightforward to convert the 2D code to idiomatic C++*
and make it available as an intrinsic function which, given the length of a
curve + xy coords, spits out an index. one for the developers, I think.
* an educated guess, I do not "speak" C++.
> If you can find code for the 3D version, then that would provide a full
> space-filling function.
there's an archive on the interweb, from ca 1999, which provides some 3D code.
if I find an unmodified copy I will post it here.
regards, jr.
Post a reply to this message
|
|