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

WakuseiPaintertype

A painter: makes the bodies as three.js objects (make) and tells where a planet's moons are (moons). Its shape is chikyu-earth's BodyPainter, so setBodyPainter(painter) is all the wiring.

Import it

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

Definition

interface WakuseiPainter {
    readonly looks: readonly PainterLook[];
    make(three: object, name: string, context?: PaintContext): Painting;
    moons(planet: string, ms: number): MoonSite[];
}

Members

NameTypeDescription
looksreadonly ("realistic" | "painted")[]

The looks make takes in context.look.

make(three: object, name: string, context?: PaintContext): Painting

three is the three.js module (or a subset of it holding the parts PainterThree names); it is typed loosely so that another package can hand over its own subset.

moons(planet: string, ms: number): MoonSite[]

The moons the painter draws for a planet (none for the Earth: its Moon is the viewer's own), where they are at a time, nearest first.

Examples

import { createPainter, type WakuseiPainter } from "@johnmorrisdotca/wakusei-planets/painter";

const mine: WakuseiPainter = createPainter({ textureBase: "/pictures/", farBase: "/pictures/" });
console.log(mine.looks.join(", "));

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