Skip to content

Commit

Permalink
Updated tlRender to new matrix code.
Browse files Browse the repository at this point in the history
Simplified rotation calculation to use _getRotation() instead of p.rotation + p.videoRotation;
  • Loading branch information
ggarra13 committed May 22, 2024
1 parent fbcf0ed commit 5124dc7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions mrv2/lib/mrvGL/mrvTimelineViewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ namespace mrv

float TimelineViewport::_getRotation() const noexcept
{
return normalizeAngle0to360(_p->rotation + _p->videoRotation);
return normalizeAngle0to360(_p->rotation - _p->videoRotation);
}

void TimelineViewport::_frameView() noexcept
Expand Down Expand Up @@ -3058,7 +3058,7 @@ namespace mrv
const math::Matrix4x4f& vm =
math::translate(math::Vector3f(p.viewPos.x, p.viewPos.y, 0.F)) *
math::scale(math::Vector3f(p.viewZoom, p.viewZoom, 1.F));
const auto& rm = math::rotateZ(p.rotation + p.videoRotation);
const auto& rm = math::rotateZ(_getRotation());
const math::Matrix4x4f& tm = math::translate(
math::Vector3f(-renderSize.w / 2, -renderSize.h / 2, 0.F));
const math::Matrix4x4f& to = math::translate(
Expand Down Expand Up @@ -3098,7 +3098,7 @@ namespace mrv
math::translate(math::Vector3f(-p.viewPos.x, -p.viewPos.y, 0.F));
math::Matrix4x4f zoom = math::scale(
math::Vector3f(1.F / p.viewZoom, 1.F / p.viewZoom, 1.F));
const auto& rotation = math::rotateZ(-p.rotation - p.videoRotation);
const auto& rotation = math::rotateZ(-_getRotation());

const math::Matrix4x4f tm = math::translate(
math::Vector3f(renderSize.w / 2, renderSize.h / 2, 0.F));
Expand Down

0 comments on commit 5124dc7

Please sign in to comment.