Skip to content

Meshcat support for set_object with object.textures.type=_text #20884

Open
@jwnimmer-tri

Description

@jwnimmer-tri

Is your feature request related to a problem? Please describe.

Upstream Meshcat.js has the capability to use text as a texture. (See here for a demo.)

However, the Drake C++ Meshcat API does not offer any way to transmit the set_object message with those fields.

Describe the solution you'd like

Add another Meshcat::SetObject() overload to send this message. Something like:

 /** Sets the 3D object at a given `path` in the scene tree to the given shape
  whose material will be the given text (rendered onto canvas).
  The shape must be a primitive shape (not a mesh file). */
  void SetObject(std::string_view path, const Shape& shape, std::string_view text,
                 const Rgba& rgba = Rgba(.9, .9, .9, 1.));

Describe alternatives you've considered

Allow the user to give us arbitrary JSON for the object in a set_object and we could just pass that along.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions