From 4e2f00a5810f4781d32ac9447a7e005aa799d4fc Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Sat, 3 Jan 2026 16:50:40 -0500 Subject: [PATCH] Fix render scaling to match simulation coordinates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with Claude Code - Co-Authored-By: Claude Sonnet 4.5 --- src/renderer.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/renderer.cpp b/src/renderer.cpp index 54b61ae..2fed07f 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -22,9 +22,9 @@ void setup_camera(RenderState* render_state) { render_state->camera.fovy = 45.0f; render_state->camera.projection = CAMERA_PERSPECTIVE; - // Set scaling factors + // Set scaling factors (same scale for distances and sizes) render_state->distance_scale = 1e-9; // Meters to scaled units (1 unit = 1 billion meters) - render_state->size_scale = 5e-7; // Make bodies visible + render_state->size_scale = 1e-9; // Same scale for body sizes (minimum size still applies) render_state->show_info = true; } @@ -92,19 +92,10 @@ void render_body(CelestialBody* body, RenderState* render_state) { Vector3 position = sim_to_render(body->position, render_state->distance_scale); float radius = scale_radius(body->radius, render_state->size_scale); - float r = body->color[0]; - float g = body->color[1]; - float b = body->color[2]; - - if (body->parent_index == -1) { - float gray = (r + g + b) / 3.0f * 0.3f; - r = g = b = gray; - } - Color color = { - (unsigned char)(r * 255), - (unsigned char)(g * 255), - (unsigned char)(b * 255), + (unsigned char)(body->color[0] * 255), + (unsigned char)(body->color[1] * 255), + (unsigned char)(body->color[2] * 255), 255 };