random-pointlist-speckle.js

total 0
used 0
limit 0
/* title: Motion Blur Class categories: blur files: head point pointlist stage mouse dragging ../point_src/random.js --- sigmoid function line + flat line + split() + sigmoid function + tip project + draw a line This can draw complex or simple waves. --- Intersect at the perpendicular for sampling the line. */ class MainStage extends Stage { // canvas = document.getElementById('playspace'); canvas = 'playspace' mounted(){ let count = 40 let multiplier = [300, 200, null, 0] let offset = [100, 100, 10, 0] this.points = PointList.generate.random(count, multiplier, offset) this.points.each.color = ()=>random.color([290, 310], [80,100], [22,30]) // this.dragging.add(p) this.tick = 0 } firstDraw(ctx) { ctx.lineCap = 'round' } randomMove(p=this.point, c=this.center, v=200){ if(this.tick % random.int(10, 300) == 0) { p.x = c.x + random.int(-v, v) p.y = c.y + random.int(-v, v) p.radius = random.int(.5, 7) } } draw(ctx){ this.tick++; this.clear(ctx) this.points.forEach(p=>{ this.randomMove(p, this.center, 400) }) this.points.pen.fill(ctx) } } stage = MainStage.go(/*{ loop: true }*/)
Run
Meta Data
title Motion Blur Class
imports ()
files ('head', 'point', 'pointlist', 'stage', 'mouse', 'dragging', '../point_src/random.js')
unused_keys ()
unknown_keys ('categories',)
categories ['blur']
filepath_exists True
path random-pointlist-speckle.js
filepath random-pointlist-speckle.js
clean_files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/compass.js', '../point_src/center.js', '../point_src/point-content.js', '../point_src/pointdraw.js', '../point_src/relative-xy.js', '../point_src/pointcast.js', '../point_src/point.js', '../point_src/pointlistdraw.js', '../point_src/pointlistgradient.js', '../point_src/pointlistshape.js', '../point_src/pointlistgenerator.js', '../point_src/unpack.js', '../point_src/pointlist.js', '../point_src/pointlistpen.js', '../point_src/stage-hooks.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/functions/clamp.js', '../point_src/distances.js', '../point_src/protractor.js', '../point_src/text/beta.js', '../point_src/dragging.js', '../point_src/random.js')
markdown {'html': '<p>sigmoid function line</p>\n<ul>\n<li>flat line</li>\n<li>split()</li>\n<li>sigmoid function</li>\n<li>tip project</li>\n<li>draw a line</li>\n</ul>\n<p>This can draw complex or simple waves.</p>\n<hr />\n<p>Intersect at the perpendicular for sampling the line.</p>', 'content': 'title: Motion Blur Class\ncategories: blur\nfiles:\n head\n point\n pointlist\n stage\n mouse\n dragging\n ../point_src/random.js\n---\n\nsigmoid function line\n\n+ flat line\n+ split()\n+ sigmoid function\n+ tip project\n+ draw a line\n\nThis can draw complex or simple waves.\n\n---\n\nIntersect at the perpendicular for sampling the line.'}