Skip to content

pycvc_gl: render_png_camera — offscreen render with an explicit camera - #159

Merged
transfix merged 2 commits into
masterfrom
feat/render-png-camera
Jul 26, 2026
Merged

pycvc_gl: render_png_camera — offscreen render with an explicit camera#159
transfix merged 2 commits into
masterfrom
feat/render-png-camera

Conversation

@transfix

Copy link
Copy Markdown
Owner

What

render_png() auto-frames the whole scene (ResetCamera), so it can't be used to script a chase camera across frames. This adds:

void render_png_camera(SceneGraph &sg, const std::string &path, int width, int height,
                       double eye_x, double eye_y, double eye_z,
                       double focal_x, double focal_y, double focal_z,
                       double up_x, double up_y, double up_z,
                       double view_angle = 30.0, double clip_near = 1.0, double clip_far = 1e5);

Same offscreen path as render_png, but sets the camera explicitly (position / focal point / up + view angle + clip range) instead of ResetCamera(). 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" in pycvc_gl.i, so it surfaces as pycvc_gl.render_png_camera(sg, path, w, h, ex,ey,ez, fx,fy,fz, ux,uy,uz, view_angle, near, far) after a pycvc_gl rebuild.

Note

Two-file change (pycvc_scene.cpp + .h); it is a direct mirror of render_png with SetPosition/SetFocalPoint/SetViewUp/SetViewAngle/SetClippingRange swapped in for ResetCamera. Not build-tested in my checkout (no configured pycvc_gl build tree locally) — relying on CI to build the bindings.

Joe Rivera 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.
@transfix
transfix merged commit 01ec68d into master Jul 26, 2026
5 of 7 checks passed
@transfix
transfix deleted the feat/render-png-camera branch July 26, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant