Wavelength to RGB

Started by
8 comments, last by DeltaVee 22 years, 6 months ago
Does anyone here know how to convert a visible spectrum wavelength to a corresponding RGB value? I know that 700nm is red(ish) in color but I would like to have an RGB value. FYI. I have a catalog of over 110000 stars, and I am trying to create a realistic sky dome texture. Thanks in advance D.V.
D.V.Carpe Diem
Advertisement
Well, remember that the wavelength will only tell you the hue, not the intensity or saturation unless I''m horribly mistaken. In which case, I would investigate the HSB to RGB algorithms and check out how the Hue component affects the RGB colour. I''m sure HSB->RGB help will be more readily available. Although I''m not sure whether the Hue scale corresponds to the wavelength of a colour, in which case, I''m sorry

Trying is the first step towards failure.
Trying is the first step towards failure.
I''m certain that the set of wavelengths do correlate to the HSB - and equally certain it''s not a linear mapping and a far cry from 1-to-1.

I think it''d require a table of experimentally and qualitatively determined values. Or you can look at a wavelength color chart and make some @$#$ up. Stars are so small to the eye that you can just set the brightness high and give them a little bit of a hue and call it good enough. Or is this an astronomy project?



Magmai Kai Holmlor
- Not For Rent
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Here''s a clever link for you! (There''s C code!)

http://www.fourmilab.ch/documents/specrend/

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
GDNet never ceases to amaze me.

Thanks. This is exactly the information I was looking for. I *was* looking for some ballpark estimate, but you guys came up trumps!

Thanks again.



D.V.
D.V.Carpe Diem
Speaking of sky/space textures, are you aware of the SGI digital galaxy at the new Hayden planetarium? I''ve seen the software running at the SIGGRAPH conference in 2000. Just amazing to see this in real-time 3D.

http://www.sgi.com/features/2000/jan/haydn/
http://www.sgi.com/features/2000/jan/haydn/images/lg_galaxy.jpg
http://www.sgi.com/features/2000/jan/haydn/images/lg_mars.jpg
http://www.amnh.org/rose/digitaldome.html

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Never been but I would like to go one day. I''ll wait until my son is old enough.

BTW check this out:
http://space.jpl.nasa.gov/

The accuracy is astounding, they have a couple of generated images based on the time and location of real images taken from voyager, and they are nearly identical.



D.V.
D.V.Carpe Diem
Whoa. That''s cool.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Since when does Mars have rings?
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
I think that is saturn.

try this:

http://mars.jpl.nasa.gov/mgs/realtime/mgsrt.html




D.V.
D.V.Carpe Diem

This topic is closed to new replies.

Advertisement