newton.utils.SimRendererOpenGL#

class newton.utils.SimRendererOpenGL(model=None, path='No path specified', scaling=1.0, fps=60, up_axis=None, show_joints=False, show_particles=True, pick_stiffness=20000.0, pick_damping=2000.0, **render_kwargs)[source]#

Bases: SimRenderer

Real-time OpenGL renderer for Newton Physics simulations.

This renderer provides real-time visualization of physics simulations using OpenGL, with interactive camera controls and various rendering options.

Parameters:
  • model (newton.Model) – The Newton physics model to render.

  • path (str) – Window title for the OpenGL window.

  • scaling (float, optional) – Scaling factor for the rendered objects. Defaults to 1.0.

  • fps (int, optional) – Target frames per second. Defaults to 60.

  • up_axis (newton.AxisType, optional) – Up axis for the scene. If None, uses model’s up axis. Defaults to None.

  • show_rigid_contact_points (bool, optional) – Whether to show contact points. Defaults to False.

  • contact_points_radius (float, optional) – Radius of contact point spheres. Defaults to 1e-3.

  • show_joints (bool, optional) – Whether to show joint visualizations. Defaults to False.

  • **render_kwargs – Additional arguments passed to the underlying OpenGLRenderer.

Example

import newton

model = newton.Model()  # your model setup
renderer = newton.utils.SimRendererOpenGL(model, "Newton Simulator")
# In your simulation loop:
renderer.begin_frame(time)
renderer.render(state)
renderer.end_frame()

Note

Keyboard shortcuts available during rendering:

  • W, A, S, D (or arrow keys) + mouse: FPS-style camera movement

  • RIGHT-CLICK + DRAG: Pick and move rigid bodies

  • X: Toggle wireframe rendering

  • B: Toggle backface culling

  • C: Toggle coordinate system axes

  • G: Toggle ground grid

  • T: Toggle depth rendering

  • I: Toggle info text

  • SPACE: Pause/continue simulation

  • TAB: Skip rendering (background simulation)