How should I start playing with 3D? - c#

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.

Related

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.

Multiplatform project (iOS/OSX, Windows and optionally Android) using C#

I know this type of question has been asked a lot, but I really can't find something that nails what I'm looking for, so hopefully this is not considered an "asked without research"-question.
The backstory: I'm developing an app that initially was supposed to work on OSX/iOS, but having a Windows version is already a must. I'm trying to find out the easiest way for me to have to translate as little as possible between each version, and preferrably without having to learn too much new (I have a little time constraint).
I'm using C#, currently developing in Mono
I'm used to the Cocoa API on iPhone using MonoTouch
So, my options (as I see them now):
Go native on mac, meaning having to make a separate graphics routines for the other OSes - makes the mac version easy-peasy, and I could postpone any learning curve for the other ports, however I guess it requires a lot more meddling when porting
Use some kind of XML markup or HTML/JavaScript as a presentation layer, with hooks on links triggering backend events (I don't know how well that would work on different platforms) - would require me to learn a bit of JQuery, but it seems pretty straightforward
Make it an XNA project and use MonoXNA (or similar) to port - would require me to learn enough XNA to do it, don't know if it's a pain
Use some other multiplatform 2D kit I don't know of
Basically, I need animated 2D sprites, mouse and touch input, and it would really be nice to have movement keyframes and maybe rotation.
There's also sound, of course, but playing a sound file seems so simple on all platforms that writing platform-specific shouldn't be much hassle.
Have a look at MonoGame. It should suit your needs pretty well I think.

3D scene graph for .NET

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.

Starting vg dev, which language?

Hey, I know someone who is looking into developing simple video games on his pc, and then eventually, hopefully port or develop some on the XBOX 360 indie center, using XNA studio.
So, I have heard about C#? How easy it for a beginner?
C++ is pretty good isn't it? But I've heard it's QUITE deep, broad, and sounds pretty easy to get lot in.
Also, I am assuming he would need an application for GUI and graphical development for the game?
Obviously we need a menu, and some graphics (unless we're doing a text-based game to begin with).
What program is good for that too?
Sorry for the kind of hap-hazardous question, but I'm just trying to feel everything out.
If you want to develop for the XBOX 360 Indie Center, you really have to be using XNA. This is the main, supported platform for Xbox + PC development.
That will probably force you into C#, as all of the samples, and nearly all of the documentation, is done in C#. You'll also want to use XNA for the graphics, as well as the content pipeline.
The XNA Creators Club has quite a few articles to get you started.
The best way to start making games is to start making games.
In other words, just get going. XNA and C# are a good way to just get in and get used to doing things, and it's the best way to start developing on the Xbox. If you're a student, you can get some free software from Microsoft through Dreamspark, including a free limited XNA Creators' Club membership (it at least allows you to deploy to your own machine and test).
Eventually, you'll probably want to learn C++ if you are getting into professional development. It's the lingua franca of game development, and there's an expectation that you are at least intermediate in it (most companies don't expect you to be a language lawyer).
To put it simply:
For a beginner looking toward PC and XBOX, then the answer is XNA studio, using the C# language.
Microsoft provides a free version of Visual Studio developer environment:
http://www.microsoft.com/express/Downloads/#2010-Visual-CS
C# is a very nice modern language, and a very good first-time language, as long as you're fine with being tied to Microsoft Windows and XBox (more or less).
Programming is not easy, but it can be very rewarding to learn.
There are some nice C# and XNA tutorials out there.
C++ is hard.
Starting vg dev, which language?
C++. Reasons: large collection of libraries, backward compatibility with C, widely used.
Achieving good skill level in C++ will take from 2 to 7 years.
Also, I am assuming he would need an application for GUI and graphical development for the game?
There are multiple gui libraries, one of them is Qt 4, supported by nokia. There are alternatives.
Obviously we need a menu, and some graphics (unless we're doing a text-based game to begin with).
Graphics: gimp, blender 3d. OR photoshop, 3dsmax/maya/zbrush.
Menu - you'll probably have to write menu designer for your game yourself.
Now, let's get reasonable. Game consists of:
1. Engine (programming skill)
2. Music (composition skill)
3. Art (artistic skill)
4. Sound (sound recording/processing)
5. Script/story/idea (creativity)
6. Levels, ingame mechanics (that's game design)
Achieving mastery in each area most likely will take years. And developing a game takes time. You should expect that writing your game will take at least months, and aquiring skills for that will take at least year (if you're genius, that is). If you have previous programming experience, you can learn everything you need (though hiring someone to do it for you will be much easier) and write your game, but that won't be easy. Making a mod for existing game will be also easier than writing everything from scratch. Or you could use already available engine.
I think it is up to you which language will you choose, because you can develop games in (almost?) every programing/scripting language there exists.
As I know many games are developed under C++ and there are many ready to use libraries that can help you with that. I have some experience in programing games in Java and it's also good. There are also ready to use libraries, like Sprites to easy animate characters/items.
I am also sure that in C# it would be quite easy and there are also some libraries.
I heard that Python is also good language for games developing. I have no experience with that, but Python is quite easy language to learn/develop.
So if you have any experience in any language you try it :) I mean for PC games developing.
C# is a good starting place for XNA and Xbox if you're not already comfortable with C++. The XNA tools for Visual Studio are quite good and are maturing nicely. Later, if you need more flexibility and performance, you can move to C++ and DirectX (or some other graphics library). The most important stuff you learn about games from C#/XNA, such as game loops, 3D math, and shader programming, will travel with you from C# to C++, C, or whatever other language you choose.
As Feanor said, the best step is just to start. You can always change the details of your path later.

How toI run a game made with XNA on the iPhone/iTouch?

How could I run a game made with XNA on the iPhone/iTouch? Which steps/tools (existing ones or imaginary...) should be used?
Note: The goal is to avoid modifying existing C# code
UPDATE :
If I understand correctly, I must be able to:
Run my XNA code on Mono (monoxna or SilverSprite, promising?)
Run Mono on iPhone (MonoTouch)
Not only is it possible but here is a video of someone doing XnaTouch on MonoTouch: First game to IPhone build with XnaTouch (XNA for IPhone)
Here is the mono article about doing it http://www.mono-project.com/MonoTouch
I don't believe there is a good answer to your question. XNA doesn't target the iPhone, so the chances of being able to effectively port an XNA game without modifying the C# source code isn't likely to happen.
Instead, I'd recommend that you take a look at the various frameworks that exist to help you craft cross-platform games. Unity often comes up in these discussions, but it isn't free.
If cross-platform isn't your goal, but free iPhone development is, then I'd recommend looking at Cocos.
Edit: The MonoTouch project may be able to assist you in the future, but doesn't help you out right now. Still, it's something to keep an eye on.
Edit: The landscape has changed a lot in the ~5 years since this question was posted. If you have an XNA project that you want to get running on iOS, then Xamarin.iOS (formerly MonoTouch) plus MonoGame is a near-perfect fit. MonoGame is missing a huge chunk of the XNA content pipeline, which means you'll either have to abandon it or have a VS2010 instance somewhere compiling your assets.
The MonoTouch project may eventually help here, since it allows you to write C# targeting the iPhone (it is statically compiled to native code).
MonoGame is a free OpenGL implementation of the XNA 4.0 Framework. It is built upon the excellent range of Mono compilers and is compatible with MonoTouch (iOS), Mono for Android (Android), MonoMac (Mac OS X), Mono for Windows and now Linux!
A list of 12 games currently using MonoGame that are on the Apple iOS App Store can be found #
http://monogame.codeplex.com/
https://github.com/mono/MonoGame/wiki/Released-Games
I believe XNA depends on Direct3D 9 (see http://msdn.microsoft.com/en-us/xna/aa937793.aspx), which may hint at the hurdles one might encounter in both porting to mono as well as having sufficient graphics horsepower on iPhone.
Everyone saying this is possible because there are CLR libraries for Mono, does not even think about the fact that XNA is a WHOLE DIFFERENT set of frameworks:
"The XNA Framework class library is a library of classes, interfaces, and value types that are included in XNA Game Studio."
As another responder noted, this is so far from happening it's not even funny. If you really want to write a game I'd check out Unity. It's commercial, but it looks utterly impressive and you can script your game logic in Javascript or (here's the funny part) C#!
Yes, instead of going through a ton of work to port a whole framework because you want to write a game in C#, why not just use a framework that lets you do that today?
From the horse's mouth:
MonoTouch + SilverSprite = XNA 2D
games on iPhone? :)
What Bill means is that it will eventually be feasible to write a 2D XNA game, then use SilverSprite to run it on Silverlight, then use MonoTouch to run it on the iPhone
This space is definitely heating up. There is now an XNA Touch project on codeplex that aims to bring the XNA API onto the iPhone/iPad platform:
http://xnatouch.codeplex.com/
'Maybe' you could just change XnaTouch's namespace to match those of existing Xna code (i.e. Microsoft.Xna.Framework.*), when developing a MonoTouch project? This could be done on a vendor fork (copy) of the XnaTouch code, easy to manage using Git, Mercurial or Piston etc.
I'm unsure as to whether the XnaTouch team would undertake such a change on its own codebase, so this is probably best done on your own, personal, code branches (interestingly, the Mono.xna project uses the original Microsoft.Xna.Framework.* namespaces, I'm unsure why XnaTouch chose not do so).
JFYI, the current XnaTouch (v1.0) follows Xna 4.0 quite faithfully. I've found a [small] few missing method calls, which I've 'implemented' to throw not implemented exceptions (?). The original-xna4-and-modified-xna-touch code does compile, now I need to implement iphone-specific gui and handling etc.
Hope this helps someone.
Cheers
Rich
For starters you would need a CLR implementation on the iPhone, which doesn't exist at the moment, but it seems someone is trying: MonoTouch.
A friend of mine is developing an architecture port of XNA 4.0 for the iOS platform. It's of course written in Objective-C, but it has the feel of XNA. He has published the source under LGPL at http://code.google.com/p/xni/.
Xna is not officially supported on iPhone; however, you could use ExEn (http://exen.codeplex.com/) or MonoGame (http://monogame.codeplex.com/) to port your Xna games. A bonus for using either of these is that they support Mono for Android.
If you're looking for a free cross-platform sort of thing, you could check out phonegap. I don't have any experience with it but it looks cool.
http://phonegap.com/

Categories