converting rgb to ambient, diffuse, and emmisive color

Bernie Roehl ([email protected])
Thu, 14 Dec 1995 17:04:15 -0500


David Ashman writes:
> If all I have is the rgb values of the selected
> color, how can I get the ambient, diffuse, emissive and all the other color
> info I need to make it look right.

Your question is actually the inverse of what browser writers need to know;
they're taking the values from the Material node and mapping them to a single
color and a set of (single-value) coefficients for the ambient, diffuse and
specular reflectivity.

If you don't care about lighting, you can just set the emissiveColor to your
RGB value and everything else to zero.

If you do care about lighting, try setting the diffuseColor to your RGB
value and everything else to zero.

You generally want the specularColor to be some shade of white; that is, you
want all these components to be the same value, so that the specular
highlights take on the color of the light source.

-- 
   Bernie Roehl
   University of Waterloo Dept of Electrical and Computer Engineering
   Mail: [email protected]    Voice:  (519) 888-4567 x 2607 [work]
   URL: http://sunee.uwaterloo.ca/~broehl

  • Next message: Brian Behlendorf: "Re: Micro$oft part 2?!?"
  • Previous message: Claude L. Bullard: "RE: When Cultures Collide"