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.
Properties
Section titled “Properties”visible
Section titled “visible”Type: boolean
Description: Toggles the visibility of the stars.
Default: true
Example:
{ visible: true }pointSize
Section titled “pointSize”Type: number
Description: Specifies the point size of the stars.
Default: 1
Example:
{ stars: { pointSize: 1.5, }}intensity
Section titled “intensity”Type: number
Description: Specifies the brightness intensity of the stars.
Default: 10
Example:
{ stars: { intensity: 15, }}background
Section titled “background”Type: boolean
Description: Specifies whether to display as a background.
Default: true
Example:
{ stars: { background: true, }}assetsUrl
Section titled “assetsUrl”Type: string
Description: Specifies the URL of the star data file.
Example:
{ stars: { assetsUrl: "https://example.com/stars.bin", }}Usage Examples
Section titled “Usage Examples”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 StarsDescconst starsDesc = view.addMesh<StarsDesc>({ stars: { visible: true, pointSize: 1.2, intensity: 12, background: true, },});Technical Details
Section titled “Technical Details”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.