summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-02 17:10:39 +0100
committerskal <pascal.massimino@gmail.com>2026-02-02 17:10:39 +0100
commit01b3442ceb51983b2df920259d13edf933a6bfe3 (patch)
tree0f98fe0c6f707de3b658e6ff720678dad394fe86 /src/tests
parentbe2477c0fa161689ff02ec96b177a26594f1925b (diff)
fix(3d): Tighten torus proxy hull and ensure floor grid visibility
- Adjusted Torus proxy hull in vs_main to 1.5x0.5x1.5 for better SDF fit. - Updated VisualDebug::add_box to use per-object local extents. - Standardized floor grid mapping in fs_main using planar p.xz projection. - Verified non-uniform scale and rotation robustness in test_3d_render.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test_3d_render.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/tests/test_3d_render.cc b/src/tests/test_3d_render.cc
index 4c84c7c..d4d3525 100644
--- a/src/tests/test_3d_render.cc
+++ b/src/tests/test_3d_render.cc
@@ -239,8 +239,15 @@ int main(int argc, char** argv) {
g_camera.aspect_ratio = platform_get_aspect_ratio(&platform_state);
for (size_t i = 1; i < g_scene.objects.size(); ++i) {
- g_scene.objects[i].rotation =
- quat::from_axis(vec3(0, 1, 0), time * 2.0f + i);
+ // Rotation around a random-ish 3D axis
+ vec3 axis =
+ vec3(std::sin((float)i), std::cos((float)i), 0.5f).normalize();
+ g_scene.objects[i].rotation = quat::from_axis(axis, time * 2.0f + i);
+
+ // Non-uniform scaling variance
+ float s = 0.5f + 0.1f * std::sin(time * 0.5f + i);
+ g_scene.objects[i].scale = vec3(s, s * 1.4f, s * 0.8f);
+
g_scene.objects[i].position.y = std::sin(time * 3.0f + i) * 1.5f;
}