skydialv0.4.1 Astronomy & simulation
  1. skydial
  2. Reference
  3. Astronomy & simulation

Astronomy & simulation

Astronomy depends on Astronomy Engine and has no React or DOM requirement. Simulation time has no dependencies. Actual heliocentric positions, body orientation, lunar illumination and observer readings are calculated for the selected instant; scene radii and distances are exaggerated for readability.

The code for what is on screen

import { helioEcliptic, bodyAxes, moonView } from 'skydial/astro'
import { SimClock } from 'skydial/clock'

const clock = new SimClock(Date.UTC(2026, 0, 1))
clock.setSpeed('day')
const earth = helioEcliptic('Earth', clock.now())

SimClock supports now, setTime, setPlaying, setSpeed, goLive, subscribe and getState. Supported UTC years are 1600–2400. Speeds are real, day, month and year. The Three.js entry exports planet, Sun and Moon mesh factories and an optional browser texture loader. Dispose owned models, then caller-owned textures, when removing a scene.

Parameters

SettingDefaultValues
astroAstronomy EnginePure positions, orientation, scales and observer calculations.
clocknoneIndependent monotonic simulation clocks.
threeThree.jsMeshes, orientation helpers and optional texture loading.