POV-Ray : Newsgroups : povray.general : POV-Lab: plans and discussions : Re: POV-Lab: plans and discussions Server Time
18 May 2024 00:17:18 EDT (-0400)
  Re: POV-Lab: plans and discussions  
From: Bald Eagle
Date: 12 Feb 2023 08:50:00
Message: <web.63e8ede11a3112301f9dae3025979125@news.povray.org>
"yesbird" <nomail@nomail> wrote:
> Hi, jr
>
> I've attached the most tasty maps to this message, btw, don't you know how to
> scale them properly, I mean map to object whole specter completely ?
>
> Reading manual:
> https://www.povray.org/documentation/view/3.6.1/335/
> and a lot of experiments with scaling gives no result.
> --
> YB

Your color map for spring goes from 0 to 5.5

Your sphere has a radius of 10.

Normally (<--- get it?) we try to use values from 0 to 1 for everything and then
scale afterwards.

Since you're using a gradient pigment, and the sphere has a diameter of 20, then
you need to make that 5.5 fit across 20 evenly.

The only problem there, is that IIRC, POV-Ray just ignores all of those values
above 1 in the color map definition, and I don't think there's currently a
mechanism that can fix that (like scaling it).

So I plopped the color map into a spreadsheet, divided all of the indices by the
max, and pasted it back out into spring2.inc, then scaled it by 20.

Then the only other thing you have to take into consideration is the fact that
the sphere is at the origin, which means its left side extends over to x=-10.
So before scaling the unit color map, I translate it -x*0.5, and THEN scale it
by 20, so that it goes from -10 to 10.

I hope that helps illustrate how all of this works and how one should think
about it.


Post a reply to this message


Attachments:
Download 'colormaps.png' (80 KB)

Preview of image 'colormaps.png'
colormaps.png


 

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