VRML! and a python switch statement

a switch statement

One of the great things about person projects is the time I have for diversions. Until today I had 2 different render methods, both of which made different views of Orion. Today I added a third and I wanted a switch to chose between them. Of course python doesn't have a switch, but a lookup table works just fine.

    build = 'vrml'

    displays = {
        'starfield': chart_with_starfield,
        'pictograph': chart_pictogram,
        'vrml': build_vrml_model
    displays[build](abr, orion_points, orion_lines)

Walking home I remembered that a lookup table was the first optimization I was ever paid to make. Somewhere deep in an AS/400 system compiler I created a table to speed up some posix compatibility issue.


More importantly, we've gotten the 3rd D!

Select stars of Orion being rotated around itself

This is just a first run, to see it all come together. I'm not sure what I'm going to do with this, but I have some ideas. It's cool that two of the star of Orion's belt are pretty close to each other (and the middle is far far away...).

If you were curious, here are the "named" stars in Orion and their distance from Earth in light years.

Rigel       862.963  
Bellatrix   252.476  
Mintaka     692.568  
Hatsya     2329.999  
Alnilam    1976.969  
Alnitak     736.343  
Saiph       647.222  
Betelgeuse  498.015