Skip to content

Commit

Permalink
Update MeshcatVisualizer.cpp (robotology#1133)
Browse files Browse the repository at this point in the history
This is missing on the master branch to be able to visualize the alpha channel in urdf models too.
  • Loading branch information
G-Cervettini authored and flferretti committed Dec 23, 2024
1 parent 5b72d1f commit b6782ac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/visualization/src/MeshcatVisualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ struct MeshcatVisualizer::Impl

const iDynTree::Vector4 color = externalMesh->getMaterial().color();
material.set_color(color(0) * 255, color(1) * 255, color(2) * 255);
if (color(3) < 1)
{
material.opacity = color(3);
material.transparent = true;
}

const iDynTree::Transform transform = (world_H_frame * linkSolidShape->getLink_H_geometry());

Expand Down

0 comments on commit b6782ac

Please sign in to comment.