Description
i asked (via email)
We're making pretty heavy use of meshcat in class again this term. I'm working on getting it into drake proper so the in-tree examples can use it, too:
RobotLocomotion/drake#9833But the current implementation that we have uses MeshLambertMaterial for all of the objects -- including the ones loaded from obj files. It looks like Meshcat does support texture maps. But if I leave the materials field = None for that call to SetObject, then I still don't see e.g. the kuka's textures.
Is there an easy fix that is right under my nose?
and the response was
The way textures are handled in meshcat is currently pretty manual. You need to set the
map
field to anImageTexture
, and that texture in turn needs itsimage
field set to aPngImage
. This is much
easier to explain with an example: https://github.com/rdeits/meshcat-python/blob/8b24ac3a72ea56fbb64fca5fcdb1782daa0961bf/src/meshcat/tests/test_drawing.py#L50-L57Currently, I don't try to do something clever like parse the
.mtl
file to load the texture, but I suspect that would be possible, perhaps with aMesh.from_file()
constructor.