Reference · The Sun, Moon and planets: pure parts
genericSatellitefunction
A generic satellite as a drawing of radius 1 about the origin, its long axis along +x (the way it flies), its top along +z and its left along +y, the family's convention for a model, with its own light that light(toSun) turns to the Sun. One group of a few meshes, made once and disposed with dispose.
Import it
import { genericSatellite } from "@johnmorrisdotca/chikyu-earth/space";
Definition
function genericSatellite(three: typeof THREE, kind: SatelliteKind, shared?: { sun: THREE.DirectionalLight; }): BodyDrawing
Parameters
| Name | Type | Description |
|---|---|---|
three | typeof THREE | three.js (the parts the demo's subset holds: |
kind | SatelliteKind | What to draw. |
shared (optional) | { sun: THREE.DirectionalLight; } | undefined | A Sun light the scene owns ( |
Returns
BodyDrawing
The drawing, with light and dispose.
Examples
import { genericSatellite } from "@johnmorrisdotca/chikyu-earth/space";
const three = await import("three");
const drawing = genericSatellite(three, "communications");
console.log(drawing.object.children.length);
drawing.dispose();