/aframe-position-spherical-component

Simple utility to position entity with spherical coordinate system

Primary LanguageJavaScript

aframe-position-spherical-component

Simple utility to position entity with spherical coordinate system.

Usage

npm install aframe-position-spherical-component
require('aframe');
require('aframe-position-spherical-component');
<a-box position-shperical="12 90 45"></a-box>
var box = document.querySelector('a-box');
box.setAttribute('position-spherical', { radius: 12, phi: 90, theta: 45 });

Values

Type Description
string String in format: ${radius} ${phi} ${theta}.
custom Object with coordinates properties:
  • radius: number - distance in meters
  • phi: number - polar angle from the y axis in degrees
  • theta: number - equator angle around the y axis in degrees

Example

https://krzysztof-grzybek.github.io/aframe-position-spherical-component/example/