本文へ移動

Chikyu Earth地球

世界の国の輪郭を線で描いた地球儀です。地球と同じ速さで回ります。宇宙から見たような地球と、好きな場所の目印も使えます。

「地球」(ちきゅう) は、私たちが住む星の名前です。 名前について(英語)

目次

リファレンス · 太陽、月、惑星: 計算部分

BodyDrawing型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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 type { BodyDrawing } from "@johnmorrisdotca/chikyu-earth/space";

定義

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

メンバー

名前型説明
objectTHREE.Object3D<THREE.Object3DEventMap>
light (省略可)((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 (省略可)((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 (省略可)boolean | undefined

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

dispose(): void

例

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

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

ソースを見るGitHub で編集@johnmorrisdotca/chikyu-earth 0.11.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。