About me

Vladimir Nabokov

Books
Programming
Biochemistry
Aim | Communicate

Search
 


 

 

     
 
 

     
SVGA geometrical pattern generator - a test of speed. Click here to download
 
 
     

Rapid SVGA pattern drawer

Another of my early applications of the SVGA graphics engine was the construction of this simple pattern generator. In the very earlist days of my programming attempts, I put together a simple random pattern drawing algolrithm in LOGO, which was so slow that the the individual lines could be seen to be drawn. This program is essentially the logical extention of that original program: a very similar algorithm is employed, with strait lines joined by fixed angles. Slight elaboration is introduced by the fact that all the variables in this version are varied very gently according to Sin/Cos oscillations, making the patterns drift about the screen as they're drawn. Although the program itself is amazingly simple, barely more than a few lines of effective code, the patterns are generated at such a rate that they have but a fleeting existence, and are covered by further lines of developing pattern. After much deliberation, I descided to use a auroral gray for the patterns: I just think there's something a little more elegant when drawn in this way, the patterns delicately grading into the background and each other. Most impressive in this demo is the pure speed of the line drawing routine in the graphics library: the optimised assembler code allows the patterns to be drawn almost imperceptibly fast. There is, I believe, even code inserted to slow the drawing algorithm down so the construction of the patterns can be appreciated. The demo is certainly fascinating to watch, and produces aethetically pleasing and almost hypnotic results. Available for download with full source.

Download the 'Patterns' demo (33 Kb, zipped) | Back to Graphical trinkets

 
 
Letters from Terra | Updated 15th December 2004 | By Jonathan Ayling