GLFlowers v0.04: Normals!
- Refactored leaf class into base ComplexCurveModel class
- Extended ComplexCurveModel for both leaves and petals
- added in proper normal calculation.
Shown here are petals (top two rows) and leaves (bottom two rows). In both cases, the backfaces are rendered with either green (leaves) or red(petals), and the front faces are rendered with the color that corresponds to the normal.
If you mouse over the canvas, you can rotate all the models by moving your mouse left and right. Mouse out to resume animation around the Y axis.
v0.03: Adding leaves to the stem, plus laying the groundwork for lighting.
v0.02: Big update to leaf geometry generation, with curvature along all three axes.
v0.01: Rough cut of the basic scene and model hierarchy.
- Scene: sets up a WebGL context.
- DynamicModel: base class for a "dynamic" model which in this case means a model with procedurally generated geometry. The random generation is based on a given seed value, so can be persistent if that's what you want
- Petal: A sub-class of DynamicModel that generates a leaf-shaped mesh and colors it from red to green away from the spine.
- Curves Implements Bezier curves, both quadratic and cubic (two cubic curves are the basis for the shape of each leaf)
- rand Implements a linear congruental random number generator with the ability to set a given seed