Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

does llSetColor expect floats 0.0 to 1.0?

paulie Femto
Into the dark
Join date: 13 Sep 2003
Posts: 1,098
05-09-2005 16:04
I'm trying to use llSetColor to change a prim's color. llSetColor seems to work with values 0.0 to 1.0. If I use values larger than 1.0, llSetColor seems to ignore the values.


Asking another way, I know llSetcolor expects a <vector> of 3 floats. Must the floats' values be in the 0.0 to 1.0 range?

If so, why? RGB values are traditionally integers 1-255.

Thanks!
_____________________
REUTERS on SL: "Thirty-five thousand people wearing their psyches on the outside and all the attendant unfettered freakishness that brings."
Ace Cassidy
Resident Bohemian
Join date: 5 Apr 2004
Posts: 1,228
05-09-2005 16:11
1.0 is equivalent to 255
0.5 is equivalent to 127
etc.

Its just a different scale, but accomplishes the same thing.

- Ace
_____________________
"Free your mind, and your ass will follow" - George Clinton
Malachi Petunia
Gentle Miscreant
Join date: 21 Sep 2003
Posts: 3,414
05-09-2005 16:59
And the OpenGL libraries at the core of the SL client were designed without the assumption of 24-bit color so the floats allow for a wider gamut of color. I don't know if SL is set up to use a larger colorspace, but that at least makes it more sensible. Also, using floats is somewhat more intuitive for some purposes - for example if I want 18% grey I can just write <0.82, 0.82, 0.82> and have no idea what that'd be in web-notation.