POV-Ray : Newsgroups : povray.general : Coloring spheres based on their specified size : Re: Coloring spheres based on their specified size Server Time
27 Jul 2024 16:22:20 EDT (-0400)
  Re: Coloring spheres based on their specified size  
From: jr
Date: 1 May 2024 09:55:00
Message: <web.66324923d66fa131686e436cde94f1@news.povray.org>
hi,

"esfoster" <nomail@nomail> wrote:
> I have a set of spheres defined with x, y, z, and size.
>
> I want to add a color to them based on their size. ...

suggest re-structuring your data, separate centres and radii.  eg.
#declare spharr = array [N] {
  array mixed [2] {<0.385010,0.768357,0.476123>,0.019470},
  ...
};

and a '#for()' loop to make the union of spheres from that.  then you can
"re-use" the radius as spline point perhaps, to retrieve a corresponding colour.

<https://wiki.povray.org/content/Reference:Spline>


regards, jr.


Post a reply to this message

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