-
Notifications
You must be signed in to change notification settings - Fork 349
Closed
Closed
Copy link
Description
Bug Description
When calling render_box()
on the OpenGL visualizer it currently only hashes the extents and not the color, which means you can't draw multiple boxes of the same size with different colors, simple repro that should draw a red and blue box:
import warp as wp
import warp.render
import numpy as np
def test_opengl_renderer_boxes():
"""Test OpenGLRenderer by rendering a couple of boxes"""
# Create the OpenGL renderer
renderer = wp.render.OpenGLRenderer(
title="Test Boxes",
screen_width=800,
screen_height=600,
camera_pos=(5.0, 5.0, 5.0),
camera_front=(-1.0, -1.0, -1.0),
vsync=False
)
frame_count = 0
max_frames = 1024
try:
while renderer.is_running() and frame_count < max_frames:
time = renderer.clock_time
renderer.begin_frame(time)
# Render first box - red, stationary
renderer.render_box(
name="box1",
pos=(0.0, 1.0, 0.0),
rot=wp.quat_identity(),
extents=(1.0, 1.0, 1.0),
color=(1.0, 0.0, 0.0) # Red
)
# Render second box - blue, rotating
rotation_angle = time * 2.0 # Rotate over time
rotation_quat = wp.quat_from_axis_angle(
wp.vec3(0.0, 1.0, 0.0), rotation_angle
)
renderer.render_box(
name="box2",
pos=(3.0, 1.0, np.sin(time)), # Move up and down
rot=rotation_quat,
extents=(1.0, 1.0, 1.0),
color=(0.0, 0.0, 1.0) # Blue
)
renderer.end_frame()
frame_count += 1
finally:
# Clean up the renderer
renderer.clear()
renderer.close()
if __name__ == "__main__":
test_opengl_renderer_boxes()
System Information
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working