2D on 3D
Filed under 3D, Programming
My current hobby project (I always have some project that I'm working on that I never finish) is using Visual C# 2008 (free download) and Windows Presentation Foundation (WPF) to make an application with a slick, non-traditional User Interface (UI).
I'm using this project to learn about technology I think will have future importance.
So far I'm *very* impressed with C#. I've been doing C++ work since 1991 (Borland C++ 3.0). C# is a refreshing change, yet maintains enough similarities that it is easy for a C++ programmer to pick up with very little training.
WPF is the new UI API for Windows. It replaces the Win32 API, MFC, and Window Forms.
One of the features of WPF is that the fonts look perfect, no matter how much you magnify them. You can see this for yourself by using the magnifier tool (Start->Search->Magnifier).
To demonstrate, I created a sample WPF app in C# that displays some text...
Here is what my sample app looks like hovering near the task bar...
Here is what the same area looks like when I use 16x zoom with the magnifier (you'll have to click on the image to see it really zoomed in...it's too big to fit here):
Notice how sharp the WPF text is compared to the pixelated task bar. Very cool! This means apps can scale to any size monitor and still look perfect.
Using the magnifier, I've only found one application that uses WPF: Visual Studio 2008. And it only uses WPF in one place: the properties window for WPF elements. This is fairly new stuff...I expect it won't be long before you start seeing WPF-based apps.
Today I learned about another feature in WPF that I look forward to using: 2D on 3D. Basically, you can create standard 2D UI (buttons, scroll bars, sliders, etc.), but they can be mapped onto a 3D surface...and they still work!
It hard to explain, but this video really shows it off.
Daniel Lehenbauer and Kurt Berglund: Interactive 2D controls on WPF 3D Surfaces
I've downloaded the sample code from here. I plan on incorporating this into my project somehow.
This is fun stuff. When I have something worth showing, I'll post it.
Comments (3)
It's really a shame from my perspective that WPF is so C# centric.
My experience has been that it is really easy to make things look gorgeous with WPF, but really difficult to make them perform well due to C#. The profiling I've done shows rather extreme memory usage, and a lot of overhead in garbage collection; the usual things for the sort of technology that the CLR is.
Ironically, after having done a tour of duty through just about every third party toolkit imaginable (including WPF and WinForms), I find myself reverted all the way back to my nirvana; a blank window, OpenGL, and wherever I want to take that.
Posted by Nick | July 19, 2008 3:55 PM
Posted on July 19, 2008 15:55
BTW, I should mention the main source of my disappointment; my core algorithms were by necessity written in C++, and little by little the effort on my project shifted from the core algorithms (which was what the project was about) to the maintenance of the C# bindings to my library, and exposure of my data types to the GUI widgets. The effort on the bindings was probably 3:1 on bindings vs. core.
If I was working on a strictly C# based app, I'm sure the experience would have been much better and more compelling.
Posted by Nick | July 19, 2008 4:02 PM
Posted on July 19, 2008 16:02
So far, my C# app is very quick. But it doesn't do much.
Posted by David | July 19, 2008 4:05 PM
Posted on July 19, 2008 16:05