Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including three-orbitcontrols-ts with all npm packages installed. Try it out:

var threeOrbitcontrolsTs = require("three-orbitcontrols-ts")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

three-orbitcontrols-ts v0.1.2

ThreeJS OrbitControls as a standalone and typescript compatible npm module

ThreeJS OrbitControls as a standalone and typescript compatible npm module.

Installation

npm install --save three-orbitcontrols-ts

Usage

import * as THREE from 'three';
import { OrbitControls } from 'three-orbitcontrols-ts';

const camera = new THREE.SomeCamera(...);
const controls = new OrbitControls(camera, renderer.domElement);

// How far you can orbit vertically, upper and lower limits.
controls.minPolarAngle = 0;
controls.maxPolarAngle = Math.PI;


// How far you can dolly in and out ( PerspectiveCamera only )
controls.minDistance = 0;
controls.maxDistance = Infinity;

this.enableZoom = true; // Set to false to disable zooming
this.zoomSpeed = 1.0;


controls.enablePan = true; // Set to false to disable panning (ie vertical and horizontal translations)

Credit

All credit goes to OrbitControls.js contributors.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free