# @workswithweb/threejs-orbit-controls

> threejs orbit controls translated to es module with typescript support

Latest version **0.0.3** (published 2019-04-26) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @workswithweb/threejs-orbit-controls
pnpm add @workswithweb/threejs-orbit-controls
yarn add @workswithweb/threejs-orbit-controls
bun add @workswithweb/threejs-orbit-controls
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2019-04-26 |
| First published | 2019-04-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 67.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sathya Vikram |
| Maintainers | workswithweb |
| Keywords | three, three.js, 3d, camera, controls, orbit-controls |

## Links

- npm: https://www.npmjs.com/package/@workswithweb/threejs-orbit-controls
- Repository: https://github.com/workswithweb/threejs-orbit-controls
- npm.io page: https://npm.io/package/@workswithweb/threejs-orbit-controls

## Recent versions

- 0.0.3 (latest) — 2019-04-26
- 0.0.2 — 2019-04-26
- 0.0.1 — 2019-04-26

## README

# @workswithweb/threejs-orbit-controls

## Installation
with npm

```
npm install @workswithweb/threejs-orbit-controls
```

with yarn

```
yarn add @workswithweb/threejs-orbit-controls
```

## Usage

All credit goes to [OrbitControls.js][original_orbitcontrols] contributors.
See also [official OrbitControls documentation][orbitcontrols_documentation].

This repo **trasnsalted** existing js code to typescript and compiled to es6 module using [rollupjs].

You will be able to use this module in typescript and javascript

#### Usage with typescript or es module code
```typescript
import { OrbitControls } from '@workswithweb/threejs-orbit-controls';

// Init THREE camera (add your code)
const camera = new THREE.PerspectiveCamera(75, width / height, 0.1, 1000);
camera.position.z = 5;
const renderer = new THREE.WebGLRenderer({ canvas })

// This is how you use OrbitControls with camera
const controls = new OrbitControls(camera);

or

// This is how you use OrbitControls with camera and domElement
const controls = new OrbitControls(camera, renderer.domElement);
```

#### Usage with commonjs code
```typescript
const OrbitControls = require('@workswithweb/threejs-orbit-controls')

// Init THREE camera (add your code)
const camera = new THREE.PerspectiveCamera(75, width / height, 0.1, 1000);
camera.position.z = 5;
const renderer = new THREE.WebGLRenderer({ canvas })

// This is how you use OrbitControls with camera
const controls = new OrbitControls(camera);

or

// This is how you use OrbitControls with camera and domElement
const controls = new OrbitControls(camera, renderer.domElement);
```

#### 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.

#### If you want to modify this package
1. git clone git@github.com:workswithweb/threejs-orbit-controls.git
2. cd threejs-orbit-controls
3. npm install
4. npm run build

## 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"
[rollupjs]: https://rollupjs.org/guide/en/ "rollupjs"
[MIT]: https://github.com/mrdoob/three.js/blob/master/LICENSE "three.js license"

---
_Source: https://npm.io/package/@workswithweb/threejs-orbit-controls · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
