Show HN: ImPlot3D – A 3D Plotting Library for Dear ImGui

brenocq | 170 points

It is actually quite amazing how well the idea of reusable components works for Dear ImGui which doesn't have any obvious 'extension points' for components built into the API. Instead components are just regular functions which compose higher level UI widgets from builtin widgets and maybe dropping down into the ImDrawList renderer (which is also used by the builtin widgets to draw themselves).

And just like integrating Dear ImGui itself, integrating a component is just dropping a couple of source files into your project.

flohofwoe | 23 days ago

That is very nice. Almost wish I had a use for it.

db48x | 23 days ago

How did you create the rotated labels? That's been a major pain point for me using ImGui, I wish there was native support for that.

valine | 23 days ago

Beautiful. Need a port of this for the rust equivalent: eGui. Maybe I'll get on it one of these days.

ilrwbwrkhv | 23 days ago

I was working on an app using ImGui. Eventually, I noticed that my MacBook battery was draining whenever my app was running. Is this because immediate mode GUI rendering is inefficient?

pro14 | 23 days ago

Wonderful! But I see the picture you included in the README. It looks a little weird when zoomed in; the coordinates don't zoom together.

jhx2000 | 23 days ago
[deleted]
| 23 days ago

I have tried running the example in the examples folder, but it fails to compile. Seeing the errors:

    /opensource/implot3d/implot3d.cpp:2650:20: error: no member named 'sin' in namespace 'std'
 2650 |     float s = std::sin(half_angle);
      |               ~~~~~^
  /opensource/implot3d/implot3d.cpp:2654:14: error: no member named 'cos' in namespace 'std'
 2654 |     w = std::cos(half_angle);
      |         ~~~~~^
  /opensource/implot3d/implot3d.cpp:2670:14: error: no member named 'fabs' in namespace 'std'
 2670 |     if (std::fabs(normalized_dot - 1.0f) < epsilon) {
      |         ~~~~~^
  /opensource/implot3d/implot3d.cpp:2680:14: error: no member named 'fabs' in namespace 'std'
 2680 |     if (std::fabs(normalized_dot + 1.0f) < epsilon) {
      |         ~~~~~^
  /opensource/implot3d/implot3d.cpp:2682:45: error: no member named 'fabs' in namespace 'std'
 2682 |         ImPlot3DPoint arbitrary_axis = std::fabs(v0.x) > std::fabs(v0.z) ? ImPlot3DPoint(-v0.y, v0.x, 0.0f)
      |                                        ~~~~~^
  /opensource/implot3d/implot3d.cpp:2682:63: error: no member named 'fabs' in namespace 'std'
 2682 |         ImPlot3DPoint arbitrary_axis = std::fabs(v0.x) > std::fabs(v0.z) ? ImPlot3DPoint(-v0.y, v0.x, 0.0f)
      |                                                          ~~~~~^
  /opensource/implot3d/implot3d.cpp:2695:24: error: no member named 'acos' in namespace 'std'
 2695 |     float angle = std::acos(normalized_dot);
      |                   ~~~~~^
  /opensource/implot3d/implot3d.cpp:2697:20: error: no member named 'sin' in namespace 'std'
 2697 |     float s = std::sin(half_angle);
      |               ~~~~~^
  /opensource/implot3d/implot3d.cpp:2701:16: error: no member named 'cos' in namespace 'std'
 2701 |     q.w = std::cos(half_angle);
      |           ~~~~~^
  /opensource/implot3d/implot3d.cpp:2707:17: error: no member named 'sqrt' in namespace 'std'
 2707 |     return std::sqrt(x * x + y * y + z * z + w * w);
      |            ~~~~~^
  /opensource/implot3d/implot3d.cpp:2786:26: error: no member named 'acos' in namespace 'std'
 2786 |     float theta_0 = std::acos(dot);        // Angle between input quaternions
      |                     ~~~~~^
  /opensource/implot3d/implot3d.cpp:2788:28: error: no member named 'sin' in namespace 'std'
 2788 |     float sin_theta = std::sin(theta);     // Sine of interpolated angle
      |                       ~~~~~^
  /opensource/implot3d/implot3d.cpp:2789:30: error: no member named 'sin' in namespace 'std'
 2789 |     float sin_theta_0 = std::sin(theta_0); // Sine of original angle
      |                         ~~~~~^
  /opensource/implot3d/implot3d.cpp:2791:21: error: no member named 'cos' in namespace 'std'
 2791 |     float s1 = std::cos(theta) - dot * sin_theta / sin_theta_0;
mike_kamau | 23 days ago

DearImGui and ImPlot are so good. This is a delightful addition to the family.

I’ve been having to look at some react code lately. My god how I wish I were writing DearImGui code instead.

forrestthewoods | 23 days ago

Does anyone have examples of something made with ImGui that has good looking text and antialiasing? It seems like a really cool tool, but everything made with it seems to have a characteristic "crunchy" look.

Fraterkes | 23 days ago

Interesting!

Consider adding screenshots to the readme.

laurentlb | 23 days ago

[flagged]

bradhe | 23 days ago