November 17, 2014 in category Jams and tags webgl
By Robert Utter
Following up from my first WebGL project, I've built a nice little village scene to practice more graphics programming. This one includes perspective projection, texturing, and some vertex lighting.
The game includes a day-night cycle to demonstrate the diffuse and ambient lighting changes. You can also walk around the scene or control the town's central windmill.
Inspired by my work in Unity, I decided that building model matrices would be easier with hierarchical transform objects handling vector scaling, rotation, and translation. I have noticed a bug when applying some rotations, but avoiding it is pretty easy and the fix incurs a bigger performance penalty than I would like.
As far as the blocky models, this is a class assignment with one unusual constraint: all geometry in the scene must be built from a single cube mesh.