Skip to content

Commit

Permalink
HnCamera: flip Z axis to be compliant with OpenUSD convention
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Oct 24, 2024
1 parent 6e7ea0c commit 2987d6e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Hydrogent/src/HnCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 2987d6e

Please sign in to comment.