koide3 / iridescence

3D visualization library for rapid prototyping of 3D algorithms
https://koide3.github.io/iridescence/
MIT License
295 stars 32 forks source link

Grouping drawables #100

Open koide3 opened 6 months ago

koide3 commented 6 months ago

https://github.com/koide3/iridescence/issues/84#issuecomment-1987261782

Seekerzero commented 4 months ago

Hi Koide, I was finally settling down after coming back from the Japan (It is nice to meet with you in person :). Please let me know if there is any features I can help you to test with. Thanks.

koide3 commented 3 months ago

It was really nice to meet you too! It was one of the big moments at ICRA for me :)

Last a few weeks, I didn't have enough time to work on Iridescence because I had another domestic conference and many tasks (and my ubuntu PC at home got some troubles :( ) after ICRA. But, I'm getting back to my usual daily life, and will soon bring some improvements. At that time I'll ask you for help testing new features.

koide3 commented 3 months ago

@Seekerzero Sorry for making you wait for a while. I just updated DrawableTree in the grouping branch. This class enables grouping drawables in a tree structure. The basic usage is as follows. I would be glad if you could test it and tell me if there are some features to be added.

#include <guik/drawable_tree.hpp>

auto tree = std::make_shared<DrawableTree>();
// Register drawables to the tree.
tree->update_drawable("parent/child/node1", drawable1, guik::VertexColor(node1_matrix));
tree->update_drawable("parent/child/node2", drawable2, guik::VertexColor(node2_matrix));
// Update shader settings. This matrix is applied to both "node1" and "node2".
tree->update_setting("parent/child", guik::ShaderSetting(child_matrix));

// Overwrite the color settings of all children of "parent/child".
tree->update_tree_color_mode("parent/child", guik::ColorMode::FLAT_COLOR);
tree->update_tree_color("parent/child", Eigen::Vector4f(0.0f, 0.0f, 1.0f, 1.0f));

// Overwrite the point scale of all children of "parent/child".
tree->update_tree_setting("parent/child", "point_scale", 2.0f);

// Output the tree structure to stdout for debugging.
tree->print_tree();

viewer->update_drawable("tree", tree);
Seekerzero commented 3 months ago

Thank you! Sure, I will test them and let you know.

Seekerzero commented 3 weeks ago

Hi Koide, I was refactoring my code and am ready to test the grouping drawable feature. Could you help me merge the current master branch into the grouping branch? So I don't need to revert the settings to the older branches. Thanks!

koide3 commented 1 week ago

Hi @Seekerzero , It's been a while! Sorry for the late response. I was occupied by a paper deadline last a few weeks. I fixed some conflicts and merged master into grouping branch: https://github.com/koide3/iridescence/pull/106

Seekerzero commented 1 week ago

I totally understand that it was the ICRA due day. I know it :) Thanks for the help!