POV-Ray : Newsgroups : povray.advanced-users : Color component extraction: Bug or advanced feature? : Color component extraction: Bug or advanced feature? Server Time
30 Jul 2024 02:18:15 EDT (-0400)
  Color component extraction: Bug or advanced feature?  
From: Simen Kvaal
Date: 7 May 2000 17:40:35
Message: <3915e2d3$1@news.povray.org>
Forgive me for being so active posting here lately. I guess it's me being
very active in raytracing these days... Anyway; I feel that this is the
right group to post in, so...

I've been writing color-space conversion macros, and needed to extract the
individual float values in the color vector. I looked up in the docs, and it
said that one should extract with e.g. Color.red to get the red component
float. But this does not work as stated in the manual; instead it generates
(I found out after a lot of hassle) a 5-color vector with _all_ the
components set as that Color.red-value. Is this really how it's supposed to
be? I cannot see _any_ way of extracting a color component from a #declared
color; one cannot even do things like vlength() and vdot() on them, and
that's frustrating. I got around using something like
val(str(Color.red),10,10), but I cannot really see why that should be
working. Placing Color.red in a statement like:

#declare MyGoodFriend = <Color.red, Color.green, Color.blue>

to make a space-vector generates an error, stating that Color.red is a color
vector, and that a float value was expected!

Comparing with the method for extracting x, y and z components from a normal
3-vector, the color component extraction method doesn't at all work as
expected.

To sum it up: Does the float-extraction feature contain a serious bug? Or
are the docs simply poorly written here and/or too brief?

regards,
Simen. (who hates to use val(str()) to accomplish extraction of color
components....)


Post a reply to this message

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