Initial commit
This commit is contained in:
21
node_modules/three-orbitcontrols/LICENSE
generated
vendored
Normal file
21
node_modules/three-orbitcontrols/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License
|
||||
|
||||
Copyright © 2010-2018 three.js authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
1182
node_modules/three-orbitcontrols/OrbitControls.js
generated
vendored
Normal file
1182
node_modules/three-orbitcontrols/OrbitControls.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
84
node_modules/three-orbitcontrols/README.md
generated
vendored
Normal file
84
node_modules/three-orbitcontrols/README.md
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
**DEPRECATED**
|
||||
|
||||
[three-js] exposes real modules now via three/examples/jsm/...
|
||||
For example to import the Orbit, do
|
||||
|
||||
```js
|
||||
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls"
|
||||
```
|
||||
|
||||
# three-orbitcontrols
|
||||
|
||||
> is the [three.js] OrbitControls from official repo examples
|
||||
|
||||
## Installation
|
||||
|
||||
To install with npm do
|
||||
|
||||
```bash
|
||||
npm install three
|
||||
npm install three-orbitcontrols
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
All credit goes to [OrbitControls.js][original_orbitcontrols] contributors.
|
||||
See also [official OrbitControls documentation][orbitcontrols_documentation].
|
||||
|
||||
I have just **stolen** the code and modified to export it as a module so you can do something like
|
||||
|
||||
```javascript
|
||||
const THREE = require('three')
|
||||
const OrbitControls = require('three-orbitcontrols')
|
||||
// ES6 also works, i.e.
|
||||
// import OrbitControls from 'three-orbitcontrols'
|
||||
|
||||
// Init THREE scene (add your code)
|
||||
|
||||
const camera = new THREE.PerspectiveCamera(75, width / height, 0.1, 1000)
|
||||
camera.position.z = 5
|
||||
|
||||
const renderer = new THREE.WebGLRenderer({ canvas })
|
||||
|
||||
const controls = new OrbitControls(camera, renderer.domElement)
|
||||
controls.enableDamping = true
|
||||
controls.dampingFactor = 0.25
|
||||
controls.enableZoom = false
|
||||
```
|
||||
|
||||
Please note that:
|
||||
|
||||
1. You call `OrbitControls` directly instead of `THREE.OrbitControls`.
|
||||
2. This package does not depend directly on [three.js], which is declared as a peer dependency.
|
||||
|
||||
See also examples:
|
||||
|
||||
- [CommonJS example](https://github.com/fibo/three-orbitcontrols/tree/master/example.js): clone this repo, install deps and launch `npm run example_commonjs`.
|
||||
- [TypeScript example](https://github.com/fibo/three-orbitcontrols/tree/master/example.ts): clone this repo, install deps and launch `npm run example_typescript`.
|
||||
|
||||
## Changelog
|
||||
|
||||
See [OrbiControls.js history here](https://github.com/mrdoob/three.js/commits/master/examples/js/controls/OrbitControls.js).
|
||||
|
||||
Please also note that this repo's minor version equals [three.js] release number.
|
||||
|
||||
## Motivation
|
||||
|
||||
There is another package similar to this one: [three-orbit-controls].
|
||||
I decided to create another package with a different approach, see [this issue for the rationale](https://github.com/mattdesl/three-orbit-controls/issues/17).
|
||||
|
||||
I am using this package for my [3d tic tac toe canvas](https://github.com/fibo/tris3d-canvas): see also online [demo](http://g14n.info/tris3d-canvas/example/).
|
||||
|
||||
<!--
|
||||
I am using this package for my [3d tic tac toe](http://tris3d.net) online game.
|
||||
-->
|
||||
|
||||
## License
|
||||
|
||||
License is the same as [three.js], i.e. [MIT].
|
||||
|
||||
[original_orbitcontrols]: https://github.com/mrdoob/three.js/tree/master/examples/js/controls/OrbitControls.js "OrbitControls.js"
|
||||
[orbitcontrols_documentation]: https://threejs.org/docs/#examples/controls/OrbitControls "OrbitControls documentation"
|
||||
[three.js]: http://threejs.org/ "three.js"
|
||||
[MIT]: https://github.com/mrdoob/three.js/blob/master/LICENSE "three.js license"
|
||||
[three-orbit-controls]: https://www.npmjs.com/package/three-orbit-controls "three-orbit-controls"
|
||||
36
node_modules/three-orbitcontrols/example.js
generated
vendored
Normal file
36
node_modules/three-orbitcontrols/example.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
// To import package in your code use the following:
|
||||
//
|
||||
// const OrbitControls = require('three-orbitcontrols')
|
||||
//
|
||||
const OrbitControls = require('./OrbitControls.js')
|
||||
const THREE = require('three')
|
||||
|
||||
const width = window.innerWidth
|
||||
const height = window.innerHeight
|
||||
|
||||
const scene = new THREE.Scene()
|
||||
const camera = new THREE.PerspectiveCamera(75, width/height, 0.1, 1000)
|
||||
|
||||
const renderer = new THREE.WebGLRenderer()
|
||||
renderer.setSize(width, height)
|
||||
document.body.appendChild(renderer.domElement)
|
||||
|
||||
const geometry = new THREE.BoxGeometry(1, 1, 1)
|
||||
const material = new THREE.MeshBasicMaterial({ color: 0x00ff00 })
|
||||
const cube = new THREE.Mesh(geometry, material)
|
||||
scene.add(cube)
|
||||
|
||||
camera.position.z = 5
|
||||
|
||||
const controls = new OrbitControls(camera, renderer.domElement)
|
||||
|
||||
function animate() {
|
||||
requestAnimationFrame(animate)
|
||||
|
||||
cube.rotation.x += 0.01
|
||||
cube.rotation.y += 0.01
|
||||
|
||||
renderer.render(scene, camera)
|
||||
}
|
||||
|
||||
animate()
|
||||
36
node_modules/three-orbitcontrols/example.ts
generated
vendored
Normal file
36
node_modules/three-orbitcontrols/example.ts
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
// To import package in your code use the following:
|
||||
//
|
||||
// import * as OrbitControls from 'three-orbitcontrols';
|
||||
//
|
||||
import * as OrbitControls from './OrbitControls.js';
|
||||
import * as THREE from 'three';
|
||||
|
||||
const width = window.innerWidth;
|
||||
const height = window.innerHeight;
|
||||
|
||||
const scene = new THREE.Scene();
|
||||
const camera = new THREE.PerspectiveCamera(75, width/height, 0.1, 1000);
|
||||
|
||||
const renderer = new THREE.WebGLRenderer();
|
||||
renderer.setSize(width, height);
|
||||
document.body.appendChild(renderer.domElement);
|
||||
|
||||
const geometry = new THREE.BoxGeometry(1, 1, 1);
|
||||
const material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });
|
||||
const cube = new THREE.Mesh(geometry, material);
|
||||
scene.add(cube);
|
||||
|
||||
camera.position.z = 5;
|
||||
|
||||
const controls = new OrbitControls(camera, renderer.domElement);
|
||||
|
||||
function animate() {
|
||||
requestAnimationFrame(animate);
|
||||
|
||||
cube.rotation.x += 0.01;
|
||||
cube.rotation.y += 0.01;
|
||||
|
||||
renderer.render(scene, camera);
|
||||
}
|
||||
|
||||
animate();
|
||||
44
node_modules/three-orbitcontrols/package.json
generated
vendored
Normal file
44
node_modules/three-orbitcontrols/package.json
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "three-orbitcontrols",
|
||||
"version": "2.110.3",
|
||||
"description": "is the three.js OrbitControls from official repo examples",
|
||||
"main": "OrbitControls.js",
|
||||
"scripts": {
|
||||
"example_commonjs": "budo example.js --open",
|
||||
"example_typescript": "budo example.ts --open -- -p [tsify]",
|
||||
"deploy": "npm version patch",
|
||||
"predeploy": "npm test",
|
||||
"postversion": "git push origin v${npm_package_version}; npm publish; git push origin master",
|
||||
"test": "node test"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/fibo/three-orbitcontrols.git"
|
||||
},
|
||||
"keywords": [
|
||||
"three",
|
||||
"three.js",
|
||||
"3d",
|
||||
"camera",
|
||||
"controls"
|
||||
],
|
||||
"author": {
|
||||
"name": "Gianluca Casati",
|
||||
"url": "http://g14n.info"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/fibo/three-orbitcontrols/issues"
|
||||
},
|
||||
"homepage": "http://g14n.info/three-orbitcontrols",
|
||||
"peerDependencies": {
|
||||
"three": ">= 0.110.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.12.5",
|
||||
"budo": "^11.6.3",
|
||||
"three": "^0.110.0",
|
||||
"tsify": "^4.0.1",
|
||||
"typescript": "^3.6.4"
|
||||
}
|
||||
}
|
||||
8
node_modules/three-orbitcontrols/test.js
generated
vendored
Normal file
8
node_modules/three-orbitcontrols/test.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
const assert = require('assert')
|
||||
|
||||
const { version, peerDependencies } = require('./package.json')
|
||||
|
||||
const orbitControlsMinorVersion = version.split('.')[1]
|
||||
const threeMinorVersion = peerDependencies.three.split('.')[1]
|
||||
|
||||
assert.equal(orbitControlsMinorVersion, threeMinorVersion, 'minor version is the same as threejs release')
|
||||
Reference in New Issue
Block a user