Skip to content

StarsDesc

The StarsDesc class is a mesh descriptor that draws a starry sky. It uses point sprites based on actual astronomical catalogs to render a realistic starry sky.

Star positions account for the Earth’s rotation based on view.atmosphere.date, and visibility is automatically adjusted based on the sun’s position.

In addition to the properties below, the common properties from the base class (position, rotation, scale, matrix, matrixWorld, visible) are available. See MeshDesc for details.

Type: boolean

Description: Toggles the visibility of the stars.

Default: true

Example:

{ visible: true }

Type: number

Description: Specifies the point size of the stars.

Default: 1

Example:

{
stars: {
pointSize: 1.5,
}
}

Type: number

Description: Specifies the brightness intensity of the stars.

Default: 10

Example:

{
stars: {
intensity: 15,
}
}

Type: boolean

Description: Specifies whether to display as a background.

Default: true

Example:

{
stars: {
background: true,
}
}

Type: string

Description: Specifies the URL of the star data file.

Example:

{
stars: {
assetsUrl: "https://example.com/stars.bin",
}
}
import ThreeView from "@navaramap/three";
import { StarsDesc } from "@navaramap/three_default_descs";
const view = new ThreeView();
view.registerMesh("stars", StarsDesc);
await view.init();
// Add a StarsDesc
const starsDesc = view.addMesh<StarsDesc>({
stars: {
visible: true,
pointSize: 1.2,
intensity: 12,
background: true,
},
});

StarsDesc is implemented using the @takram/three-atmosphere library and provides the following features:

  • Star placement based on actual astronomical catalog data
  • Automatic adjustment of star visibility based on sun position
  • Star rotation based on the Earth’s rotation
  • Star brightness adjustment considering atmospheric effects

Star data is loaded asynchronously and added to the scene once loading is complete.