Reference · How a body is drawn with three.js
registerStarLookfunction
Teach the package a star by name, so an element can be told star="Betelgeuse" and draw it from these numbers. The package holds no catalogue of stars: this is where a page puts the few it draws.
The name is matched without regard to case. Registering a name again replaces it.
Import it
import { registerStarLook } from "@johnmorrisdotca/wakusei-planets/look";
Definition
function registerStarLook(name: string, numbers: StarNumbers): StarLook
Parameters
| Name | Type | Description |
|---|---|---|
name | string | What the star is called in the |
numbers | StarNumbers | The star's numbers. |
Returns
StarLook
The star, ready to draw.
Examples
import { registerStarLook, starLookOf } from "@johnmorrisdotca/wakusei-planets/look";
registerStarLook("Proxima Centauri", { temperatureK: 3042, radiusSun: 0.154, luminosityClass: "V", rotationDays: 83 });
console.log(starLookOf("proxima centauri")?.colour);#ffb371What it prints (run when this page was built)