Add 3D solar system view with Threlte and velocity tails in 2D
- 3D scene: Threlte/Three.js with starfield, orbit lines, planet meshes, sun glow, OrbitControls (orbit/zoom/pan), point lighting - 2D velocity tails: gradient lines showing planet velocity direction/magnitude - New WASM API: get_body_velocities_at_epoch(), get_orbit_points() - Orbit ellipses computed in Rust, rendered in both 2D and 3D views - Ecliptic-to-Three.js coordinate mapping (Y-up convention) - View toggle now switches between working 2D and 3D renderers Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -46,6 +46,15 @@ pub fn get_body_radii() -> Vec<f64> {
|
||||
all.iter().map(|b| b.radius_km).collect()
|
||||
}
|
||||
|
||||
/// Get velocities of all celestial bodies at a given Julian Date.
|
||||
///
|
||||
/// Returns a Float64Array of [vx0, vy0, vz0, vx1, vy1, vz1, ...] in AU/day.
|
||||
#[wasm_bindgen]
|
||||
pub fn get_body_velocities_at_epoch(jd: f64) -> Vec<f64> {
|
||||
let all = bodies::all_bodies();
|
||||
orbits::all_velocities_at_epoch(&all, jd)
|
||||
}
|
||||
|
||||
/// Get orbit points for a given body, sampled around its full orbit.
|
||||
/// Returns a Float64Array of [x0, y0, z0, x1, y1, z1, ...] in AU.
|
||||
/// `samples` is the number of points around the orbit.
|
||||
|
||||
Reference in New Issue
Block a user