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
| Name | Type | Description |
|---|---|---|
toSun | Vec3 | |
ms | number | |
radiusPx | number | |
pose (optional) | { pole: Vec3; meridian: Vec3; } | undefined | The pole and the prime meridian to draw instead of the body's real ones at |
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);