• Advertisement
Sign in to follow this  

XYZ coordinates to RGB convertion

This topic is 3643 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Just a wild guess... is this about storing normal vectors for bump mapping?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement