Choosing the right platform, tool or engine is essential for the success of your project. Right now I’m working on a 3D game, so naturally I thought of using Papervision3D because I’m familiar with it. Our game however, relies heavily on collision detection and fast rendering, and both are done better by the Alternativa3D engine. The only thing that is missing is any form of lighting the 3D objects dynamically.
We need to dynamically add shadows on our models because baking textures by using 3D studio max is not an option, but the Alternativa platform does not support it (yet). So I had to add it myself. The only problem is that the engine is not open source. I asked if I could get it, but they didn’t give it to me. So I had to decompile the engine first, which presented problem number two: decompiled source code contains lots of errors.
It took me 1 day to fix the source code, and then another day of optimizing the code for Flash player 10. After that was done, adding the flat shading was done in less then an hour. I added flat shading for TextureMaterial and MovieClipMaterial, which are lighted only the first time their surfaces are created. But the FillMaterial has dynamic lighting (only ambient).
Check out the demo here. Click the color pallet to change the color of the light and see how it affects the color of the surfaces of the spheres.