POV-Ray : Newsgroups : povray.advanced-users : image_map and eval_pigment : Re: image_map and eval_pigment Server Time
26 Apr 2024 09:29:30 EDT (-0400)
  Re: image_map and eval_pigment  
From: Thomas de Groot
Date: 7 Dec 2016 03:14:48
Message: <5847c4f8$1@news.povray.org>
On 7-12-2016 2:05, Alain wrote:

>> "Leroy" <whe### [at] gmailcom> wrote:
>>
>>> PosX and PosY are the size of Picture in pixels
>>> but the image_map is always 0,0 to 1,1
>>
>> Aha.  That very well may be it.  I'll check when I get home.
>> It's deceptive when max_extent reports the pixels size, but the
>> image_map is a
>> unit square...  :|
>>
>> But then of course, that makes me wonder - doesn't a regular image_map
>> pigment{}
>> definition extend in the x-y plane infinitely?  Unless 'once' is
>> included?
>>
>>
>>
>>
> The image occupy a unit square and get repeated ad infinitum in the X
> and Y directions, in both directions. Using once you only get the
> <0,0>-<1,1> square.
> You want to scale your image to the desired dimentions. Using
> max_extent() gives you the pixel size of the image, so, you can use
> scale max_extent(My_Image)
> to extend your image so that each pixel occupy an unit square and use
> the pixels coordinate in your eval_pigment() statement.
>

That should do it indeed.

It has been a very long time since I last seriously looked at those 
macros and I had to oil the gears of my memory cells to get again some 
semblance of activity. At first I thought you needed to rotate the 
image_map, but then I saw you used x and y instead of me x and z. :-)

-- 
Thomas


Post a reply to this message

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