lerp-point-custom-easing.js

total 0
used 0
limit 0
/* title: Lerp Mapping. categories: lerp files: head pointlist point stage stroke mouse dragging ../point_src/random.js ../point_src/easing.js ../point_src/iter/lerp.js ../theatre/apple-motion-algo.js --- An example of _pure lerp mapping_ without any polypoint Lerp tools. The `StaticLerpMap` hosts its own set of values for all points. The stepMotion function: ```js (t)=>stepMotion(t, .01, 0.5, .6, 8) ``` + **t**: time delta: 0-1 + anticipation: `.1` + midpoint: `.5` + oscilation: `.1` + damping: `.1` */ class MainStage extends Stage { canvas='playspace' mounted(){ let count = 30 this.point = new Point(200, 200) this.a = new Point(100, 100) this.b = new Point(500, 500) let commonVal = this.commonVal = new Value() commonVal.doneStop = true this.currentTime = 0 this.seconds = 1 commonVal.setEasing((t)=>stepMotion(t, .01, 0.5, .6, 8)) } onclick(e) { console.log(arguments) this.a = this.point.copy() this.b = Point.from(e) this.currentTime = 0 } draw(ctx) { this.clear(ctx) let spl = 1 / (60 * this.seconds) this.point.pen.fill(ctx, 'green') let p = this.point; let k = 'x' let a = this.a; let b = this.b; let l = this.currentTime += spl p.x = this.commonVal.pluck(a.x, b.x, l) p.y = this.commonVal.pluck(a.y, b.y, l) this.a.pen.fill(ctx, '#880000') } } ;stage = MainStage.go();
Run
Meta Data
title Lerp Mapping.
imports ()
files ('head', 'pointlist', 'point', 'stage', 'stroke', 'mouse', 'dragging', '../point_src/random.js', '../point_src/easing.js', '../point_src/iter/lerp.js', '../theatre/apple-motion-algo.js')
unused_keys ()
unknown_keys ('categories',)
categories ['lerp']
filepath_exists True
path lerp-point-custom-easing.js
filepath lerp-point-custom-easing.js
clean_files ('../point_src/core/head.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/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/setunset.js', '../point_src/stroke.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', '../point_src/easing.js', '../point_src/iter/lerp.js', '../theatre/apple-motion-algo.js')
markdown {'html': '<p>An example of <em>pure lerp mapping</em> without any polypoint Lerp tools.\nThe <code>StaticLerpMap</code> hosts its own set of values for all points.</p>\n<p>The stepMotion function:</p>\n<p><code>js\n(t)=&gt;stepMotion(t, .01, 0.5, .6, 8)</code></p>\n<ul>\n<li><strong>t</strong>: time delta: 0-1</li>\n<li>anticipation: <code>.1</code></li>\n<li>midpoint: <code>.5</code></li>\n<li>oscilation: <code>.1</code></li>\n<li>damping: <code>.1</code></li>\n</ul>', 'content': 'title: Lerp Mapping.\ncategories: lerp\nfiles:\n head\n pointlist\n point\n stage\n stroke\n mouse\n dragging\n ../point_src/random.js\n ../point_src/easing.js\n ../point_src/iter/lerp.js\n ../theatre/apple-motion-algo.js\n---\n\nAn example of _pure lerp mapping_ without any polypoint Lerp tools.\nThe `StaticLerpMap` hosts its own set of values for all points.\n\nThe stepMotion function:\n\n```js\n(t)=>stepMotion(t, .01, 0.5, .6, 8)\n```\n\n+ **t**: time delta: 0-1\n+ anticipation: `.1`\n+ midpoint: `.5`\n+ oscilation: `.1`\n+ damping: `.1`'}