本文へ移動

Wakusei Planets惑星

太陽・惑星・衛星を、線画、陰影つきの絵、表面の地図で描きます。実際の大きさ・傾き・自転つきで、任意の日時の衛星の位置も分かります。

「惑星」(わくせい) は、太陽のまわりを回る大きな星のことです。 名前について(英語)

目次

リファレンス · three.js での描き方

PaintedMap型

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

The painted look of a body: a surface map in the package's textures folder, as widths from the smallest up.

インポート

import type { PaintedMap } from "@johnmorrisdotca/wakusei-planets/look";

定義

interface PaintedMap {
    map: string;
    widths: readonly number[];
    far?: number;
    relief?: number;
    turn?: "bands" | "hexagon";
    rings?: {
        map: string;
        width: number;
        from: number;
        to: number;
    };
    credit?: string;
}

メンバー

名前型説明
mapstring

The file name before -<width>.webp, for example mars.

widthsreadonly number[]

The widths made, smallest first: the smallest is drawn first and sharper ones are fetched when the view is zoomed in.

far (省略可)number | undefined

The smallest width that is not in the npm package: it is fetched from the repository's own files (see texture-far-base).

relief (省略可)number | undefined

How much of the map's brightness is also relief. Default 0.

turn (省略可)"bands" | "hexagon" | undefined

Weather drawn on the map so a turn can be seen. bands is a wave and a spot that move with longitude. hexagon is that wave plus the six-sided storm at the north pole. A map of plain bands shows no turn without it.

rings (省略可){ map: string; width: number; from: number; to: number; } | undefined

A picture of the body's rings for this look, one pixel high: colour and opacity from the inner edge to the outer, width samples. Used instead of the table's strip when it loads.

credit (省略可)string | undefined

The painted pictures' credit line, for the page.

例

import { type PaintedMap } from "@johnmorrisdotca/wakusei-planets/look";

const map: PaintedMap = { map: "mars", widths: [512, 1024, 2048] };
console.log(map.widths.length);
3

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/wakusei-planets 0.24.0 のソースから作成しました。

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