Browse Source

Add renderer development session notes

🤖 Generated with Claude Code - Co-Authored-By: Claude Sonnet 4.5
main
cinnaboot 6 months ago
parent
commit
3d765309eb
  1. 4
      .gitignore
  2. 46
      docs/sessions/2026-01-03-renderer-development.md

4
.gitignore vendored

@ -2,8 +2,8 @@
build/
orbit_sim
# Session notes and conversation logs
sessions/
# Session notes and conversation logs (root level only)
/sessions/
# Editor/IDE files
.vscode/

46
docs/sessions/2026-01-03-renderer-development.md

@ -0,0 +1,46 @@
# Renderer Development Session (2026-01-03)
## Changes Made:
### 1. Added orbit path visualization
- Store orbital parameters (eccentricity, semi_major_axis) in CelestialBody struct
- Render elliptical orbit paths for all non-root bodies
- Orbits drawn as 100-segment line loops with semi-transparent body colors
- Correctly places parent body at one focus of the ellipse
### 2. Implemented sim-to-render coordinate transform
- Simulation uses XY plane (natural for physics)
- Renderer uses XZ plane (natural for 3D top-down view)
- `sim_to_render()` applies 90° rotation around X-axis: Y→Z, Z→-Y
- All positions and orbits use consistent transformation
### 3. Fixed render scaling issue (renderer.cpp:26-27)
**Problem**: size_scale (5e-7) and distance_scale (1e-9) had inconsistent ratios
- Sun radius: 6.96e8 m × 5e-7 = 348 units (engulfed orbits!)
- Earth orbit: 1.496e11 m × 1e-9 = 149.6 units
**Solution**: Set size_scale = 1e-9 to match distance_scale
- Result: Sun radius now 0.696 units, orbits clearly visible
- Maintains physical accuracy with uniform scaling
### 4. Visual improvements
- Changed bodies to wireframe spheres (DrawSphereWires)
- Custom dark grid (RGB 20,20,20) instead of default bright grid
- Bodies use saturated colors for visibility
- Minimum radius (0.5 units) ensures small bodies remain visible
## Rendering Parameters
- `distance_scale = 1e-9` (1 render unit = 1 billion meters = ~0.0067 AU)
- `size_scale = 1e-9` (same as distance_scale for physical accuracy)
- `min_radius = 0.5` (minimum visible body size)
## Commits
- `d7d49b7` Add orbit path visualization with sim-to-render coordinate transform
- `9b4009d` Set DEFAULT_HEADLESS to 0 for renderer development
- `4e2f00a` Fix render scaling to match simulation coordinates
## Known Issues
- No known rendering issues at this time
Loading…
Cancel
Save