StateZero . net
Code Sketches
Convex Hull Sketch
10/14/2009
(requires Java)
- Left-click and drag to move a particle around manually.
- Use sliders to control the bounding box and number of particles.
Auto-Grouping Sketch (with convex hulls)
10/13/2009
(requires Java)
- Left-click and drag to move a particle around manually.
- Use sliders to control the bounding box and number of particles.
- Use the 'group' slider to control the number of groups used.
- For extra fun, pause the simulation and then drag a particle around and watch it change groups.
Collision Subdivision Sketch (with groups)
10/14/2009
(requires Java)
- Now we have groups of triangles instead of groups of points.
- Collision line (white line with yellow endpoints) finds all colliding triangles (shown in red).
- Basic Controls same as above (Auto-Grouping Sketch)
- Groups are used to optimize collision speed (watch timing numbers in upper right)
- Toggle the 'Optimize' button to see brute-force vs. group culling optimization.
- Drag the yellow boxes (collision line endpoints) around with the mouse.
- For a given number of entities, there is a sweet spot number of groups to optimize performance (watch timing numbers in upper right).
- Watching timing numbers is more stable if you pause the simulation (The Sim:True/False Button).
- Known Bug: Collisions are not detected when both endpoints inside a group or triangle.
Circle Packing Sketch
10/29/2009
(requires Java)
- A set of circles on a plane auto-arrange until they no longer overlap.
- Basic Controls same as above
- Use the 'Circle Size' slider to adjust circle sizes
- If the circles are too dense (too big/too many) they will always overlap
- Once the circles stabilize, try dragging one circle around to perturb the others
- Try dragging a circle and using it to 'dig' holes in the rest of the circles
Spectral Embedding Sketch
11/28/2009
(requires Java)
- Uses Spectral Embedding to do some basic graph layouts. Graphs with nice triangles such as "Open Fan" and "Closed Fan" work pretty well. Others like Power-Law and Star which are generally acyclic graphically collapse into lines. In a nutshell, what this is doing is taking a matrix representation of the graph (a Laplace Matrix), finding the 2 eigenvectors with the smallest positive eigenvalues, and using the product of those 2 eigenvectors with the Laplace matrix as the x and y coordinates of the graph nodes. You can extend this into any number of dimensions, hopefully I can pop a 3d version up here ASAP.
- Things to try:
- Simply try changing the 'Entities' value. The "Fan" network types exhibit a sort of axis flipping behavior sometimes that I am still trying to figure out.
- Try the "Power Law" network type. By default "Generic Count" == 1 generates acyclic trees. Higher "Generic Count" leads to more cycles.
- Similarly for "Random", although "Random" can always generate cycles
- Note: "Generic Count" has no meaning for "*Fan" and "Star" network types
- Basic Controls same as above