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 · How a body is drawn with three.js

registerLookfunction

Teach the package how to draw a body in three.js. Each body's entry point (@johnmorrisdotca/wakusei-planets/jupiter) calls this once as it loads; call it yourself to add or replace a look.

Import it

import { registerLook } from "@johnmorrisdotca/wakusei-planets/look";

Definition

function registerLook(look: BodyLook): BodyLook

Parameters

NameTypeDescription
lookBodyLook

The body's name and its shader code, atmosphere and map.

Returns

BodyLook

The look, as it was given.

Examples

import { registerLook, lookOf } from "@johnmorrisdotca/wakusei-planets/look";

registerLook({ id: "moon", surface: "vec4 surface(vec3 p) { return vec4(vec3(0.6), 0.0); }" });
console.log(lookOf("moon")?.id);
moon

What it prints (run when this page was built)

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