Realtime Shadows in the Wii Opera SDK
By geekrecon. Tuesday, 8. April 2008, 21:52:41

Realtime shadows are ready in the ThreeD::Shadow method. It reads the same lightsource position as ThreeD::Shade. For those wishing to implement the new method, be aware that it takes a lot of processing power with time exponentially increasing as the number of triangles in the scene increases (imagine raytracing one path for each triangle from each triangle). Thus, it's best to perform all backface culling before running this method. A quick demonstration can be found here. A painfully slow demonstration is here compared to its flat-shading cousin.
Here is an example of the simple syntax to add realtime shadows to a project:
... ThreeDee.SetLight(-1000, 0, 1000); ThreeDee.SetPoints(Cube1.concat(Cube2).concat(Cube3)); ThreeDee.Backface(); ThreeDee.Shade(); ThreeDee.Shadow(); Draw.drawScene(ThreeDee.GetTranslation(), 3); ...