From 4fd3fc4dacd7d798a5fdcd243ba1140eada477dc Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Sat, 7 Nov 2026 10:47:01 -0600 Subject: [PATCH] docs(model): Project3DPointTo2D ignores the view insets and translation The ModelScene paint frames the camera over the view rect (the frame's rect less its insets, moved by its translation), and Project3DPointTo2D frames it over the whole rect. That looked like a gap, so retail was probed: a 400x200 scene with its camera at (-10, 0, 0) projected the origin to (142.22, 71.11) plainly, with SetViewInsets(100, 0, 0, 0) and with SetViewTranslation(50, 0). The comment above Project now records this, so the whole-rect framing stays. --- src/model/Scene.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/model/Scene.cpp b/src/model/Scene.cpp index 84204df9..b92922c6 100644 --- a/src/model/Scene.cpp +++ b/src/model/Scene.cpp @@ -393,6 +393,11 @@ void __fastcall Paint(void *frame) { // at SetScale(2) — about 0.911 * effectiveScale^2, a factor 1.12 has no // source for. Depth here is the same form without it (1 at the near clip, // 0 at the far); retail's callers all discard it. +// +// The view insets and translation do not move the projection: retail gave +// (142.22, 71.11) with none, with SetViewInsets(100, 0, 0, 0) and with +// SetViewTranslation(50, 0) (12.1.5, same frame). So this frames the +// camera over the whole rect, not the paint's view rect. bool Project(void *frame, const Vec3 &point, double out[3]) { void *camera = CameraOf(frame); float rect[4] = {}; // {bottom, left, top, right}