I added a few methods to three-orbit-controls to be able to manually define phi or theta and be able to rotate to a given point.
// rotation in Y
controls.setAzimuthalAngle(theta);
// rotation in X
controls.setPolarAngle(phi);
| My Dotfiles | |
| See README.md for instructions |
| import THREE from 'three'; | |
| export default class MeshLine { | |
| constructor() { | |
| this.attributes = {}; | |
| this.positions = []; | |
| this.geometry = new THREE.BufferGeometry(); | |
| this.widthCallback = null; | |
| } |
I added a few methods to three-orbit-controls to be able to manually define phi or theta and be able to rotate to a given point.
// rotation in Y
controls.setAzimuthalAngle(theta);
// rotation in X
controls.setPolarAngle(phi);
| var Color = require('color'); | |
| var c = Color('#123456'); | |
| console.log(c.saturationv(), c.hexString()); | |
| // -> 79 #123456 | |
| c.saturationv(79); | |
| console.log(c.saturationv(), c.hexString()); | |
| // -> 79 #123457 |
| // FIT INTO SCREEN | |
| // Your image or content size | |
| var contentWidth = 1024; | |
| var contentHeight= 768; | |
| // The resize function, to be impletemented however you need it | |
| function resize(){ | |
| var w, h, ws, hs, rs, rc, r; |