Question

I have some 3D data (xyz coordinates) that I am trying to represent as a 3D bar graph. What is the best way to visualize this in C++? I would also like to display different colors based on the z value. Any information about this would be great. Thanks in advance.

Was it helpful?

Solution

I imagine you were hoping for a turn-key solution to your problem, but, although I have seen a lot of 3D bar charts over the years, I don't have a library which I can point to and say "just use this." I once watched as researchers virtually walked around on top of a huge 3D bar chart in Second Life, discussing the depth of data exploration only immersion can offer.

The problem is that you need a dynamic view, with mouse input as a minimum. There are some libraries for 3D graphing, but those are for visualizing surfaces, which isn't really what you're after. Here's one with an ActiveX control interface for starters.

So now I'm thinking about graphical APIs, such as OpenGL and DirectX, where you could just draw the geometry yourself. But I'm not sure you know anything about graphics programming, and so getting a single triangle on screen will be a task, let alone 2*5*w*h triangles. No offense - its an actual GD ordeal.

So short of explaining how to do that in any reasonable way, now I'm wondering if I can simply sidestep the issue. You could use any number of graphing libraries to draw a matrix of charts, one for each slice in the grid. Or a 2D color heat map, where the color matches the Z value, as you suggested.

But that's not helpful, because you wanted a 3D bar chart. So maybe I can talk you out of it? While its been shown that people prefer 3D bar charts, they don't perform as well using them, compared to 2D representations. And if you want a 3D representation to be effective, you may need to employ stereo 3D or linked physical models.

I hope my ramblings have at least been amusing.

OTHER TIPS

Not free, but would this fit the bill? https://www.qt.io/blog/2013/11/07/qt-data-visualization-technology-preview-and-charts-1-3-1-release

Maybe: Use R, and a C++ binding library, like Rcpp.

Or perhaps: PLplot.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top