in C++
Site Map Feedback
Fractal Fern Leaf
Up Bitmap Colour Interpolation Mapping OpenGL Vector

Understanding computer graphics can be quite a journey. There are many resources, books and web-sites covering all aspects, but they're frequently outdated, supported by dubious or missing code and filled with maths that explain how things work, rather than how to make the lumps work. A lot of the concepts seem complex, but if you learn the right things in the right order, life can be so much easier!

A lot of the effort in developing computer graphics goes into optimisation and dealing with multiple platforms: this site is not about those issues. The code is optimised algorithmically, but needs to be valid in the future, so it is not going to be optimised for current computers or graphics cards - optimise those once you've got the code working! The exceptions are put in Global.h which is a tiny, top-level file with short Assembly Language versions of methods that cast from double to int: Floor, Truncate, Round, Mod, as well as Frac, sin and sincos (both at once).

The first graphics code used integer maths for speed because floating point processors hadn't been invented or were still far slower. All that code is now dead. Most graphics code on the Web uses float variables. floats are annoying: Writing 1 as 1.0f makes messy code! The Coding Style page explains the shape of code here, once you've downloaded it, changing it to your company's coding style shouldn't be a problem. Code here uses double throughout for holding coordinates and manipulating colors, it makes little difference now (will make less difference in the future) and keeps the code here consistent. doubles are not without their issues, though: the page [gCoord] The Trouble with double explains the use of toleranced comparisons. Quantized Serialization (saving the doubles as integers) is discussed at the bottom of the Mapping page.

Where to start

Coloured Procedural Brick Wall Stages

 (2558) Last modified: Tue, 15 Dec 2009 13:52:19 +0000