pseudo3D-plane-2.js

total 0
used 0
limit 0
/* --- title: pseudo3D Very Perspective categories: pseudo3D files: ../point_src/math.js ../point_src/core/head.js ../point_src/pointpen.js ../point_src/pointdraw.js ../point_src/point-content.js ../point_src/pointlistpen.js ../point_src/pointlist.js ../point_src/point.js ../point_src/events.js ../point_src/automouse.js ../point_src/stage.js ../point_src/extras.js ../point_src/random.js ../point_src/setunset.js ../point_src/stroke.js ../point_src/stage-clock.js ../point_src/text/alpha.js ../point_src/rotate.js ../point_src/text/fps.js ../point_src/functions/clamp.js ../point_src/distances.js ../point_src/dragging.js Rotate a plane in 3D */ class MainStage extends Stage { // canvas = document.getElementById('playspace'); canvas = 'playspace' mounted(){ this.rotSize = 0 let padding = 40 let center = this.center.copy() const pointList = PointList.generate.grid(100, 10, padding) this.offsetPoints(pointList, padding, center) this.points = pointList this.centerPoint = new Point(center) this.dragging.add(this.centerPoint, this.points) this.events.wake() } offsetPoints(pointList, padding, center) { let size = pointList.getSize() let p2 = (new Point({x:padding+size.width, y: padding+size.height})).multiply(.5) let oc = (new Point(center)).subtract(p2) pointList.offset(oc) } step() { this.rotSize += .6 let spin = this.spin = { x: 0 , y:this.rotSize , z: 0 } // this.spunPoints = this.points.pseudo3d.orthogonal(this.spin) this.spunPoints = this.points.pseudo3d.perspective(this.spin) } draw(ctx){ this.step() this.clear(ctx) this.spunPoints.pen.indicators(ctx, { color: 'gray', width: 1}) this.centerPoint.pen.indicator(ctx, { color: 'red', width: 1}) this.fps.drawFPS(ctx); } } stage = MainStage.go()
Run
Meta Data
title pseudo3D Very Perspective
imports ()
files ('../point_src/math.js', '../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/point-content.js', '../point_src/pointlistpen.js', '../point_src/pointlist.js', '../point_src/point.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/stage.js', '../point_src/extras.js', '../point_src/random.js', '../point_src/setunset.js', '../point_src/stroke.js', '../point_src/stage-clock.js', '../point_src/text/alpha.js', '../point_src/rotate.js', '../point_src/text/fps.js', '../point_src/functions/clamp.js', '../point_src/distances.js', '../point_src/dragging.js')
unused_keys ()
unknown_keys ('categories',)
categories ['pseudo3D']
filepath_exists True
path pseudo3D-plane-2.js
filepath pseudo3D-plane-2.js
clean_files ('../point_src/math.js', '../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/compass.js', '../point_src/center.js', '../point_src/point-content.js', '../point_src/pointlistpen.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/relative-xy.js', '../point_src/pointcast.js', '../point_src/point.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/extras.js', '../point_src/random.js', '../point_src/setunset.js', '../point_src/stroke.js', '../point_src/stage-clock.js', '../point_src/text/alpha.js', '../point_src/rotate.js', '../point_src/smooth-number.js', '../point_src/text/fps.js', '../point_src/functions/clamp.js', '../point_src/distances.js', '../point_src/protractor.js', '../point_src/text/beta.js', '../point_src/dragging.js')
markdown {'html': '<p>Rotate a plane in 3D</p>', 'content': '---\ntitle: pseudo3D Very Perspective\ncategories: pseudo3D\nfiles:\n ../point_src/math.js\n ../point_src/core/head.js\n ../point_src/pointpen.js\n ../point_src/pointdraw.js\n ../point_src/point-content.js\n ../point_src/pointlistpen.js\n ../point_src/pointlist.js\n ../point_src/point.js\n ../point_src/events.js\n ../point_src/automouse.js\n ../point_src/stage.js\n ../point_src/extras.js\n ../point_src/random.js\n ../point_src/setunset.js\n ../point_src/stroke.js\n ../point_src/stage-clock.js\n ../point_src/text/alpha.js\n ../point_src/rotate.js\n ../point_src/text/fps.js\n ../point_src/functions/clamp.js\n ../point_src/distances.js\n ../point_src/dragging.js\n\nRotate a plane in 3D'}