lesca-threejs-orbitcontrols
Version:
add set polar angle and azimuthal angle
54 lines (37 loc) • 1.97 kB
Markdown
[](https://www.npmjs.com/)
[](https://nodejs.org/en/)
[](https://zh-hant.reactjs.org/)
[](https://lesscss.org/)
[](https://www.w3schools.com/html/)
[](https://www.w3schools.com/css/)
[](https://www.npmjs.com/~jameshsu1125)
add [OrbitControls](https://threejs.org/docs/#examples/en/controls/OrbitControls) setAzimuthalAngle and getPolarAngle methods.
```sh
npm install lesca-threejs-orbitcontrols --save
```
```javascript
import * as THREE from 'three';
import { OrbitControls } from 'lesca-threejs-orbitcontrols';
const renderer = new THREE.WebGLRenderer();
const camera = new THREE.PerspectiveCamera(75, 16 / 9, 0.1, 1000);
// create controls object
const controls = new new OrbitControls(THREE)(camera, renderer.domElement);
// keep update
function animate() {
requestAnimationFrame(animate);
controls.update();
}
animate();
```
| method | description |
| :----------------------------------------- | :-----------------: |
| .**setPolarAngle**(**angle**:_number_) | set Polar Angle |
| .**setAzimuthalAngle**(**angle**:_number_) | set Azimuthal Angle |
- maintain if necessary