The container for this simulation.
for simulation
Path to simulation assets and data
The start date and time for this simulation.
The JD date of this simulation. Defaults to 0
The number of JD to add every tick of the simulation.
The number of jd to add every second.
Use this instead of jdDelta for constant motion that does not vary with
framerate. Defaults to 100.
The number of "position" units in the simulation that represent an AU. This is an optional setting that you may use if the default (1 unit = 1 AU) is too small for your simulation (e.g. if you are representing a planetary system). Depending on your graphics card, you may begin to notice inaccuracies at fractional scales of GL units, so it becomes necessary to scale the whole visualization. Defaults to 1.0.
Whether the simulation should start in a paused state.
The maximum number of particles in the visualization. Try choosing a number that is larger than your particles, but not too much larger. It's usually good enough to choose the next highest power of 2. If you're not showing many particles (tens of thousands+), you don't need to worry about this.
The texture for the default particle system.
The default size for the particle system.
Options for camera
Initial X, Y, Z coordinates of the camera. Defaults to [0, -10, 5].
Set true to have the camera float around slightly. False by default.
Options dictating debug state.
Show X, Y, and Z axes
Show grid on XY plane
Show FPS and other stats (requires stats.js).
Add a spacekit object (usually a SpaceObject) to the visualization.
Object to add to visualization
Set to true if object does not need to be animated.
Creates an ambient light source. This will dimly light everything in the visualization.
Color of light, default 0x333333
Create a stationary Schwarzschild black hole with mass in solar masses.
Creates a light source. This will make the shape of your objects visible and provide some contrast.
Position of light source. Defaults to moving with camera.
Color of light, default 0xFFFFFF
Shortcut for creating a new SpaceObject belonging to this visualization. Takes any SpaceObject arguments.
Shortcut for creating a new ShapeObject belonging to this visualization. Takes any ShapeObject arguments.
Shortcut for creating a new Skybox belonging to this visualization. Takes any Skybox arguments.
Shortcut for creating a new SphereOjbect belonging to this visualization. Takes any SphereObject arguments.
Shortcut for creating a new Stars object belonging to this visualization. Takes any Stars arguments.
Shortcut for creating a new StaticParticles object belonging to this visualization. Takes any StaticParticles arguments.
Get an object that contains useful context for this visualization
Context object
Get a date object representing local date and time of the simulation.
Date of simulation
Gets the current JD date of the simulation
JD date
Get the JD per frame of the visualization.
Get the JD change per second of the visualization.
JD per second, undefined if jd per second is not set.
Get the three.js renderer
The THREE.js renderer
Get the three.js scene object
The THREE.js scene object
Get the element containing this simulation
The html container of this simulation
Get the Camera and CameraControls wrapper object
The Camera wrapper
Returns a promise that receives a NaturalSatellites object when it is resolved.
NaturalSatellites object that is ready to load.
Removes an object from the visualization.
Object to remove
Installs a scroll handler that only renders the visualization while it is in the user's viewport.
The scroll handler currently binds to the window object only.
Enable or disable camera drift.
True if you want the camera to float around a bit
Set the local date and time of the simulation.
Date of simulation
Sets the JD date of the simulation.
JD date
Set the JD per frame of the visualization. This will override any existing "JD per second" setting.
JD per frame
Set the JD change per second of the visualization.
JD per second
Run the animation
Stop the animation
Adjust camera position so that the object fits within the viewport. If applicable, this function will fit around the object's orbit.
Object to fit within viewport.
Add some extra room in the viewport. Increase to be further zoomed out, decrease to be closer. Default 3.0.
The main entrypoint of a visualization.
This class wraps a THREE.js scene, controls, skybox, etc in an animated Simulation.
Example