Visualizer#
The Visualizer class is the main orchestrator for all visualization and rendering in Genesis. It manages the viewer, cameras, and renderer backends.
Overview#
The Visualizer is automatically created when you create a Scene and is responsible for:
Managing the interactive
ViewerwindowCoordinating multiple
CamerainstancesHandling renderer backends (Rasterizer, Raytracer, BatchRenderer)
Synchronizing render state with simulation
Access#
The Visualizer is accessed through the scene:
import genesis as gs
gs.init()
scene = gs.Scene(show_viewer=True)
scene.build()
# Access the visualizer
visualizer = scene.visualizer
# Update the visualization
visualizer.update()
Common Operations#
Adding Cameras#
# Add a camera for rendering
cam = scene.add_camera(
res=(1280, 720),
pos=(3, 0, 2),
lookat=(0, 0, 0.5),
fov=40,
)
Updating the View#
# Update visualization each step
for i in range(1000):
scene.step()
scene.visualizer.update()
Controlling the Viewer#
# Access the interactive viewer
viewer = scene.visualizer.viewer
# Check if viewer is active
if scene.visualizer.viewer is not None:
# Viewer operations available
pass
API Reference#
- class genesis.vis.Visualizer(scene, show_viewer, vis_options, viewer_options, renderer_options)[source]#
Bases:
RBCThis abstraction layer manages viewer and renderers.
- add_camera(res, pos, lookat, up, model, fov, aperture, focus_dist, GUI, spp, denoise, near, far, env_idx, debug)[source]#
- update_visual_states(force_render: bool = False)[source]#
Update all visualization-only variables here.
- property is_built: bool#
- property viewer#
- property rasterizer#
- property is_software#
- property batch_renderer#
- property context#
- property raytracer#
- property renderer#
- property scene#
- property has_display#
- property cameras#
- property segmentation_idx_dict#