本文へ移動

Wakusei Planets惑星

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

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

目次

リファレンス · 自分の three.js シーンに置く天体

PaintInfo型

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

What the caller tells a painted body at each draw: the direction to the Sun (a unit vector in the scene's axes), the time, and how many CSS pixels across its radius the body is on the screen.

インポート

import type { PaintInfo } from "@johnmorrisdotca/wakusei-planets/painter";

定義

interface PaintInfo {
    toSun: Vec3;
    ms: number;
    radiusPx: number;
    pose?: {
        pole: Vec3;
        meridian: Vec3;
    };
    occluders?: readonly (readonly [
        number,
        number,
        number,
        number
    ])[];
}

メンバー

名前型説明
toSunVec3
msnumber
radiusPxnumber
pose (省略可){ pole: Vec3; meridian: Vec3; } | undefined

The pole and the prime meridian to draw instead of the body's real ones at ms (a portrait's own pose), in the scene's axes.

occluders (省略可)readonly (readonly [number, number, number, number])[] | undefined

Spheres that may shade this body from the Sun: x, y, z (from this body's centre) and radius, all in this body's radii, in the scene's axes. At most six are used.

例

import type { PaintInfo } from "@johnmorrisdotca/wakusei-planets/painter";

const info: PaintInfo = { toSun: [1, 0, 0], ms: Date.UTC(2026, 10, 2), radiusPx: 80 };
console.log(info.radiusPx);

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

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