High Level .NET Graphic Library

I program various modeling tools in C # /. NET

What I'm looking for is a high-level visualization library; create a scene with a camera with some standard controls and make a few hunderd thousand spheres for it or some wireframes. That kind of thing. If several lines are required to initialize a context, it deviates from my ideal.

Ive looked at slimDX, but its path is lower than what I was looking for (at least the documented parts, but I really don't care about the others). The prospect of WPF looked cool, but it seems to be targeting static XAML scenes, and that doesn't work for me either.

Basically, I am looking for types of function languages ​​like blitzbasic. Does it even exist?

+6
c # data-visualization 3d
source share
4 answers

WPF's perspective looked cool, but it seems to be targeting static XAML specific scenes

Look again, WPF can be as dynamic as you ever need.

You can write any WPF program, including 3D, completely without XAML.

+4
source share

Perhaps XNA Game studio is what you are looking for.

Also see DirectX .

+3
source share

I am also interested in this (since I am also developing modeling tools) and have finished hacking some things in XNA. However, there is definitely a lot more work than you described. Note that everything you can do in WPF through XAML can also be done with code, because XAML is just a representation of the hierarchy of objects and its relationships. I think this may be your best bet, although I don’t have any indicators of what kind of performance you might expect with several hundred thousand spheres (in this case you need some sort of rejection, and rejection itself can be expensive if you don't use optimizations like mesh splitting.)


EDIT: if you really need to support 100K objects, and all of them can be represented as spheres, I would recommend that you completely bypass the 3D engine and use XNA only for math. I would suggest an approach like:

  • Use XNA to configure cameras (View) and Perspective Matrices. It has some convenient static Matrix functions that make it easy.

  • Calculate the projection matrix and project all points of origin of your sphere onto the view. This will give you the screen coordinates X, Y and the depth Z in focus. You can express this as 100K of individual matrix multiplications or multiplication of the Projection matrix by one 3 x 100K matrix of elements. In the first case, this is an excellent candidate for parallelism, using the new .NET 4. Parallel functionality.

  • If you find that 100K matrix multipliers are a problem, you can significantly reduce this by performing a screening of the points before the conversion, if you know that only a small number of points will be visible at a given time. For example, you can invert the Projection matrix to find the borders of your frust in the source space and create a bounding rectangle for frustration. Then you can exclude all points outside this field (simple comparative tests in X, Y and Z.) You only need to recalculate this bounding box when the projection matrix changes, so if it changes infrequently, this can be a reasonable optimization.

  • After you have your transformed points, fix everything outside the limits of truncation (Z <0, Z> maxDist, X <0, Y <0, X> width, Y> height). Now you can display each point by drawing a filled circle whose radius is proportional to Z (Z = 0 has the largest radius, and Z = maxDist will probably disappear to one point.) If you want to provide a feeling of shading / depth, you can do with a shaded brush to emulate lighting on spheres very freely. This works because everything in your scene is a sphere, and you probably don’t worry about things like shadows. All of this would be pretty easy to do in WPF (including Shaded Brush), but be sure to use the DrawingVisual classes, not the structure elements. In addition, you need to make sure that you draw the correct order Z, so it helps if you save the transformed points in a data structure, which is sorted as you add.

  • If you still have performance issues, you can continue to optimize. For example, if you know that only a subset of your points moves, you can cache the converted locations for fixed points. It really depends on the nature of your data set and how it develops.

  • Since your data set is so large, you might think about how to change its visualization. Instead of rendering 100 thousand points, divide the workspace into a three-dimensional grid and record the number (density) of points inside each grid cube. You can only design the center of the grid and display it as a “sphere” with some additional feedback (for example, color, opacity or brush texture) to indicate the density of the points. You can combine this method with the traditional rendering approach by rendering close points as “spheres” and far points as objects of a “cluster” with some brush pattern to match the density. One simple algorithm is to look at the restrictive sphere around the camera; all points inside the sphere will be transformed normally; outside the scope, you will only render using the density grid.

+3
source share

Do you need to use C # /. NET or MonoDevelop to be good enough? I can recommend http://unity3d.com/ if you want a powerful 3D engine.

0
source share

All Articles