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)