3D graphics library for .NET [closed]
Asked Answered
E

3

22

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?

Expanded answered 20/2, 2013 at 18:53 Comment(5)
Look at OpenTK and renderstack it is not DirectX, but OpenGL.Birmingham
#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.Expanded
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.Alms
@Expanded - I have been using OpenTK for immediate mode OpenGL (direct draw of primitives) like you described.Birmingham
SharpDX supports Windows Desktop as well, as clearly stated on the website sharpdx.orgStesha
C
7

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.

Curmudgeon answered 20/2, 2013 at 19:6 Comment(2)
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!Expanded
Links provided are no longer valid.Prieto
M
6

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
Midrib answered 20/2, 2013 at 19:4 Comment(0)
B
6

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);

}
Birmingham answered 20/2, 2013 at 19:32 Comment(1)
See Notice of leave: It seems the project owner is not around, so the project will not be updated anymore.Chinfest

© 2022 - 2024 — McMap. All rights reserved.