pycvc_gl: render_png_camera — offscreen render with an explicit camera - #159
Merged
Conversation
added 2 commits
July 26, 2026 17:37
render_png() auto-frames the whole scene (ResetCamera), so it can't script a chase camera. Add render_png_camera(sg, path, w, h, eye, focal, up, view_angle, clip) — same offscreen path, but sets the camera explicitly — so callers can render a sequence of frames from a moving camera (e.g. capturing a learned-driving demo to video) without a live window. Auto-wrapped via the header %include; needs a pycvc_gl rebuild to surface in Python. NOTE: not build-tested in this checkout (no configured pycvc_gl build tree here); it is a direct mirror of render_png with SetPosition/SetFocalPoint/SetViewUp/ SetViewAngle/SetClippingRange in place of ResetCamera. CI builds the bindings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
render_png()auto-frames the whole scene (ResetCamera), so it can't be used to script a chase camera across frames. This adds:Same offscreen path as
render_png, but sets the camera explicitly (position / focal point / up + view angle + clip range) instead ofResetCamera(). That makes offscreen rendering usable for frame-by-frame capture from a moving camera — e.g. rendering a learned-navigation drive to video without a live window, purely OpenGL offscreen.Auto-wrapped for Python via the existing
%include "pycvc_scene.h"inpycvc_gl.i, so it surfaces aspycvc_gl.render_png_camera(sg, path, w, h, ex,ey,ez, fx,fy,fz, ux,uy,uz, view_angle, near, far)after apycvc_glrebuild.Note
Two-file change (
pycvc_scene.cpp+.h); it is a direct mirror ofrender_pngwithSetPosition/SetFocalPoint/SetViewUp/SetViewAngle/SetClippingRangeswapped in forResetCamera. Not build-tested in my checkout (no configured pycvc_gl build tree locally) — relying on CI to build the bindings.