Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add billboard capability #139

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

kingjin94
Copy link

@kingjin94 kingjin94 commented Jul 3, 2023

Add sprite drawing as a way to add billboards (2D text annotations that always face the camera). Allows to write text unto the scene.

The underlying changes to meshcat are proposed in this PR: meshcat-dev/meshcat#145

An example:

Screenshot from 2023-07-03 14-26-30

Code to recreate the screenshot:

import meshcat
import numpy as np
t = meshcat.geometry.BillboardObject("test444", 75, 16, 0.01)

# !pip install timor-python
from timor.utilities import prebuilt_robots  
r = prebuilt_robots.get_six_axis_assembly()
viz = r.robot.visualize()

viz.viewer["test"].set_object(t)
viz.viewer["test"].set_transform(np.asarray(((1, 0., 0., 1.), (0, 1, 0, 1),(0, 0, 1, 0),(0, 0, 0, 1.))))

# Alternative w/out robot
viz = meshcat.Visualizer()
viz.initViewer()
viz["test"].set_object(t)
viz["test"].set_transform(np.asarray(((1, 0., 0., 1.), (0, 1, 0, 1),(0, 0, 1, 0),(0, 0, 0, 1.))))

@kingjin94 kingjin94 mentioned this pull request Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant