@viamrobotics/three
v0.0.9
Published
Viam-related utilities for THREE.js
Downloads
357
Readme
@viamrobotics/three
Viam-related utilities for THREE.js
Orientation Vector
A class for Viam's Orientation Vector rotation type.
This class closely resembles other rotation formats like THREE.Quaternion
or THREE.Euler
.
import * as THREE from 'three';
import { OrientationVector } from '@viamrobotics/three';
const ov = new OrientationVector();
const quat = new THREE.Quaternion();
const euler = new THREE.Euler();
// Common conversions:
ov.toQuaternion(quat);
ov.toEuler(euler);
ov.setFromQuaternion(quat);
ViamObject3D
Extends THREE.Object3D and adds an .orientationVector
that auto-updates when other rotation formats are updated.
import { ViamObject3D } from '@viamrobotics/three';