POV-Ray : Newsgroups : povray.general : Height field to mesh - more resolution : Re: Height field to mesh - more resolution Server Time
3 Mar 2024 07:58:59 EST (-0500)
  Re: Height field to mesh - more resolution  
From: Kenneth
Date: 2 Dec 2023 17:40:00
Message: <web.656bb1e02c1eda449b4924336e066e29@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:
> >
> > For example, finding a particular
> > individual pixel's color, or its location in the original image?
> We have been over this before...

Yes indeed ;-)

The aforementioned link...

> ..and you probably need to discard certain ideas
> that you have about what is going on.

Alas, I'm still a dunce as to where my thinking has gone wrong. :-(

Of course, I could pull out the two pieces of information that I want-- PRIOR to
turning the image into a function-- by using eval_pigment + loop on the image or
image_map itself. But Ingo's comment implies that there is a code trick
POST-function to get (at least one of?) those values, which he would then enter
into an array.
> The image is never "in function form"...

'under the hood' that is, if I understand your older comments...but the user
creates and sees a single entity, 'the function', at the SDL-code level

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

That's the unknown mystery to me-- if I'm not still off-base with my thinking!

Let's say that I turn an image into a function...
function{pigment{png "MY_IMAGE.png}}

Now, I could manipulate the function to pull out the grayscale values of only
the RED color channel for example, using dot notation...

then create an image_map of just that segregated channel. But that is for ALL of
the pixels at once. The dot notation trick provides no individual-pixel
'location' information; nor do the (x,y,z) function arguments-- they can be
thought of as overall pixel 'scalers', like (3*x,y,z).

Yet, your comments and Ingo's seem to imply that there IS a further
code-manipulation trick to extract a single pixel's color value (a grayscale
value in my example). And/or "It's *location* is the location that you specify
in the function." How to do either of those in SDL is my main question (and

Am I still wrong-headed about this possibility?

My apologies to Ilya for going off-topic here.

Post a reply to this message

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