Library for Mesh Generation in .Net? Library for Mesh Generation in .Net? wpf wpf

Library for Mesh Generation in .Net?


I've recently been wondering the same thing and arrived at the conclusion that OpenTK is easy to use for that. I think it gives more or less direct access to the OpenGL API and doesn't require loads of dependencies.

This is a bit copy'n'paste from my own question and answer, which is the result of me having tested a lot of different libraries over the past few days with the aim of making a point cloud based on the data I receive from my Kinect.

It does not provide an output to ViewPort3D, but from my tests it was way faster than using WPF. I was not able to display (and keep updating) a 640x480 point cloud in WPF at an acceptable speed.

It is comparatively easy to understand. It requires few (and understandable) lines of code to get started. It doesn't hold the objects for me so I'm free to change anything for each pass, which is great because I'm mainly working with unsafe pointers to memory.

It is of course difficult to combine speed with ease of use. Speed requires talking directly to the 3D API while ease of use requres abstraction. Therefore this must be considered a lower level API than some of the others I've tried. If I wanted to do some prefab character animation then XNA would probably be a better choice, but for point clouds this seems very promising so far (4-5 hours of hacking).

Some sample code:

private void Render(){   // Every frame   GL.Begin(BeginMode.Points);   GL.MatrixMode(MatrixMode.Modelview);   GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);   GL.LoadMatrix(ref cameraMatrix);   GL.Begin(BeginMode.Points);   // Here I can add lots of points. I add 200k without any big problem.   // It seems these points could have been passed in as an array pointer too,   //  but I'll look at that later.   GL.Vertex3(x2, y2, z2);   GL.End();   glControl.SwapBuffers();}