POV-Ray : Newsgroups : povray.general : Height field to mesh - more resolution : Re: Height field to mesh - more resolution Server Time
3 Mar 2024 07:18:35 EST (-0500)
  Re: Height field to mesh - more resolution  
From: Bald Eagle
Date: 2 Dec 2023 10:45:00
Message: <web.656b507f2c1eda441f9dae3025979125@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> "ingo" <nomail@nomail> wrote:
> >
> > you can use an image as a pattern and you can use a pattern in a function. Then
> > you can sample the "image function" to fill arrays. But, the image will already
> > be interpolated.
> >
> This is interesting, and something that I have been trying to figure out for
> quite awhile with no luck. Once the image is in function form, HOW do you
> extract or 'sample' usable info from it? For example, finding a particular
> individual pixel's color, or its location in the original image?

We have been over this before, and you probably need to discard certain ideas
that you have about what is going on.

The image is never "in function form" - POV-Ray simply has a mechanism by which
a function is indexed into the image by its pixel location - the x, y, and z
arguments of the function call.

You sample usable information from it by telling the function where in the image
you want to sample from, and POV-Ray looks up the color information at that part
of the image.   It's nothing but a lookup table.  "What piece is on the chess
board at THIS (<x, y, z> square?"

The pixel's color IS the information that gets returned from the function.

It's location is the location that you specify in the function.

You're not going to be able to (easily) do that in reverse, for a whole host of
reasons - but you could certainly process the information after you copy all the
pixel color info into a 1D or 2D array, and then make a cumulative distribution
function, or simply search for all of the pixels that have the rgb value you're
looking for.

It's nothing but a lookup algorithm.


- BW

Post a reply to this message

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