I'm developing in MonoTouch and I have an issue where a 3D model should be drawn on-screen, making it possible to rotate around and zoom in/out.
Usually, developing things for iOS (apart for the usual weird API kinks) is a breeze. I need an image, I load it and display it with a few lines of code. Same goes for audio, touch events etc. However, when I try to look at 3D stuff, what I get is OpenGL-ES 2.0 which seems unnecessary low-level and far from "plug n play". Weird enough, but what seemed even weirder was that I couldn't find any simple framework to go around it. Am I missing something here? I found Unity3D but that's way more than I need (not to mention the price, and again, learning curve).
Do I really have to invest time in learning the intricacies of 3D rendering when I just want to display a model? Seems OpenGL-ES-1.1 is a bit simpler but may not have the functionality I need (and again, the lack of "1-2-3 this is how it works"-tutorials seems weird to me). Or are my google skills way poorer than I thought?
Sorry if the question implies a vague answer, but summarized I guess my question is "What's the simplest way of displaying/rotating/zooming a 3D model in MonoTouch using OpenGL-ES 1.1/2.0 (preferrably 2.0, but 1.1 is also ok)?"
I got this geat tutorial for OpenGL ES 2.0.
Its not unnecessary low-level IMHO. It enables a broad possible uses, e.g. creating a game and a simple 3D visualization are two different applications which may not need everything the other app has.
Of course it would be great if it would be more like DirectX but you can create the necessary classes by your own in no time.
If you want a non-low-level api, consider using something like Unity3D.
"1-2-3 this is how it works" - http://nehe.gamedev.net/
for mono - http://www.mono-project.com/GtkGLAreaSharp:NeHe (i know not mono touch, but it should help)
OpenGL ES 1.1 should be more than enough.
What kind of effects do you want to add to the models? 1.1 should be fine for texturing and lighting.
Related
There is a 3D simulation I made with helixtoolkit.wpf, but it is not effective at all in terms of performance. How can I adapt this project to SharpDX? I could hardly find any information about it on the internet. Is there a resource or shortcut you can recommend?
That would be a total rewrite. HelixToolkit and SharpDX is in no way compatible in scope.
HelixTookit is a wrapper around Wpf and provides a bunch of convenient controls and functions to easily display viewports with navigation etc.
SharpDX is a wrapper around Direct3D, so provides a much lower level access to the hardware. But you would need to write a lot of components yourself to be able to provide anywhere near the level of functionality of Helix. SharpDX is also no longer maintained, so you would spend a lot of time porting to a effectively dead technology.
As always with performance you should start with profiling. Is it really Helix3D that is the bottleneck? Or are you using it in a way that is inefficient? Before doing a major rewrite you should be certain you have explored all other options for performance optimization.
One thing you might try is to export your model to a file and open it in the windows 3D viewer, I suspect that uses the same underlying wpf code to display 3D models, so it should give a fair estimation of the possible performance.
I have an old application for playing video that uses DirectX and I would like to update it and prevent the "error" of Loader lock among other things.
Can I ask what are the basic steps for converting the application? What do I have to pay special attention to?
Currently I have references in the project that point to local DLL files that I have added to a local folder. This is not a good approach and another reason for this question.
Microsoft.DirectX
Microsoft.DirectX.DirectInput
You'll need to change the namespaces to the SlimDx namespaces. At that point, you'll have to migrate some code, as some of the names are different in SlimDx vs. Managed DirectX.
That being said, the basic API calls for DirectX 9 are very similar, so the migration is not too bad once you get going.
I'm a little late to this thread, but I have used SlimDX for a year and I'm nearly but not quite finished translating my embryonic game to SharpDX (because I want to use XAML and a couple other reasons). I highly recommend both, and putting aside SharpDX's advantages (DX11.1, WinRT, XAML, some speed improvements), I would say that SlimDX is as close to managed DX as your going to get, it's equal to SharpDX, without considering those advantages that I mentioned.
I hope the point I'm making is that SlimDX is a closely mapped framework, equal to SharpDX. In that regard, SharpDX can't be recommended alone, without mention of SlimDX. And also I want to make the point that SharpDX will not minimize the migration steps over SlimDX, if that's what you're thinking. They are very similar, more similar than you think if you are of the opinion that you might fail in one and succeed in the other. If you can work it out in one, then you can work it out in the other, they are that much alike. So much alike that I wished they would rejoin as a team and work together on a unified package of frameworks. There is just too much overlap for them to be distinct projects IMO.
I am researching the possibility to render a 3D model or graphic from a building described by data in a ASP.Net MVC webapplication (C#).
Most posts on forums and on stackoverflow and articles on blogs and websites I find about things related are old (2006 and before).
As far as I can tell there are three choices: Direct3D, OpenGL and Unity 3D.
Direct3D is from MS but I can't figure out whether this is suitable for a webapplication or not. Any experience anyone? But as stated before, the highest ranked articles in google are from 2006 or earlier (is it still being developed/maintained/used?).
OpenTK (www.opentk.com) looks the likely candidate for use of OpenGL but the latest release is from October 2006 (although there are recent blog posts on their website).
Unity 3D seems very advanced, modern and recently maintained, however I am uncertain whether it is not to bulky to render a simple 3D model of a building.
I would welcome any suggestions whether one or the other is better suited for the task and preferably examples of implementation.
Cheers,
Daniƫl
I think you might be misunderstanding how this process works.
I assume that you want to render the object on the client?
In that case you need to look at a client-side technology. ASP.Net or any other server-side platform can pass the data to the client but you need to use a client-side technology to do that.
I don't know exactly where this stands right now but I would expect you to need to use Silverlight, Flash or possibly HTML5 for the display.
HTML5 is standards compliant but it is less mature and as far as I know you will need a fairly new browser to access it: http://msdn.microsoft.com/en-us/library/hh535759(v=vs.85).aspx
Silverlight is more mature, should integrate naturally with your Microsoft toolset but will require users to install the plug-in before they can use your tool. I don't know how ubiquitous it is, but that may be an issue for you. I would still probably favour this if you want quicker/more achievable development time: http://forums.silverlight.net/t/225673.aspx/1
Flash is very ubiquitious but you will need proprietary tools to develop it and I don't know how/whether it would integrate with the Microsoft stack. I think they would prefer you to use their own stuff. It's good if you want something available on most current browsers but my feeling ( and if I'm honest my hope ) is that it will lose currency as HTML5 takes over.
Of course, if you're properly old school like it's 1998 you should totally go for VRML.
As regards the server platform you use, that's basically irrelevant to rendering and display. It's role will be to pass out data. If you are using a Windows server then you probably want to look at something WCF to pass the data out to your client.
If, you want to render your objects on the server and then use those renderings to create images or video on the client that is a slightly different matter again.
As states we are in the process of considering porting an existing app which uses the user32.dll quite extensively. Mainly for stuff like taking screenshots of the screen and moving the mouse around.
Using something like JNA we should be able to do the same thing, but are there limitations? Things we should be aware of
Thank you
As a first point I'd have to ask why? If you're using JNA you're losing all the cross platform nature of Java anyway, and losing the tight integration with Windows that C# gives you. There's no limitations that'd stop you doing it, but if you are just tying yourself to using native code anyway then I'd say there's not much point.
If on the other hand you're looking to gain cross platform capability and you're looking at porting, then you can take screenshots and move the mouse around using the Java Robot class easily, no native code required. If you are rewriting in Java, that's by far the approach I'd recommend.
I've been constructing a card game and want to use a good UI framework for my client.
I was leaning towards WPF, since I have VS2010 and good experience with C#, but I'm having doubts about it, since it isn't quite tailored towards games.
I'd like to have something that allows me to do nice (but simple) animations for typical card actions, like drawing/discarding/playing etc. I know WPF has better support for animations that WinForms, but will it be enough for a game like this?
I used to develop games in WPF, and its animation system was a huge timesaver. To get the most out of WPF. I highly recommend using Microsoft Expresion Blend for UI design and animation, going back and forth between Blend, and Visual Studio, I was able to build animated interfaces in hours that would have taken days using a more conventional UI framework. I believe that new versions of blend even let you edit C#, that would be an even bigger time saver.
Have you looked at XNA?
It probably wont be easy to creat the animatons, but the framework itself is geared towards gaming. It's Microsoft tech and all the examples I'v seen are implemented in C#
You could even look at Managed Direct X which itself was the precursor to XNA and is also Microsoft tech.
WPF is certainly capable for something like this. In fact, Adam Nathan has an example in his earlier WPF book, "Windows Presentation Foundation Unleashed."
There is a .NET 4.0 version, but I haven't actually seen it. However, the earlier version of the book was quite well done IMHO.