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
| Name | Type | Description |
|---|---|---|
looks | readonly ("realistic" | "painted")[] | The looks |
make | (three: object, name: string, context?: PaintContext): Painting |
|
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(", "));