Lighting works:
The problem was that the python image library needed integers for the color value. Now it's using opengl (just to draw points), where there is a color function that takes r,b,g float parameters.
It's starting to look nice! =) And adding reflections is going to be pretty trivial..
===Edit:
I forgot to mention that I managed to make it quite faster by removing a lot of calls to the Python C API. (i.e. defining C structures and using them instead of python tuples)
Now it is running at 1.08 the speed of the original C module. That means that I traded 8% performance for making the code less than half the size and much more easier to maintain... decent trade-off
No comments:
Post a Comment