本文へ移動

Chikyu Earth地球

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

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

目次

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

BodyPainter型

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

The seam for drawing the Sun, the planets and their moons. The space view places them, sizes them, lights them and labels them; a painter only makes what is drawn at each place. The default (plainPainter) is a sphere in the body's colour, and a glow for the Sun. Another package can supply better looking ones: @johnmorrisdotca/wakusei-planets/painter draws the real Sun, planets, Pluto and moons. make may return a drawing at once or later (a promise); a drawing may update itself and ask for a redraw when a picture arrives. moons is optional: the moons the painter can draw for a planet at a moment, which the view shows round the planet when it is near enough to see them. looks names what context.look may be.

インポート

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

定義

interface BodyPainter {
    make(three: ThreeParts, name: string, context?: PaintContext): BodyDrawing | Promise<BodyDrawing>;
    moons?(planet: PlanetName, ms: number): readonly BodyMoon[];
    looks?: readonly string[];
}

メンバー

名前型説明
make(three: ThreeParts, name: string, context?: PaintContext): BodyDrawing | Promise<BodyDrawing>
moons (省略可)((planet: PlanetName, ms: number) => readonly BodyMoon[]) | undefined
looks (省略可)readonly string[] | undefined

例

import { plainPainter, type BodyPainter } from "@johnmorrisdotca/chikyu-earth/space";

const painter: BodyPainter = { make: (three, name) => plainPainter.make(three, name) };
console.log(typeof painter.make);

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

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