Skip to content
🎉 Angular Three v4 is here! Read the announcement

NgtsOrbitControls

NgtsOrbitControls is a wrapper around Three.js OrbitControls which allows you to rotate the camera around a target point using mouse and touch events.

Usage

import { NgtsOrbitControls } from 'angular-three-soba/controls';
<ngts-orbit-controls />

With Options

<ngts-orbit-controls [options]="{ autoRotate: true, enableZoom: false }" />

Make Default

When makeDefault is true, the controls will be set as the default controls in the store, allowing other components to access them.

<ngts-orbit-controls [options]="{ makeDefault: true }" />

Options

options input accepts any properties from OrbitControls in addition to the following:

Properties

name type description
camera NgtCamera The camera to control. If not provided, the default camera will be used.
domElement HTMLElement The DOM element to attach the controls to. If not provided, the current connected element will be used.
target [number, number, number] The coordinates that the camera will orbit around. Default: [0, 0, 0]
makeDefault boolean Whether to make this control the default one. Default: false
regress boolean Whether to regress performance. Default: false
enableDamping boolean Whether to enable damping (smoothness) of the camera movement. Default: true
keyEvents boolean | HTMLElement Whether to enable keyboard events for the controls, or an HTML element to listen on. Default: false