---
title: Space Objects
hide_meta: true
---

Space Objects represent nearly everything you see in the night sky (planets, moons, suns, nebulae,...),
they contain the information on how an object should behave and what it looks like.

The following are considered Space Objects:
* [Planets and Moons](https://moddedmc.wiki/cs/project/stellarview/docs/resourcepacks/planets_and_moons)
* [Stars](https://moddedmc.wiki/cs/project/stellarview/docs/resourcepacks/stars)
* [Black Holes](https://moddedmc.wiki/cs/project/stellarview/docs/resourcepacks/black_holes)
* [Nebulae](https://moddedmc.wiki/cs/project/stellarview/docs/resourcepacks/nebulae)
* [Star Fields](https://moddedmc.wiki/cs/project/stellarview/docs/resourcepacks/star_fields)
* [Constellations](https://moddedmc.wiki/cs/project/stellarview/docs/resourcepacks/constellations)

### Definition Fields

* `parent` *OPTIONAL* - References another object as this object's parent. Removes the object if its parent location is set to `"stellarview:removed"`.
* `coords` **REQUIRED** - Specifies the space coordinates of the object.
* `axis_rotation` **REQUIRED** - Specifies the rotation of the object around its individual axes (X axis -> Z axis -> Y axis).

## `parent`

Parent field is used to define an object's parent-child relationship. If a Parent can't be rendered, its children won't be rendered as well.
Additionally, child objects can have their position and rotation be relative to the paren't position

If the object's parent is set to `"stellarview:removed"`, the object will not be loaded during Resourcepack setup.

### Definition Fields

* `location` *REQUIRED* - Defines the path (Resource Location) the object's [parent](https://moddedmc.wiki/cs/project/stellarview/docs/resourcepacks/space_objects).
* `relative` *OPTIONAL* - If set to true, the Space Object's relative coordinates and rotation will center around the parent. If not defined, it will be true by default.
For example: If a star is defined with `coords` equal to `(0, 2, 1)` and it references a galaxy at `coords` equal to `(0, 40, 0)` as its parent, the star's absolute position will be `(0, 42, 1)`, `axis_rotation` behaves similarly.

Examples of parent definition:

[Orion](https://github.com/Povstalec/StellarView/blob/main/src/main/resources/assets/stellarview/stellarview/celestials/constellation/milky_way/orion.json#L2) is a child of Milky Way, but its coordinates aren't centered around Milky Way's center:  
```json
"parent": { "location": "stellarview:star_field/spiral_galaxy/milky_way/milky_way", "relative": false },
```

[Earth](https://github.com/Povstalec/StellarView/blob/main/src/main/resources/assets/stellarview/stellarview/celestials/planet/milky_way/sol/earth.json#L2) is a child of Sol and its coordinates are centered around it:  
```json
"parent": { "location": "stellarview:star/milky_way/sol" },
```

Removed Space Object:
```json
"parent": { "location": "stellarview:removed" },
```

## `coords`

### Space Coords

Stellar View is scaled 1:1 with the real-life Universe, so it uses a custom coordinate system called Space Coords to define positions of Space Objects in the Universe based on cartesian coordinates.
This system uses light years and kilometers as base units of measurement and doesn't lose precision no matter how far from the center of the Universe you get (there are still issues with orbits that are too large though).

### Definition Fields

* `x`, `y`, `z` **REQUIRED** - Distances from the origin in the X, Y and Z axes.
    * `ly` *OPTIONAL* - The distance in light years, adds up with kilometers if specified. 0 if left empty.
    * `km` *OPTIONAL* - The distance in kilometers, adds up with light years if specified. 0 if left empty.

Examples of Space Coord definition:

[Sol](https://github.com/Povstalec/StellarView/blob/main/src/main/resources/assets/stellarview/stellarview/celestials/star/milky_way/sol.json#L3) is placed in the exact center of the simulated Universe:  
```json
"coords": { "x": {"ly": 0}, "y": {"ly": 0}, "z": {"ly": 0} },
```

[Proxima Centauri](https://github.com/Povstalec/StellarView/blob/main/src/main/resources/assets/stellarview/stellarview/celestials/star/milky_way/alpha_centauri/proxima_centauri.json#L3) is not even a light year away from the Alpha Centauri barycenter:  
```json
"coords": { "x": {"ly": 0, "km": -1118496303331.426}, "y": {"ly": 0, "km": -1118496303331.426}, "z": {"ly": 0, "km": -1118496303331.426} },
```

### Equatorial Coordinate System

In real life, because of the nature of our position in space, it makes more sense to use a coordinate system based on spherical coordinates, rather than cartesian coordinates.
Which is why the [equatorial coordinate system](https://en.wikipedia.org/wiki/Equatorial_coordinate_system) is used for specifying the position of any deep space object.  
You will find these used in scientific papers, astronomical sites and on wikipedia. And since converting from one coordinate system to another is tedious, you can simply use equatorial coordinate directly and Stellar View will convert them to Space Coords internally.
All equatorial coordinates currently used in Stellar View are based on the J2000 epoch.

### Definition Fields

* `right_ascension` **REQUIRED** - [Right ascension](https://en.wikipedia.org/wiki/Equatorial_coordinate_system#Right_ascension) of the object.
    * `hours` *OPTIONAL* - 0 if left empty. [Min = 0.0 | Max = 24.0]
    * `minutes` *OPTIONAL* - 0 if left empty. [Min = 0.0 | Max = 60.0]
    * `seconds` *OPTIONAL* - 0 if left empty. [Min = 0.0 | Max = 60.0]
* `declination` **REQUIRED** - [Declination](https://en.wikipedia.org/wiki/Equatorial_coordinate_system#Declination) of the object.
    * `degrees` *OPTIONAL* - 0 if left empty. [Min = -180.0 | Max = 180.0]
    * `minutes` *OPTIONAL* - 0 if left empty. [Min = -60.0 | Max = 60.0]
    * `seconds` *OPTIONAL* - 0 if left empty. [Min = -60.0 | Max = 60.0]
* `distance` **REQUIRED** - Distance of the object from origin.
    * `ly` *OPTIONAL* - The distance in light years, adds up with kilometers if specified. 0 if left empty.
    * `km` *OPTIONAL* - The distance in kilometers, adds up with light years if specified. 0 if left empty.

Example of Equatorial coordinates definition:

You can compare the coordinates of [Betelgeuse](https://github.com/Povstalec/StellarView/blob/main/src/main/resources/assets/stellarview/stellarview/celestials/star/milky_way/betelgeuse.json#L3)
used in Stellar View with ones you can find on [Wikipedia](https://en.wikipedia.org/wiki/Betelgeuse):  
```json
`"coords": { "right_ascension": {"hours": 5, "minutes": 55, "seconds": 10.30536}, "declination": {"degrees": 7, "minutes": 24, "seconds": 25.4304}, "distance": {"ly": 478} },
```

## `axis_rotation`

Space Objects can be rotated in various directions. This rotation can affect its visual appearance, relative positions of its children, as well as how the sky looks on it if it's used as a [View Center](https://moddedmc.wiki/cs/project/stellarview/latest/docs/resourcepacks/view_centers).
Axis Rotation defines these rotations along the Y, Z and X axes in that order.

### Definition Fields

* `x_axis` **REQUIRED** - Rotation around the X-axis.
* `y_axis` **REQUIRED** - Rotation around the Y-axis.
* `z_axis` **REQUIRED** - Rotation around the Z-axis.
* `in_degrees` *OPTIONAL* - If true, the rotation is specified in degrees, if false it is specified in radians. True if left empty.

Example of Axis Rotation definition:

Axis Rotation of the [Andromeda Galaxy](https://github.com/Povstalec/StellarView/blob/main/src/main/resources/assets/stellarview/stellarview/celestials/star_field/spiral_galaxy/andromeda/andromeda.json#L3):  
```json
`"axis_rotation": { "x_axis": 0, "y_axis": 32, "z_axis": -49 },
```