From a95437dd64772a1897b818a29fcd8bce8e823265 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Wed, 27 May 2026 14:29:04 +1000 Subject: [PATCH] wgpu backend: match GL pitch sign so drag-down tilts the camera up Drag-down was decreasing pitch (camera diving), opposite to the GL viewport's convention where drag-down increases pitch so the top of the object rotates toward the viewer. Yaw direction was already correct. Matches the existing user muscle memory from IfcViewerMinimal. Co-Authored-By: Claude Opus 4.7 --- src/ifcviewer-wgpu/WgpuViewportWindow.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ifcviewer-wgpu/WgpuViewportWindow.cpp b/src/ifcviewer-wgpu/WgpuViewportWindow.cpp index 54cbd5e378..0ca2d34e36 100644 --- a/src/ifcviewer-wgpu/WgpuViewportWindow.cpp +++ b/src/ifcviewer-wgpu/WgpuViewportWindow.cpp @@ -1485,9 +1485,12 @@ void WgpuViewportWindow::mouseMoveEvent(QMouseEvent* event) { nav_last_pos_ = pos; if (nav_active_button_ == Qt::LeftButton) { - // Orbit. 0.4 deg/px feels right for a 1280-wide window. - camera_yaw_deg_ += float(dx) * -0.4f; - camera_pitch_deg_ += float(dy) * -0.4f; + // Orbit. Sign convention matches the GL viewport: drag-right rotates + // the world right (yaw -= dx), drag-down tilts the camera up so we + // see more of the object's top (pitch += dy). 0.4 deg/px feels right + // for a 1280-wide window. + camera_yaw_deg_ -= float(dx) * 0.4f; + camera_pitch_deg_ += float(dy) * 0.4f; camera_pitch_deg_ = std::clamp(camera_pitch_deg_, -89.9f, 89.9f); requestUpdate(); } else if (nav_active_button_ == Qt::MiddleButton) {