XYZ coordinates to RGB convertion

Started by
3 comments, last by Knathrak 16 years, 2 months ago
HI Guys, is there any code which actually takes the coordinates of XYZ and then converts into RGB which can be used as the input for writing the TGA file? I am looking at the C code for converting the XYZ coordinates to RGB
Advertisement
I think you'll need to give some more information about what you're trying to achieve here. What do these 3D coordinates represent? How should they be saved to an image file? For what purpose?
Create-ivity - a game development blog Mouseover for more information.
Sorry, what does this even mean? (x, y, z) is, normally, a position in space. (r, g, b) is, normally, a colour. Those are completely unrelated things.
Just a wild guess... is this about storing normal vectors for bump mapping?
Maybe you're talking about the XYZ colorspace ?

If that's the case try googling CIEXYZ
There is a standard matrix formula to convert CIEXYZ to sRGB.
You can get it here : http://en.wikipedia.org/wiki/SRGB

This topic is closed to new replies.

Advertisement