Skip to content

Commit

Permalink
Add more wormy sketches
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimmons committed Jan 18, 2019
1 parent 60f6d12 commit e279233
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sketches/sketch017.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const {makeSketch} = require('./util');

makeSketch({x: 256, y: 256, z: 256}, {padFrac: 0}, (scene, ops) => {
for (let i = 0; i < 512; i++) {
ops.worm(scene, {x: Math.floor(256*Math.random()), y: Math.floor(256*Math.random()), z: (Math.random() < 0.5) ? 0 : 255}, 1+Math.floor(3*Math.random()), 2+Math.floor(2*Math.random()));
}
});
19 changes: 19 additions & 0 deletions sketches/sketch018.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const {makeSketch} = require('./util');

makeSketch({x: 64, y: 64, z: 128}, {padFrac: 0.1}, (scene, ops) => {
for (let i = 0; i < 200; i++) {
ops.randomShell(scene, 1);
}

ops.predicateFill(scene, 0, (x, y, z) => ((x % 16) < 4));
ops.predicateFill(scene, 0, (x, y, z) => ((y % 32) < 4));
ops.predicateFill(scene, 0, (x, y, z) => ((z % 16) < 4));

ops.frontCutaway(scene, 0.67);

for (let i = 0; i < 512; i++) {
ops.worm(scene, {x: Math.floor(64*Math.random()), y: Math.floor(64*Math.random()), z: 0}, 1+Math.floor(3*Math.random()), 2+Math.floor(2*Math.random()));
// ops.worm(scene, {x: 56, y: 56, z: 0}, 1+Math.floor(3*Math.random()), 2+Math.floor(2*Math.random()));
}

});

0 comments on commit e279233

Please sign in to comment.