From 2987d6e08c0644569cd5130b9f92a31ceb0ffbf2 Mon Sep 17 00:00:00 2001 From: assiduous Date: Wed, 23 Oct 2024 21:52:31 -0700 Subject: [PATCH] HnCamera: flip Z axis to be compliant with OpenUSD convention --- Hydrogent/src/HnCamera.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Hydrogent/src/HnCamera.cpp b/Hydrogent/src/HnCamera.cpp index 7a45e7d7..95f6bbb9 100644 --- a/Hydrogent/src/HnCamera.cpp +++ b/Hydrogent/src/HnCamera.cpp @@ -62,7 +62,8 @@ void HnCamera::Sync(pxr::HdSceneDelegate* SceneDelegate, if (OrigDirtyBits & pxr::HdCamera::DirtyTransform) { - m_WorldMatrix = ToFloat4x4(_transform); + // USD camera looks along -Z axis, while Diligent camera looks along +Z axis + m_WorldMatrix = float4x4::Scale(1, 1, -1) * ToFloat4x4(_transform); m_ViewMatrix = m_WorldMatrix.Inverse(); }