Skip to the content

Wakusei Planets惑星

The Sun, the planets and their moons as a clean line drawing, a shaded realistic drawing or a painted surface map, with real sizes, tilt and rotation, and the moons where they are at any date and time.

Wakusei is the Japanese word 惑星 for a planet. About the name

Contents

Reference · Bodies as objects for your own three.js scene

PaintInfotype

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 it

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

Definition

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

Members

NameTypeDescription
toSunVec3
msnumber
radiusPxnumber
pose (optional){ 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 (optional)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.

Examples

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);

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/wakusei-planets 0.24.0.