spin-plotter-2.js

total 0
used 0
limit 0
/* title: Plotter files: head point stage dragging pointlist mouse stroke fps ../point_src/functions/signedNorm.js ../theatre/objects/vectorpoint.js ../theatre/objects/spinplotter.js ../point_src/screenwrap.js ../point_src/velocity.js --- Plotting captures the XY RAD ROT of a point upon request, and stashes it in a pointlist. This is useful for timestep captures such as spline walks. */ /* title: Simple Starfield categories: minimal starfield files: head point pointlist stroke stage mouse dragging ../point_src/random.js ../point_src/screenwrap.js ../point_src/velocity.js --- A simple starfield, with recycled points and general _direction_ and _speed_. */ class StarsStage extends Stage { canvas = 'playspace' mounted() { let pin = new Point(0, 0, 1, 0) let pin2 = new Point(0, 0, .1, 0) this.points = PointList.generate.random(50, [1200, 800], pin) this.pins = PointList.generate.random(20, [1200, 800], pin2) this.reactor = new VelocityReactor() this.reactor.points = this.points // the direction of travel, applied to each points velocity. let direction = new Point(-3, 0) // this.reactor.randomize() this.points.forEach(p=>{ // circle plot area // p.xy = random.within(pin, 600) p.velocity.set(direction.multiply(p.radius * -.05)) let light = 30 * (p.radius * .25) p.color = `hsl(0, 40%, ${light}%)` p.radius *= 3 // turn to direction of travel faceVelocity(p) }) } draw(ctx){ this.clear(ctx) this.reactor.step() this.points.forEach(p=>this.screenWrap.perform(p)) // this.pins.pen.fill(ctx, '#666') this.points.pen.lines(ctx) // this.points.pen.indicator(ctx) // this.points.pen.fill(ctx, 'green') } } class MainStage extends Stage { // canvas = document.getElementById('playspace'); canvas = 'playspace' mounted(){ let slideSpeed = [2,0]; this.spinPlotter3 = new SpinPlotter({ x: this.center.x , y: this.center.y , radius: 100 , maxPlotCount: 150 , slideSpeed , plotModulo: 4 , spinSpeed: -2 , direction: 'both' // , direction: 'sin' , plotColor: '#77AA33' }) this.dragging.add(this.spinPlotter3) } draw(ctx){ this.fps.print(ctx) this.spinPlotter3.render(ctx) } } stage = StarsStage.go(/*{ loop: true }*/) stage2 = MainStage.go()
Run
Meta Data
title Plotter
imports ()
files ('head', 'point', 'stage', 'dragging', 'pointlist', 'mouse', 'stroke', 'fps', '../point_src/functions/signedNorm.js', '../theatre/objects/vectorpoint.js', '../theatre/objects/spinplotter.js', '../point_src/screenwrap.js', '../point_src/velocity.js')
unused_keys ()
unknown_keys ()
filepath_exists True
path spin-plotter-2.js
filepath spin-plotter-2.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/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.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/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/events.js', '../point_src/automouse.js', '../point_src/setunset.js', '../point_src/stroke.js', '../point_src/stage-clock.js', '../point_src/text/alpha.js', '../point_src/smooth-number.js', '../point_src/text/fps.js', '../point_src/functions/signedNorm.js', '../point_src/../point_src/random.js', '../point_src/../point_src/./windings.js', '../point_src/../point_src/tethers.js', '../theatre/objects/vectorpoint.js', '../theatre/objects/spinplotter.js', '../point_src/screenwrap.js', '../point_src/velocity.js')
markdown {'html': '<p>Plotting captures the XY RAD ROT of a point upon request, and stashes it in a\npointlist. This is useful for timestep captures such as spline walks.</p>', 'content': 'title: Plotter\nfiles:\n head\n point\n stage\n dragging\n pointlist\n mouse\n stroke\n fps\n ../point_src/functions/signedNorm.js\n ../theatre/objects/vectorpoint.js\n ../theatre/objects/spinplotter.js\n ../point_src/screenwrap.js\n ../point_src/velocity.js\n---\n\nPlotting captures the XY RAD ROT of a point upon request, and stashes it in a\npointlist. This is useful for timestep captures such as spline walks.'}