Reference · How a body is drawn with three.js
PaintedMaptype
The painted look of a body: a surface map in the package's textures folder, as widths from the smallest up.
Import it
import type { PaintedMap } from "@johnmorrisdotca/wakusei-planets/look";
Definition
interface PaintedMap {
map: string;
widths: readonly number[];
far?: number;
relief?: number;
turn?: "bands" | "hexagon";
rings?: {
map: string;
width: number;
from: number;
to: number;
};
credit?: string;
}
Members
| Name | Type | Description |
|---|---|---|
map | string | The file name before |
widths | readonly number[] | The widths made, smallest first: the smallest is drawn first and sharper ones are fetched when the view is zoomed in. |
far (optional) | number | undefined | The smallest width that is not in the npm package: it is fetched from the repository's own files (see |
relief (optional) | number | undefined | How much of the map's brightness is also relief. Default 0. |
turn (optional) | "bands" | "hexagon" | undefined | Weather drawn on the map so a turn can be seen. |
rings (optional) | { map: string; width: number; from: number; to: number; } | undefined | A picture of the body's rings for this look, one pixel high: colour and opacity from the inner edge to the outer, |
credit (optional) | string | undefined | The painted pictures' credit line, for the page. |
Examples
import { type PaintedMap } from "@johnmorrisdotca/wakusei-planets/look";
const map: PaintedMap = { map: "mars", widths: [512, 1024, 2048] };
console.log(map.widths.length);3What it prints (run when this page was built)