From 7e6c315a09c5839e92ded6b9ce67e2cfa09febca Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 15 Nov 2024 11:57:38 +0000 Subject: [PATCH] Fixed the LookAt handling of offset and origin. --- src/vsg/app/ViewMatrix.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vsg/app/ViewMatrix.cpp b/src/vsg/app/ViewMatrix.cpp index 5df8c3b43..121336fc5 100644 --- a/src/vsg/app/ViewMatrix.cpp +++ b/src/vsg/app/ViewMatrix.cpp @@ -50,7 +50,8 @@ void LookAt::set(const dmat4& matrix) dmat4 LookAt::transform(const vsg::dvec3& offset) const { - return lookAt(eye, center, up) * vsg::translate(offset-origin); + dvec3 delta = origin - offset; + return lookAt(eye + delta, center + delta, up); } dmat4 RelativeViewMatrix::transform(const vsg::dvec3& offset) const