20

Our software produces a lot of data that is georeferenced and recorded over time. We are considering ways to improve the visualisation, and showing the (processed) data in a 3D view, given it's georeferenced, seems a good idea.

I am looking for SO's recommendations for what 3D libraries are best to use as a base when building these kind of visualisations in a Delphi- / C++Builder-based Windows application. I'll add a bounty when I can.

The data

  • Is recorded over time (hours to days) and is GPS-tagged. So, we have a lot of data following a path over time.
  • Is spatial: it represents real 3D elements of the earth, such as the land, or 3D elements of objects around the earth.
  • Is high volume: we could have a point cloud, say, of hundreds of thousands to millions of points. Processed data may display as surfaces created from these point clouds.

From that, you can see that an interactive, spatially-based 3D visualisation seems a good approach. I'm envisaging something where you can easily and quickly navigate around in space, and data will load or be generated on the fly depending on what you're looking at. I would prefer we don't try to write our own 3D library from scratch - for something like this, there have to be good existing libraries we can work from.

So, I'm hoping for a library which supports:

  • good navigation (is the library based on Euler rotations only, for example? Can you 'pick' objects to rotate around or move with easily?);
  • modern GPUs (shader-only rendering is ok; being able to hook into the pipeline to write shaders that map values to colours and change dynamically would be great - think data values given a colour through a colour lookup table);
  • dynamic data / objects (data can be added as it's recorded; and if the data volume is too high, we should be able to page things in and out or recreate them, and only show a sensible subset so that whatever the user's viewport is looking at is there onscreen, but other data can be loaded/regenerated, preferably asynchronously, or at least quickly as the user navigates. Obviously data creation is dependent on us, but a library that has hooks for this kind of thing would be great.)
  • and technologically, works with Delphi / C++Builder and the VCL.

Libraries

There are two main libraries I've considered so far - I'm looking for knowledgeable opinions about these, or for other libraries I haven't considered.

1. FireMonkey

This is Embarcadero's new UI library, which is only available in XE2 and above. Our app is based on the VCL and we'd want to host this in a VCL window; that seems to be officially unsupported but unofficially works fine, or is available through third-parties.

The mix of UI framework and 3D framework with shaders etc sounds great. But I don't know how complex the library is, what support it has for data that's not a simple object like a cube or sphere, and how well-designed it is. That last link has major criticisms of the 3D side of the library - severe enough I am not sure it's worthwhile in its current state at the time of writing for a non-trivial 3D app.

Is it worth trying to write a new visualisation window in our VCL app using FireMonkey?

2. GLScene

GLScene is a well-known 3D OpenGL framework for Delphi. I have never used it myself so have no experience about how it works or is designed. However, I believe it integrates well into VCL windows and supports shaders and modern GPUs. I do not know how its scene graph or navigation work or how well dynamic data can be implemented.

Its feature list specifically mentions some things I'm interested in, such as easy rotation/movement, procedural objects (implying dynamic data is easy to implement), and helper functions for picking. It seems shaders are Cg only (not GLSL or another non-vendor-specific language.) It also supports "polymorphic image support for texturing (allows many formats as well as procedural textures), easily extendable" - that may just mean many image formats, or it may indicate something where the texture can be dynamically changed, such as for dynamic colour mapping.

Where to from here?

These are the only two major 3D libraries I know of for Delphi or C++Builder. Have I missed any? Are there pros and cons I'm not aware of? Do you have any experience using either of these for this kind of purpose, and what pitfalls should we be wary of or features should we know about and use?

We currently use Embarcadero RAD Studio 2010 and most of our software is written in C++. We have small amounts of Delphi and may consider upgrading IDEs, but we are most likely to wait until the 64-bit C++ compiler is released. For that reason, a library that works in RS2010 might be best.

Thanks for your input :) I'm after high-quality answers, so I'll add a bounty when I can!

Community
  • 1
  • 1
David
  • 13,360
  • 7
  • 66
  • 130
  • 3
    Why the downvote? If you can provide useful information about how to make this a better question, please do. – David Mar 06 '12 at 15:34
  • Why 3D? Have you considered 2D to start with? Spatiotemporal representations in 2D are a real challenge, and 3D is even harder. –  Mar 07 '12 at 09:47
  • @Tibo: good point. We already have good 2D visualisations, we think - we want to extend these and we think visualising the space in space (i.e., a 3D representation) is the next move. But you're right, in general 2D before 3D is probably a good thing :) – David Mar 07 '12 at 12:28

4 Answers4

8

I have used GLScene in my 3D geomapping software and although it's not used to an extent you're looking for I can vouch that it seems the most appropriate for what you're trying to do.

GLScene supports terrain rendering and adding customizable objects to the scene. Objects can be interacted with and you can create complex 3D models of objects using the various building blocks of GLScene. Unfortunately I cannot state how it will work with millions of points, but I do know that it is quite optimized and performs great on minimal hardware - that being said - the target PC I found required a dedicated graphics card capable of using OpenGL 2.1 extensions or higher (I found small issues with integrated graphics cards).

The other library I looked at was DXscene - which appears quite similar to GLScene albeit using DirectX instead of OpenGL. From memory this was a commercial product where GLScene was licensed under GPL. (EDIT - the page seems to be down at the moment : http://www.ksdev.com/index.html)

GLScene is still in active development and provides a fairly comprehensive library of functions, base objects and texturing etc. Things like rotation, translation, pitch, roll, turn, ray casting - to name a few - are all provided for you. Visibility culling is provided for each base object as well as viewing cameras, lighting and meshes. Base objects include cubes, spheres, pipes, tetrahedrons, cones, terrain, grids, 3d text, arrows to name a few. Objects can be picked with the mouse and moved along 1,2 or 3 axes. Helper functions are included to automatically calculate the top-most object the mouse is under. Complex 3D shapes can be built by attaching base objects to other base objects in a hierarchical manner. So, for example, a car could be built using a rectangle as the base object and attaching four cylinders to it for the wheels - then you can manipulate the 'car' as a whole - since the four cylinders are attached to the base rectangle.

The only downside I could bring to your attention is the sometimes limited help/support available to you. Yes, there is a reference manual and a number of demo applications to show you how to do things such as select objects and move them around, however the reference manual is not complete and there is potential to get 'stuck' on how to accomplish a certain task. Forum support is somewhat limited/sparse. If you have a sound knowledge of 3D basics and concepts I'm sure you could nut it out.

As for Firemonkey - I have had no experience with this so I can't comment. I believe this is more targeted at mobile applications with lower hardware requirements so you may have issues with larger data sets.

Here are some other links that you may consider - I have no experience with them:

The last one is targeted at game development - but may provide useful information.

Community
  • 1
  • 1
Simon
  • 9,197
  • 13
  • 72
  • 115
  • 1
    Thanks Simon! I believe the KSDev IP was bought to provide the basis for FireMonkey. It sounds like GLScene is a worthwhile library from what you say. The other links look interesting, although (part from TrueVision) less professional / likely to be high quality, although it's hard to judge from a website. – David Mar 08 '12 at 12:47
  • 1
    Oh and the other plus with GLScene is that its still actively developed. Hope the installation process has gotten a little smoother! One thing you may have to test before going to deep is how the renderer will handle your mesh's dataset size – Simon Mar 08 '12 at 15:56
  • I think GLScene seems the way to go. I haven't had time to try it out yet, but I've done some more reading etc about it. I'll give this answer the bounty :) – David Mar 13 '12 at 10:11
  • The best way to get started is to install and run the demos. Get to know the reference manual. Then, if you have any specific questions ask them on here and im sure someone will point you in the right direction! – Simon Mar 15 '12 at 03:35
  • GLScene is [licensed](http://glscene.sourceforge.net/wikka/GlsceneFaq#q_gen_002) under MPL. – JRL Aug 01 '13 at 10:20
5

Have you tried glData? http://gldata.sourceforge.net/ It is old (~2004, Delphi 7), and I have not personally used the library, but some of the output is amazing.

David A
  • 379
  • 1
  • 5
  • 15
  • Interesting! Looks like it's layered on top of GLScene and provides extra scientific / visualisation functions. Thanks, I'll look into this :) – David Mar 08 '12 at 11:36
1

Since you are already using georeferenced data, maybe you should consider embedding GoogleEarth in your Delphi application like this? Then you can add data to it as points, paths, or objects.

avra
  • 3,690
  • 19
  • 19
  • Thanks avra. I think we'll probably have more dynamic (and greater quantities) of data than Google Earth could handle well. But, thanks for the suggestion! – David May 08 '12 at 19:08
1

you can use the GLScene or OpenGL they are good 3D rendering and its very easy to use.

XBasic3000
  • 3,418
  • 5
  • 46
  • 91
  • 1
    GLScene is a high-level library around OpenGL. OpenGL itself is too low-level - it's something you would use as a basis for writing the libraries you need for this kind of visualisation. – David Mar 08 '12 at 11:35