From 4ed0bc4a518195436a85f399879603768807b9e5 Mon Sep 17 00:00:00 2001 From: Dejvino Date: Mon, 16 Nov 2026 22:36:42 +0100 Subject: [PATCH] tron-room-demo: fix missing box top faces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The face table drew the 'top' quad from corners 0-3, which sit at z0 (the base), while the real top face (corners 4-7 at z1) was backface culled against the overhead camera — every box rendered open-topped. Swap the two entries so the top face uses the z1 corners; the top-rim highlight and face-center backface cull both key off face 0 and now refer to the true top. --- tron-room-demo/examples/RoomView/RoomView.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tron-room-demo/examples/RoomView/RoomView.cpp b/tron-room-demo/examples/RoomView/RoomView.cpp index b17cae8..a884125 100644 --- a/tron-room-demo/examples/RoomView/RoomView.cpp +++ b/tron-room-demo/examples/RoomView/RoomView.cpp @@ -214,9 +214,10 @@ struct Box { }; // Face corner indices into an 8-corner box, and world normals. +// Corners 0-3 sit at z0 (bottom), corners 4-7 at z1 (top). static const int FACES[6][4] = { - {0,1,2,3}, // top (+Z) - {4,5,6,7}, // bottom (-Z, rarely seen) + {4,5,6,7}, // top (+Z) — corners at z1 + {0,1,2,3}, // bottom (-Z) — corners at z0 {0,1,5,4}, // -Y side {2,3,7,6}, // +Y side {1,2,6,5}, // +X side