From 6ff46b9bec561273e09faab073835264987c6ddf Mon Sep 17 00:00:00 2001 From: John Goetz Date: Tue, 11 Feb 2025 08:52:42 -0800 Subject: [PATCH] vsgcameras demo of viewport partially off screen The overlay views are partially off the screen. The initial rendering is good, but the model snaps to the scissors of the overlays when the window is resized. This is because the viewport gets set to the scissor in the viewportstate. It was expected that the viewport and the scissor remain independent and should be resized individually. --- examples/app/vsgcameras/vsgcameras.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/app/vsgcameras/vsgcameras.cpp b/examples/app/vsgcameras/vsgcameras.cpp index 107d9c5d..dacd9222 100644 --- a/examples/app/vsgcameras/vsgcameras.cpp +++ b/examples/app/vsgcameras/vsgcameras.cpp @@ -286,9 +286,11 @@ int main(int argc, char** argv) for (auto& [nodePath, camera] : scene_cameras) { // create a RenderGraph to add a secondary vsg::View on the top right part of the window. - auto projectionMatrix = camera->projectionMatrix; + auto projectionMatrix = vsg::Perspective::create(30.0, static_cast(secondary_width) / static_cast(secondary_height), + nearFarRatio * radius, radius * 4.5); auto viewMatrix = vsg::TrackingViewMatrix::create(nodePath); - auto viewportState = vsg::ViewportState::create(x, y, secondary_width, secondary_height); + auto viewportState = vsg::ViewportState::create(x + 150, y, secondary_width, secondary_height); + viewportState->scissors[0].extent.width -= 150; auto secondary_camera = vsg::Camera::create(projectionMatrix, viewMatrix, viewportState);