1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Graphics Engine for dotNET.

Discussion in 'Tools programming' started by scruffyduck, 28/4/07.

  1. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    25,438
    Country:
    wales
    I have not felt ready to get into WPF yet and stayed with GDI+. Some of you may be looking at ADE - this actually uses a graphics library called Piccolo that seems to provide a good level of flexibility and abstraction from the coal face. If you are thinking about a 2D interface and not ready for WPF you might want to take a look.

    http://www.cs.umd.edu/hcil/piccolo/index.shtml

    I am at the start of using it and still low on the learning curve but would be happy to share the scars I have gotten so far.

    I am not suggesting this is a better route than WPF just an alternative :)
  2. Luis_Sá

    Luis_Sá Resource contributor

    Joined:
    16/9/04
    Messages:
    314
    Country:
    portugal
    Hi Jon,

    What WPF stands for?

    Kind Regards, Luis
  3. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    25,438
    Country:
    wales
    Hi Luis

    Windows Presentation Foundation (used to be code named Avalon). It is part of dotNET3.0 . This is a set of extensions to dotNET 2.0. WPF is intended to be the next tool to generate User Interfaces and is really all about the user experience in Vista.
  4. Alex Barrett

    Alex Barrett

    Joined:
    19/4/07
    Messages:
    48
    Country:
    unitedkingdom
    Jon,

    I do apologise, I downloaded this the other night and have only had the briefest of tinkers with it but it looks rather good.

    I thought I had replied saying thank you for the link but obviously I was too eager to play... I shall hang my head in shame.

    I still haven't had chance to have a good go with it, hopefully that shall come over the next few days.

    Would it be too cheeky to ask what you have achieved with it to date?

    I'm just wondering what kind of applications it can be put to use for without tens and tens of pages of code.

    All the best,

    Alex
  5. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    25,438
    Country:
    wales
    Alex

    Take a look at ADE - the CAD interface uses Piccolo. Currently only draws the airport but will eventually handles adding, editing, drag and drop and so on.

    It can also, obviously be used to any application that uses a display of this type including scenery design tools, flight planners and so on. It does not do 3D only 2D.
  6. lmoelleb

    lmoelleb

    Joined:
    23/4/05
    Messages:
    266
    It is a common myth that WPF is as such related to Vista. It's unfortunate as the result is people think they should not use it, unless they are programming something fancy for Vista.

    WPF is a modern UI environment which is badly needed as the existing architecture was introduced with Windows 1.0. It runs on Windows XP and newer, and a subset of it will also run in Silverlight.

    Piccolo delivers a tiny subset of WPF, without being significently simpler to use (if simpler at all), so while Piccolo had it's use before WPF was released I see no need for it today.
  7. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    25,438
    Country:
    wales
    Sure I agree that WPF has nothing directly to do with Vista. Also I am not suggesting that Piccolo is better than WPF but it is an alternative. I have done soe work with WPF and I am not ready to move to it yet - no deep reason - just my preference :)
  8. lmoelleb

    lmoelleb

    Joined:
    23/4/05
    Messages:
    266
    As long as you didn't make the decission because you where not aware that you can host a WPF control in WinForm. :)

    While EditVoicepack is a 100% WPF application I'm going to do the map control only in WPF in the scenery design tool I created. At least until MS get their tools completed.
  9. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    25,438
    Country:
    wales
    I am aware of that :)
  10. ziporama

    ziporama

    Joined:
    28/9/06
    Messages:
    203
    Country:
    unitedstates
    I've been working for the last few months on WPF in the hope of getting panels to render via WPF inside FSX, to replace my old GDI+ bitmap and anti-aliased text FPS killer extravaganza.

    There are two very nice features with WPF: (1) WPF uses hardware rendered 3D, which is blazingly fast compared to GDI+ that is almost 10 years old now and was never meant to do 3D. (2) WPF renders in ANY window container, meaning for FS work, you could theoretically design a panel inside FS, or outside FS, and having it look exactly the same and without code modifications or a dependency on the gauge SDK). Does not replace the gauge SDK of course, but opens a number of interesting possibilities.

    WPF doesn't implement all the Direct3D functions, but has almost all the geometry and lighting features, but does lack a bit behind in terms of complex materials. For FS however, can more than handle the job.

    The chief drawback is that WPF is only managed code. This is great if like me, you like C#, but bad, if, unlike me, you think C++ is the best thing since the VI editor was invented. Ok, C++ is faster than the CLR, but this can quickly become what I call a matter of "computer religion", and I stay clear of those. Getting .NET running inside FSX is also a fun challenge - that took about a month to figure out - main problem, FSX would blow up on startup. Solved using the raw CLR APIs (the very low level interfaces that allow one to load .NET as a regular OS process). I never did get FSX to work well with C++ Interop but you may have better luck.

    Another hurdle with WPF 3D is that you need a 3D package to generate the meshes and map the textures - just like you don't go writing .X files manually and you use GMAX or 3DStudio.

    Very few tools do this currently because WPF 3D is so new. GMAX cannot be used. To my knowledge, there is no XAML output from 3DS either.

    I currently use Blender to create my WPF models as it's both free, very accomplished in terms of 3D modeling, and there's a XAML output filter for it (written by the WPF team, but needs a few modifications to work well with the current blender). The XAML file is a cut/paste affair inside a custom WPF control and bam, 3D.

    If you're interested in the WPF possibilities inside of FSX, check this WPF example out:
    http://blogs.msdn.com/wpf3d/archive/2006/12/12/interacting-with-2d-on-3d-in-wpf.aspx

    If anyone has a clue how to create a modeless window that doesn't disappear inside FS in full screen mode while the other windows are active (desired behavior is what FSNavigator does if you're familiar with this tool), please share. That's the one issue I'm working on right now and the missing link to this WPF magic.

    Once I have the kinks worked out, I'll share some sample code up here.

    Cheers,

    Etienne
  11. scruffyduck

    scruffyduck Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    17/9/05
    Messages:
    25,438
    Country:
    wales
    Hi Etienne

    Thanks for posting that. I would be very interested in how you get on. At the moment I am using GDI+ but plan to move to WPF once things have settled down a bit more :)
  12. lmoelleb

    lmoelleb

    Joined:
    23/4/05
    Messages:
    266
    If anyone wants the code to load FS Gamepack scenery export from GMax (FS2002 BGl or FS2004/FSX MDL) and display it in WPF let me know.

    It won't produce XAML, but load the Flight Simulator model into a domain model representation - building the 3D model from this domain model is trivial (I beleive I already posted the code here some time ago, but have since added texture support).

Share This Page