pseudo3D-plane.js

total 0
used 0
limit 0
/* --- title: 3D Pseudo Rotation Plane 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/text/fps.js ../point_src/functions/clamp.js ../point_src/distances.js ../point_src/dragging.js ../point_src/rotate.js Rotate a plane in 3D */ class MainStage extends Stage { // canvas = document.getElementById('playspace'); canvas = 'playspace' mounted(){ this.center.radius = 50 this.rotSize = 0 this.projection = 300 this.perspective = true let radius = 7 let rowCount = 5 /* How many items per row within the grid */ let count = 50 const pointList = PointList.generate.random(count, [300,300], {x: 200, y:200}) pointList.forEach(p=>p.radius = 2 + random.int(15)) this.points = pointList this.dragging.add(...pointList) this.events.wake() } step() { this.rotSize += .1 let spin = {x:this.rotSize, y: this.rotSize, z: this.rotSize} // orthogonal let center = {x:350, y:350} let spunPoints if(this.perspective) { spunPoints = pseudo3DRotate(this.points, spin, center, false) spunPoints = pseudo3DRotatePerspective(spunPoints, center, this.projection) } else { spunPoints = pseudo3DRotate(this.points, spin, center, true) } this.spunPoints = spunPoints.map(p=>new Point(p)) } draw(ctx){ this.step() this.clear(ctx) this.spunPoints.pen.indicators(ctx, { color: 'gray', width: 1}) // this.points.pen.indicators(ctx, { color: 'gray', width: 1}) this.fps.drawFPS(ctx); } } stage = MainStage.go()
Run
Meta Data
title 3D Pseudo Rotation Plane
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/text/fps.js', '../point_src/functions/clamp.js', '../point_src/distances.js', '../point_src/dragging.js', '../point_src/rotate.js')
unused_keys ()
unknown_keys ('categories',)
categories ['pseudo3D']
filepath_exists True
path pseudo3D-plane.js
filepath pseudo3D-plane.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/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', '../point_src/rotate.js')
markdown {'html': '<p>Rotate a plane in 3D</p>', 'content': '---\ntitle: 3D Pseudo Rotation Plane\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/text/fps.js\n ../point_src/functions/clamp.js\n ../point_src/distances.js\n ../point_src/dragging.js\n ../point_src/rotate.js\n\nRotate a plane in 3D'}