3D graphics library for .NET

54,913

Solution 1

Take a look at SlimDX. It's an open-source, free, managed library for DirectX (DirectX 11). Each release coincides with a DirectX release, so most of the time it's pretty up-to-date. I've used it and it was quite easy to get started. Here (scroll down) is a comparison with other possibilities you mentioned.

Solution 2

In the OpenGL world I have been using OpenTK. I had to build on top of the existing code with C# to get to display flat geometrical objects without shading and realistic effects.

Here is an example:

render

Generated from the code:

void InitModels()
{
    Scene.CoordinateSystem cs1 = new Scene.CoordinateSystem(world.Ground)
    {
        DrawSize = 1,
        Visible = false
    };
    Scene.CoordinateSystem cs2 = new Scene.CoordinateSystem(world.Ground, 0.6 * vec3.J)
    {
        DrawSize = 0.5,
        Orientation = rot3.RotateXDegrees(-15)
    };
    Scene.Cube cube = new Scene.Cube(cs1)
    {
        CubeSize = 0.5
    };
    cs2.AddPoint(new point3(vec3.O,1), Color.Firebrick, 15);
    var line = cs2.AddLine(new line3(-vec3.I, vec3.I), 20, Color.SlateGray, 2);
    line.SetPattern(0xFF0F, GeometryTest.Scene.Stripple.Scale2);

    cube.BindTexture(5, GeometryTest.Properties.Resources.julia, true);
    cube.AddText(3, "OpenTK 1.0", Color.DarkMagenta, 0.5f, 0.5f, 1.0f);

}

Solution 3

The simplest is probably to use WPF 3D. This is a retained mode graphics system, so if you don't have huge needs (ie: special shaders for effects, etc), it's very easy to setup and use directly.

Otherwise, a more elaborate 3D system, such as XNA, may be more appropriate. This will be more work to setup, but give you much more control.

  1. Tutorial 1: Displaying a 3D Model on the Screen
  2. WPF
  3. XNA
Share:
54,913
Janman
Author by

Janman

merge keep

Updated on July 09, 2022

Comments

  • Janman
    Janman almost 2 years

    I would like to learn to make simple 3D applications for Windows 7 / desktop. By that, I mean spheres, triangles or pixels moving around in 3D space. It does not have to be very complicated as of yet. For this, I would like to use C# language with .NET (Java/C++ is my second priority).

    I know this has been asked many times around the internet, but I feel like many of the questions are outdated, many APIs deprecated and tutorials too old.

    I was thinking about learning XNA, but then I learned that Microsoft does not plan to develop and support it anymore. SharpDX also seemed like a good way to go, but that seems to be aimed for Windows Store and Phone apps.

    While looking on the internet, Managed DirectX seemed exactly what I was looking for (the syntax, the complexity), but again, that is way too deprecated for me to use.

    Can you please guide me what I should learn to create simple yet solid 3D applications?

    • John Alexiou
      John Alexiou about 11 years
      Look at OpenTK and renderstack it is not DirectX, but OpenGL.
    • Janman
      Janman about 11 years
      #Ja75 Thanks for the comment. I have looked at OpenTK, but it worries me a little. It seems that there is no updates since 2010 and there are some compatibility problems with newer version of VS.
    • Robert Rouhani
      Robert Rouhani about 11 years
      The 2010 release is a bit old, but the SVN trunk is stable. I've been using it for a while with no issues. If you want something a bit more cutting edge, there's a fork of OpenTK on GitHub that a few of us have been contributing to since the original maintainer of OpenTK has been busy with life for the past while.
    • John Alexiou
      John Alexiou about 11 years
      @Janman - I have been using OpenTK for immediate mode OpenGL (direct draw of primitives) like you described.
    • xoofx
      xoofx about 11 years
      SharpDX supports Windows Desktop as well, as clearly stated on the website sharpdx.org
  • Janman
    Janman about 11 years
    Hello! This seems pretty much like what I am looking for. I will dig into it and report in a few days if this helped! Thanks a lot!
  • apaderno
    apaderno over 6 years
    See Notice of leave: It seems the project owner is not around, so the project will not be updated anymore.
  • Klemikaze
    Klemikaze over 3 years
    Links provided are no longer valid.