3D scene graph for .NET - c#

Is there any scene graph implementation for Windows Forms in .NET? It doesn't need to be free, but it can't be WPF.
I have to create a part of a bridge and color the stress accordingly. Interactive rotation would be nice, as well as zoom. I think DirectX or OpenGL would be fine.
A custom solution via XNA seems too complicated. I rather want to use a library, which provides higher level objects - optimally a scene graph, minimally triangles and light.

ILNumerics provides a scene graph in 3D. And supports Windows.Forms. Here are some examples.
Edit: It for sure is free: GPL version 3

You can do XNA rendering within Windows Forms it seems:
http://www.google.com/search?q=xna+windows+forms

There's SlimDX which wraps DirectX for .Net. I've gotten samples to work, but I'm new to 3D programming and there isn't much documentation on how to use SlimDX beyond the simplistic tutorials.
Unity3D is a game engine which might meet your needs with a straight-forward installation and 3D modeling import and view. No step-through debugger though, if that matters.
XNA might be a good choice, but I switched to evaluate SlimDX because of some concerning limitations Microsofts forces in networking gamer-services I saw early on. It made me think there would be other limitations that I wouldn't be able to bypass. Also, I was interested in more flexibility in performance and higher-quality realtime effects than I believed that XNA can provide. I'd be interested in others thoughts on whether such fears about XNA are founded. Perhaps they're not an issue for your stress visualization project.

Related

What's the deal with Monogame, SharpDX, and XNA?

I've been doing research on good tools to create games with, and I came across Monogame, Sharpx, and XNA. I have some questions regarding each:
When I create a new windows project (which advertises that it uses DirectX 12), the code template looks like this:
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
I understand Monogame is a re-implementation of XNA, but where is the "re" part? This code shows Monogame using Microsoft's XNA, and doesn't even hint at the usage of DirectX 12.
SharpDX has an advantage of using WinRT (so i've heard), but what exactly does that mean to me? I know that SharpDX is a layer that sits on top of DirectX to allow it to be used in C#, and naturally should use WinRT. What excuse does Monogame have not to use WinRT?
I feel I'm confused at something and want clarity. Keep in mind that I'm a total noob at this stuff, anything helps!
MonoGame is indeed a reimplementation of XNA. It uses Microsoft.Xna.Framework.* namespaces to preserve source code compatibility with XNA projects. MonoGame does not currently support DirectX 12 - the desktop version has DirectX 11 and OpenGL backends.
It provides simple, cross-platform classes for common game tasks (loading content, rendering, sound playback, etc.) and a pipeline for building runtime-optimized content files. MonoGame is really powerful for most projects and great for quick development, though not a fully featured game engine like Unity. Since it is modelled after XNA (discontinued a few years ago), most XNA samples/tutorials work just fine.
SharpDX is a low-level wrapper of DirectX types. You should go with it only if you want to get your hands dirty with low-level plumbing, which doesn't appear to be the case.
The DirectX implementation of MonoGame (used for classic Windows, UWP, and Windows 8 apps) internally uses SharpDX for communicating with DirectX. When it comes to WinRT, it is just an implementation detail of "modern" Windows app platform.
Wikipedia has a few pages on the history of XNA. In short it is no longer supported. MonoGame extends it. SlimDX and SharpDX use their own DirectX wrappers and are basically copies of each other. Going by a recent post SlimDX future
It will not be continued. I do not know MonoGame but am strong in SharpDX and it provides current support for DirectX 12. If you also want to use OpenGL, you could try ANX but I do not know it. The SharpDX guy also wrote a Collada class which is on GitHub and there is an Assimp class that is compatible. None of the above have an integrated physics system but PhysX for .Net works fine with SharpDX.
In summary if you only need Direct X for C# then SharpDX would be the most straight forward choice. If you think you might expand to other platforms, you might want to check out MonoGame or ANX but I can't vouch for either. None of the above mentioned are complete Game Engines (such as Unity or UE4) they simply allow the use of features such as DirectX that are not natively supported by Visual Studio C#.

C# Equivalent to java's Graphics2D

I've recently started about thinking about making a 2D game engine in C# from scratch.
Now, I've wondered: In java, I'd use the java.awt.Graphics2d and java.awt.Container classes.
What would you suggest me to use in C#?
Apparently, google couldn't help me with that one.
In .NET you could use Windows Presentation Foundation, it offers a great lot of graphic-manipulation. But if it fits to create a game-engine, I am not sure.
See MSDN for an overview.
Though, if you really want to have power, you should stick with DirectX and C++.
Note: there is FNA and MonoGame (both reimplementations of the now discontinued XNA), but they are both frameworks for creating games, not creating a game engine...
You can easily build games (2D/3D) with FNA or MonoGame (reimplementations of the now discontinued XNA). They aren't engines but they are both a layer architecture for simple DirectX-usage.
If you're looking for image manipulation within Windows Forms (PictureBox, Draw()-method overrides) you should have a look at System.Drawing.

How to draw and process some 3D points?

I have some points like
1,2,3
1,1,1
2,3,4
2,5,6
9,10,2
66,43,23
I want to draw and see them in the page but I don't know how can I do this. I read a little about XNA but I think there is better way. Can you help me?
update
I want to simulate 3D points as 3DMax does. it means have a 3d shape and can look it in all degrees.
What you need is a 3d graphics drawing API.
There are 2 main ones:
OpenGL
Direct3D
OpenGL is cross platform and is used on mobile devices like Android and iPhone.
Direct3D is Microsoft specific and generally is for Windows platform only.
Don't overestimate the value of building a cross-platform app. If it's a small pet project and you're not planning to go cross platform in the future, don't choose a more difficult API just because it's cross platform.
Programming OpenGL quite easy to start with via GLUT from C++, and there are tons of simple examples on the web
You can also use Direct3D via XNA, which is also easy to start with. There are a huge number of XNA 4.0 tutorials on youtube (I haven't watched it, it just has a very green likes bar!) and also the msdn tutorials

is opengl suitable for making simulator of robotic arm or any other would be best for this purpose?

i m final year student want to make simulator for my robotic arm using opengl as i have command on c sharp so i would do coding using c sharp.
now have a query that would it be better to use opengl for simulator preparation or rather any other software(tool) will be best for the achievement of this task.
DO inform me
i would be grateful to u
thanks in advance
Let's get one thing straight: OpenGL is a graphics API. It can help you draw things to the screen, but it will not help you with "simulator preparation" (whatever that means).
If your program needs to display 3D graphics, OpenGL is one way to accomplish this. Direct3D would be another way, if you're on Windows (likely, since you're using C#).
However, both APIs have a learning curve, and it will take you a while to get up to speed with them. If your purpose is to display some simple 3D graphics without having to worry too much about the implementation, it may be better to use some engine or library on top of either OpenGL or Direct3D. I have no experience in this area, but you might want to look for something that allows you to load models from a file, and lets you render them in a few simple statements.
opengl or direct3d are great for rendering the 3Dimensional object, but for the simulation of the robot you should use a framework that offers you a scenegraph and/or a physics engine
have a look at the various gaming engines like ogre, or have a look at the blender game engine.
Here is one good OpenGL library for C#. Note that graphics is only a small part of what you'll need. Is your intention to create your own kinematics model or are you planning to use a physics system to articulate the robot based on raw 'servo' commands? If you want an off-the-shelf physics system, a good one is NVidia PhysX, though you have to explicitly register as a developer with them to get the API and it's in C++ (so you'd have to use C++/CLI To make good use of it.)

How should I start playing with 3D?

I'm a developer for just about 6 months now, and since I enjoy programming I've started little programs such as encripters, calculators, tools, stuff to play with DropBox (hehe), stuff that play with bitmaps, drawing graphics, and even a program to update the MSN display image according to the artwork of the music you're listening yo on iTunes.
One of my other hobbies is 3d modelling (completely amateur) and I'd like to mix these hobbies together! So I've read a little about it and figured I'd have to have good notions on geometry, math, point spacial position (which I do, from my 3d modelling experience), but I don't know how to use API's for it, so I've 'simulated' simple 3d with a simple program I've made (a spinning cube).
Here are some questions:
1) What would be a nice 3d development tool for a .NET programmer like me?
2) Is there a way of using 3d models made in 3DS Max ? (I intend on modelling characters)
3) What knowledge should I have in order to render it, and move it around ?
4) Which API should I use ?
NOTE: Not a dupe, I'm asking for directions specific for .NET development possibly using 3ds MAX, and there were no questions about it so far
EDIT:
I've got three answers that seem quite nice, so let me specify a little and maybe you can tell me what's the more appropriate tool.
What I'd like to build soon would be like:
portable (click'n'run, no need to install, and (hopefully) no need to send DLL's along)
"3D embedding" in winforms application, like a picturebox you could render in.
Real winforms application-like (having all System api's like IO, Drawing and etc)
The development enviroment would be nice if it:
Had the possibility to import existant 3D models (not a must, but a plus)
Had the ability to create 3d models programatically (a must)
Possibly has a tool for materials and textures (that would be a huge plus)
Is Well known (high availability of tutorials, questions in S.O., forums..)
And it would be really nice if I could use C# all the way :)
I'm going to provide another vote for XNA. The comment that it's too "game centric" is a non-starter - it provides a rendering loop with feedback on how fast everything is running so you can adjust your rendering to try to maintain a specific framerate (if you want). This isn't particularly game-centric as it's something that most 3D applications should worry about. The only thing that's really unusually game-centric about it is that it provides easy access to game controllers. Feel free to ignore that bit if you don't want to use it.
The only downside for you using XNA is your requirement that it be click'n'run, XNA has a redistributable that you have to worry about. Note that Win7 has this installed by default, but Vista and earlier don't.
EDIT:
XNA is made for applications that are strictly 3D. As such it doesn't natively support using typical windowing controls inside of an XNA project. But, there are ways around this...
A few useful links. Embedding XNA in a winform : http://forums.xna.com/forums/p/6471/34180.aspx#34180
WPF controls directly inside an XNA project : http://www.c-sharpcorner.com/UploadFile/iersoy/256/Default.aspx
Personally, I found XNA a little too "Game Centric" for my tastes. I was more interested in design/architecture type uses.
You may find SlimDX more to your liking.
Even though there are great suggestions in this post already(such as SlimDX and XNA), I'd just like to mention OpenTK.
OpenTK is closer to OpenGL than Direct3D, but it might be the best solution for cross-platform 3D .NET applications.
Since you are using C#.Net, the XNA library will be excellent for you. It is free off the Microsoft website and integrates into the VS IDE. A lot of available tutorials around to help get started.
Also, if I remember correctly. to use a 3d model in XNA, simply export the completed model as (.X). It can then be loaded into your work.
I vote you try Blender. www.blender.org
It's free, open source, and has a great community both on forums and IRC. Progress on the app is pushed forward by major community projects every year, some of which are movies and games and have won some awards. It is gaining industry acceptance as a way to model extremely fast.
Downsides: It's not considered as "pro" as Maya or ZBrush, and it has a very different brain about interface. Learning curve can be interesting, depending on how you learn and how much help you receive.
Upsides: It's free, great community, updated regularly, many tutorials and community projects to work on.
Community:
Blender channel on IRC
Blenderartists forums
Previous community Projects:
Elephant's Dream
Big Buck Bunny
My vote goes for Povray. It is a 3d renderer with a c-like syntax language. It doesn't satisfy your .net needs, but if cool non the less for 3d rendering. If you any kind of interactivity XNA is probably your best best. But I'm interested in your finds.
Re: "Has the ability to create 3d models programatically (a must)"
A few pointers:
Polygon Triangulation
(Dr. ?) Jonathan Richard Shewchuk's Triangle library
Dr. Hang Si's TetGen library
Constructive Solid Geometry
GNU Triangulated Surface Library
There are no .NET libraries I am aware of that allow you use the above mentioned libraries/techniques. You will have to use PInvoke or C++/CLI in order to make calls to these libraries from the managed world.

Categories