Skip to the content

Chikyu Earth地球

A line-drawn globe of the world's countries that turns at the Earth's own rate, with an optional realistic Earth from space and markers for any place.

Chikyu is the Japanese word 地球 for the Earth. About the name

Contents

Reference · The Sun, Moon and planets: pure parts

BodyDrawingtype

One body as drawn by a painter: an object of radius 1 at the origin, which the scene places, scales and (for the Sun) turns to face the camera.

Import it

import type { BodyDrawing } from "@johnmorrisdotca/chikyu-earth/space";

Definition

interface BodyDrawing {
    object: THREE.Object3D;
    light?(toSun: Vec3): void;
    update?(info: {
        toSun: Vec3;
        ms: number;
        radiusPx: number;
    }): void;
    billboard?: boolean;
    dispose(): void;
}

Members

NameTypeDescription
objectTHREE.Object3D<THREE.Object3DEventMap>
light (optional)((toSun: Vec3) => void) | undefined

Told at each draw the unit direction from the body to the Sun, in scene axes (x to the vernal equinox, y north).

update (optional)((info: { toSun: Vec3; ms: number; radiusPx: number; }) => void) | undefined

Told at each draw, after the object is placed and scaled: the direction to the Sun, the moment shown, and how many CSS pixels across its radius the body is (a sharper picture is worth fetching only for a big one).

billboard (optional)boolean | undefined

True to have the scene turn the object to face the camera (a disc or a glow).

dispose(): void

Examples

import type { BodyDrawing } from "@johnmorrisdotca/chikyu-earth/space";

const drawing = { object: undefined as never, dispose: () => undefined } satisfies BodyDrawing;
console.log(typeof drawing.dispose);

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/chikyu-earth 0.11.0.