Some experiments on the manipulation of curves.
A particle is attached to the mouse, which create a fixed-length trail, which is smoothed using a Bezier spline. Small segments of it are drawn again in a different color.
A second curve is also created rotating around the Bezier curve, and only a moving section is drawn, using a color gradient.
A 2d textured Bezier patch which control points are moving autonomously, and its opacity depending on the distance of neighbor points. Rendered in real time using OpenGL, with Buffer Objects for speedup.
SPACE : new random control polygon
0-9 : change colors
+/- : increase/decrease subdivision
p : pause movement
o : toggle opacity computation
t : toggle texture
g : toggle drawing of the quads
NOTE : some versions of the JRE can have problems loading JOGL applets like this one. (Actually, I cannot load it on any of my PCs, windows nor linux).
The map generation is a conversion from ActionScript of this project : https://github.com/amitp/mapgen2 (by Amit Patel, under the MIT License)
The rendering uses a work-in-progress library of mine for parametric drawing.
SPACE - start the generation of another map
ENTER - restart the generation, but stop after the first step ; press again for each successive creation step.
S - smooth colors and biomes across the polygons
N - add noise in the polygon edges
E - show elevation
M - show moisture
B - show map (default)
R - switch between simple or custom render
Another particle simulation !
New : use the mouse (see below) to draw your own obstacles.
I use a grid to speed up the search for neighbors, and precompute a sort of distance field for the collisions with the shapes.
'0' to '9' to choose a predefined shape
space bar to reset the particles
backspace to toggle the bottom border
mouse click to activate the mouse repulsion
shift + mouse click to draw
control + mouse click to erase
An experiment in artificial intelligence and path planning : 3 spaceships competing in a small race.
You can navigate the blue ship with the arrow keys, 'r' to reset its position, 's' to make it stop and 'd' to resume the AI.