POV-Ray : Newsgroups : povray.advanced-users : vlength( ) : Re: vlength( ) Server Time
30 Jul 2024 08:26:09 EDT (-0400)
  Re: vlength( )  
From: Warp
Date: 13 Jun 2000 09:08:12
Message: <3946323c@news.povray.org>
SamuelT <STB### [at] aolcom> wrote:
: It's for the eval_pigment stuff I've been using. I needed to convert a color
: vector into a float value so I could use it for elevation.

  So in practice what you are trying to do is to convert a color to b/w
(ie. a brightness value).
  There's an exact formula on how each color component affects the brightness,
and I don't remember exactly the values, but this might be a good
approximation:

brightness = red*0.25 + green*0.6 + blue*0.15

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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