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

Visualize solid shapes and attach frames to model frames #1163

Merged
merged 12 commits into from
Mar 25, 2024

Conversation

S-Dafarra
Copy link
Contributor

@S-Dafarra S-Dafarra commented Mar 15, 2024

This PR

  • allows visualizing solid shapes, like spheres, boxes, meshes, in the iDynTree visualizer. The solid shapes can also be attached to a link of a model.
  • Allows attaching a frame to a link (or a frame) of a model
  • Modifies idyntree-model-view to visualize a set of frames
  • Improves the transparency visualization of the models

cc @dariosortino

@S-Dafarra S-Dafarra self-assigned this Mar 15, 2024
@S-Dafarra S-Dafarra changed the title Visualize solid shapes Visualize solid shapes and attach frames to model frames Mar 18, 2024
@S-Dafarra
Copy link
Contributor Author

  • Improves the transparency visualization of the models

In order to do this, I had to play with the material flags. In particular, I had to use geomNode->setMaterialFlag(irr::video::EMF_COLOR_MATERIAL, false); to specify irrlicht to use the material color instead of the texture color (that we don't set) and geomNode->setMaterialFlag(irr::video::EMF_BLEND_OPERATION, true); to trigger the blending operation, necessary when visualing transparencies. Finally I had to use the irr::video::EMT_TRANSPARENT_VERTEX_ALPHA; material type. I noticed that this can make objects appear transparent even when they are not, so this is used only when the alpha component is different from 1.0. irrlicht still seem to have some issue in computing the correct transparency in case of multiple objects are overlapping, but I think it is a good trade-off

Copy link

@dariosortino dariosortino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (and to my narrow knowledge)!

CMakeLists.txt Outdated Show resolved Hide resolved
Co-authored-by: Silvio Traversaro <silvio@traversaro.it>
Copy link
Member

@traversaro traversaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@S-Dafarra S-Dafarra linked an issue Mar 25, 2024 that may be closed by this pull request
@traversaro traversaro merged commit 7e029b9 into robotology:master Mar 25, 2024
19 checks passed
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.

Add visualization of a subset of frames in idyntree-model-view
3 participants