Skip to content

Add OpenGL-backed 3D visualization with Python bindings and PyQt integration#27

Merged
cduarte0306 merged 2 commits into
mainfrom
copilot/integrate-opengl-3d-visualization
Jan 10, 2026
Merged

Add OpenGL-backed 3D visualization with Python bindings and PyQt integration#27
cduarte0306 merged 2 commits into
mainfrom
copilot/integrate-opengl-3d-visualization

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 9, 2026

The app needed a basic 3D renderer exposed from C++ via pybindings and embedded into the PyQt UI to visualize simple objects (e.g., a cube).

  • C++ OpenGL backend

    • Added Renderer3D with a minimal cube pipeline (clear color, basic projection, immediate-mode cube draw).
    • Linked OpenGL and made pybind11 available via submodule or FetchContent fallback.
    • Exposed renderer controls (set_clear_color, render_cube) through pybind11.
  • Python bindings/utilities

    • Added create_renderer3d helper in cpp_extensions to construct the C++ renderer with optional clear color.
    • Updated bindings to include Renderer3D.
  • UI integration

    • Added VisualizationWindow (QOpenGLWidget) with simple rotation control and status text.
    • Wired a new “3D View” entry in the side panel to display the visualization card in the main content area.
    • Documented OpenGL dev dependency in README.

Example (Python):

from utils import cpp_extensions

renderer = cpp_extensions.create_renderer3d((0.05, 0.09, 0.14, 1.0))
if renderer:
    renderer.set_clear_color(0.1, 0.2, 0.3, 1.0)
    # Called within an active OpenGL context (e.g., QOpenGLWidget.paintGL)
    renderer.render_cube(25.0, 35.0, 4.0, width=800, height=600)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Equip C++ with OpenGL for 3D Visualization and PyBindings Integration</issue_title>
<issue_description>Feature Overview

  • Integrate OpenGL (or another suitable library, e.g., Vulkan, Ogre) into the C++ core to support 3D visualization capabilities within the project.
  • Implement a basic 3D image renderer as a proof of concept, such as displaying a simple 3D model (cube, sphere, or car model).
  • Expose the 3D rendering functionality to Python via pybindings, enabling straightforward interaction from the Python layer.
  • Integrate the new 3D visualization features into the top-level PyQT UI so that 3D objects can be visualized directly in the application’s interface.

Acceptance Criteria

  • C++ codebase includes OpenGL (or selected library) with a working basic 3D rendering pipeline.
  • At least one demonstrative 3D object is rendered (such as a cube or a simple car representation).
  • Python pybindings are created for core 3D visualization routines.
  • PyQT UI is extended to display the rendered 3D scene/object within a GUI window.

Notes

  • Consider cross-platform compatibility in the choice of the 3D library.
  • Optional: Modularize the rendering code to allow easy future expansion (lighting, input, more complex objects, etc.).</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: cduarte0306 <31628377+cduarte0306@users.noreply.github.com>
Copilot AI changed the title [WIP] Add OpenGL integration for 3D visualization in C++ Add OpenGL-backed 3D visualization with Python bindings and PyQt integration Jan 9, 2026
Copilot AI requested a review from cduarte0306 January 9, 2026 22:05
@cduarte0306
Copy link
Copy Markdown
Owner

@copilot How does my system find OpenGL? No need to pull the library?

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 9, 2026

@copilot How does my system find OpenGL? No need to pull the library?

CMake uses FindOpenGL to locate the system OpenGL SDK; nothing is bundled. On Linux install headers like libgl1-mesa-dev libglu1-mesa-dev (already used in CI); on Windows it links against the platform OpenGL32.lib that ships with the OS/SDK; on macOS it uses the system OpenGL framework. Pybind is fetched if the submodule is missing, but OpenGL must be present on the host. UI capture of the new 3D view (headless capture; rendering disabled without a GL context): https://github.com/user-attachments/assets/390254b0-2018-4cba-b6cb-31707339c760

@cduarte0306 cduarte0306 marked this pull request as ready for review January 10, 2026 00:45
@cduarte0306 cduarte0306 merged commit 9ac196c into main Jan 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Equip C++ with OpenGL for 3D Visualization and PyBindings Integration

2 participants