tags:

views:

364

answers:

5

image

How can I produce a similar output in C# window forms in the easiest way?

Is there a good library for this purpose? I just needs to be pointed in the direction of which graphic library is best for this.

+1  A: 

Checkout Microsoft Chart Controls library.

KMan
I have checked this, but can't find anything looks like this?
Qrew
+2  A: 

So a best library doesn't exist. There are plenty of them and some are just for different purposes. Here a small list of possibilities:

  • Tao: Make anything yourself with OpenGL
  • OpenTK: The successor of the Tao framework
  • Dundas: One of the best but quite expensive (lacks in real time performance)
  • Nevron: Quite good, but much cheaper (also has problems with real time data)
  • National Instruments: Expensive, not the best looking ones, but damn good in real time data.
  • ... Probably someone else made some other experiences.
Oliver
Well this "map" should be updated with realtime data at 10fps.Trust me I have googled, I'm looking for a little graphic library that can handle this.
Qrew
"a little graphic library" for something that works on real time data in 3D and allows movement of points doesn't sound like something small and easy.
Oliver
well I could write my own lib, but I need to found it which base library to use... just to get me started :) so A oint in the right direction would be nice
Qrew
So if you're really going to do this by yourself, you should start with Tao or OpenTK.
Oliver
+2  A: 

You should just roll your own in a 3d graphics library. You could use directx. If using WPF it is built-in, you can lookup viewport3d. http://msdn.microsoft.com/en-us/magazine/cc163449.aspx

In graphics programming what you are building is a very simple version of a heightmap. I think building your own would give your greater flexibility in the long run.

OG
Any suggestions what to use when writing this. gdi+ ? a wireframe graphic library would be nice, but I doubt it exist..
Qrew
Yeah, you could use gdi+. If so, this is a decent article.http://www.vcskicks.com/3d-graphics-improved.php
OG
A: 

Here's how I'd implement this using OpenGL.

First up, you will need a wrapper to import the OpenGL API into C#. A bit of Googling led me to this:

CsGL - OpenGL .NET

There a few example programs available to demonstrate how the OpenGL interface works. Play around with them to get an idea of how the system works.

To implement the 3D map:

  1. Create an array of vectors (that's not the std::vector/List type but x,y,z triplets) where x and y are along the horizontal plane and z is the up amount.
  2. Set the Z compare to less-than-or-equal (so the overlaid line segments are visible).
  3. Create a list of quads where the vertices of the quads are taken from the array in (1)
  4. Calculate the colour of the quad. Use a dot-product of the quad's normal and a light source direction to get a value to shade value, i.e. normal.light of 1 is black and -1 is white.
  5. Create a list of line segments, again from the array in (1).
  6. Calculate the screen position of the various projected axes points.
  7. Set up your camera and world->view transform (use the example programs to get an idea of how to do this).
  8. Render the quads and lines, OpenGL will do the transformation from world co-ordinates (the list in (1)) to screen space. Draw the labels, you might not want to do this using OpenGL as the labels shouldn't scale with distance from camera, otherwise they could get too small to read.

Since the above is quite a lot of stuff, there isn't really the space (and time on my part) to post working code (but someone else might add something if you're lucky). You could break the task down and ask questions on the parts you don't quite understand.

Skizz
CsGL hasn't been updated since 2002, i'm little doubtful to use a wrapper which is not maintained anymore? The final software will be closed source and shipped with a piece of hardware so it will have some comercial value.
Qrew
@Qrew: Why closed source? If it's sold with hardware, wouldn't it be pointless to copy the software? If you allow people to feed back alterations, you can get some innovative ideas from your users for little work (not to mention bug fixes!).
Skizz
You could always create your own wrapper to the OpenGL API. The OpenGL implementation is just a set a C functions in a DLL (look up pInvoke for more information).
Skizz
Or use DirectX, there's a C# interface for that already (made by Microsoft). The procedure is the same, just a different API.
Skizz
A: 

Have you tried this... gigasoft data visualization tools (Its not free)

And you can checkout the online wireframe demo here

Cheers

Ramesh Vel