diff options
author | Brian Picciano <mediocregopher@gmail.com> | 2018-11-12 15:29:37 -0500 |
---|---|---|
committer | Brian Picciano <mediocregopher@gmail.com> | 2018-11-12 15:29:55 -0500 |
commit | 4598d7092b2bdc23a8976ac26e91d9072513820b (patch) | |
tree | 588ebed5f5ba87ad6f21863866e303b18a5f19b5 /_posts | |
parent | c81ed0c05e5b14fc6e247da53b93068e54d0a526 (diff) |
add viz 1 post
Diffstat (limited to '_posts')
-rw-r--r-- | _posts/2018-11-12-viz-1.md | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/_posts/2018-11-12-viz-1.md b/_posts/2018-11-12-viz-1.md new file mode 100644 index 0000000..b04b737 --- /dev/null +++ b/_posts/2018-11-12-viz-1.md @@ -0,0 +1,51 @@ +--- +title: >- + Visualization 1 +description: >- + Using clojurescript and quil to generate interesting visuals +series: viz +git_repo: https://github.com/mediocregopher/viz.git +git_commit: cb3d9d871d72b4f4487d175e73f0c30041963c42 +--- + +First I want to appologize if you've seen this already, I originally had this up +on my normal website, but I've decided to instead consolidate all my work to my +blog. + +This is the first of a series of visualization posts I intend to work on, each +building from the previous one. + +<!--<script src="/assets/viz/1/js/main.js"></script>--> +<script src="/assets/viz/1/goog/base.js"></script> +<script src="/assets/viz/1/cljs_deps.js"></script> +<script>goog.require("viz.core");</script> +<p align="center"><canvas style="width:100%;" id="viz"></canvas></p> + +This visualization follows a few simple rules: + +* Any point can only be occupied by a single node. A point may be alive (filled) + or dead (empty). + +* Every tick each live point picks from 0 to N new points to spawn, where N is + the number of empty adjacent points to it. If it picks 0, it becomes dead. + +* Each line indicates the parent of a point. Lines have an arbitrary lifetime of + a few ticks. When a dead point's line is cleaned up so is it. + +The resulting behavior is somewhere between [Conway's Game of +Life](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life) and white noise. +Though each point operates independently, they tend to move together in groups. +When two groups collide head on they tend to cancel each other out, killing most +of both. When they meet while both heading in a common direction they tend to +peacefully merge towards that direction. + +Sometimes their world becomes so cluttered there's hardly room to move. +Sometimes a major coincidence of events leads to multiple groups canceling each +other at once, opening up the world and allowing for an explosion of new growth. + +Some groups spiral about a single point, sustaining themselves and defending +from outside groups in the same movement. This doesn't last for very long. + +The performance of this visualization is not very optimized, and will probably +eat up your CPU like nothing else. Most of the slowness comes from drawing the +lines; since there's so many individual small ones it's quite cumbersome to do. |