scene.org File Archive

File download

<root>­/­demos­/­artists­/­adok/gpgl2.zip

File size:
10 922 bytes (10.67K)
File date:
2026-03-04 17:29:01
Download count:
all-time: 0

Preview

  • GPgl.exe 11.00K
  • main.cpp 8.54K
  • readme.txt 1.31K
  • window.cpp 3.05K
  • window.h 532B

file_id.diz

GPgl (Genetic Programming with OpenGL)
by Claus-Dieter Volko (Adok/Hugi)
Version 2 (2012-07-20)

This program is supposed to demonstrate how images could be generated by functions with a tree-like syntax. These functions evolve by means of genetic programming, a metaheurstic technique originally invented by John Koza. The user can control the evolution using the keys 1, 2, 3. Key 1 modifies the list of functions. Key 2 modifies the currently selected function. The more often key 2 is pressed, the more the function is altered. Key 3 selects two random functions and modifies them. The program internally uses 10 variables, among them 2 for the pixel coordinates, 3 for the colors (red, green, blue), 2 for the current time and 3 free variables. For each variable the current value is computed by a function. The function can contain standard arithmetic operations (plus, minus, multiply, divide), boolean operations (and, or, xor), sinus, cosinus, modulo, minimum, maximum, comparison operators (greater, lower), conditional operators (if-then-else), and can work with constants and other variables. The images generated have a resolution of 256x256 pixels. Source code is provided.

Changes since the previous version:
- 2 variables used for storing the timer
- new operators: modulo, minimum, maximum, comparison, conditional