All of the tutorials have been fully updated and the source tags checked in for the changes implemented to help better deal with the multitouch device. The new architecture of the IHMComponent library should help make a lot of things easier to implement later on (or now if you found the functionality lacking before.)
Basically the engine is put together in the same manner as before, but with a lot more HMComponents to allow for more flexibility in putting together objects to be managed by the engine (like a Loadable, Updatable, Renderable HMInputDevice).
Now its on to really getting this multitouch project going!
Well, having had my FTIR table for a few weeks now I have had a bit of time to get some code together (using some features of the newly refactored HMEngine of course) and get the touch inputs streaming into my XNA apps.
At the moment, I am working on an HMMultitouchDevice that can be added to the engine like all the other devices (mouse, keyboard, and gamepads) that just works out of the box with the engine. This whole project has been given the name “PufferFish”, which was a totally random title thrown out into the #xna channel immediately upon my asking for a good name from the folks in there and it just kind of stuck.
The device is currently taking touch inputs and just rendering spots on the screen where the touch would correspond to. Event wiring will be happening next, but I am playing around with some rendering of the spots (circles around fingers etc.) first just for a bit of fun. As soon as I can get some videos of the project in action I’ll get them up here. That’s all for now.
The introduction of multitouch capabilities into the HMEngine has caused a bit of a stir in the way that I had the architecture of some of the components laid out. Specifically, the IHMRenderable and IHMUpdatable interfaces and the HMInputDevice. Since the multitouch device needed a cursor (actually N cursors based on the current fingers touching it), I had an HMInputDevice that also needed to be IHMRenderable. The problem with that though was that input devices are never in a place where render could be called on them.
To keep a long story short, I refactored the components a bit and now have an HMComponentManager that keeps lists of anything that is updatable, renderable, loadable etc. just like the HMObjectManager used to do, but it also includes the ability to add input devices and cameras as well (basically everything in the engine is a child of some IHMComponent or another).
Since these changes are pretty important and add a lot of flexibility to the items we can create and use in the engine. I will be updating the tutorials to accommodate the differences that have been introduced. This will probably take a little while, as I want to release the full set of changes all at once, but the final outcome will overall be a much better put together framework.
A lot of people don’t think it is possible to have winforms items (like buttons and dropdowns) in an XNA application, but I am here to prove them wrong. There is a ridiculously simple method of adding controls to your XNA application INSIDE the XNA window without too much hassle – as long as you are ok with coding up the items by hand.
One downfall is that this won’t work on the Xbox 360 since System.Windows.Forms is not included in the things XNA can render, but these types of UIs aren’t really the kind that would work well on an Xbox anyway.
Here is my method of adding the controls and a screenshot of the app running:
protected override void Initialize() {
var list = new ListBox();
list.Items.Add("Here");
list.Items.Add("Are");
list.Items.Add("Some");
list.Items.Add("Items");
Control.FromHandle(Window.Handle).Controls.Add(list);
}
I hope this method solves a lot of the issues people seem to be having with using these Controls together with XNA.
Well, the multitouch table project I have been working on for a while reached a new milestone when my dad got involved. He has better tools and resources and more electronics experience, so he set up a pretty sweet frame for the table project I am working on.
Once there is some progress in the actual software side of things, I’ll post some videos of some interaction with the table itself. Until then here are the teaser pics
You can see the IR filter that gets replaced here
The lenses from this will help keep the table shorter
Here is a shot my dad sent of the finished tabletop
I have gone through all of the tutorials with ReSharper on my side helping to optimize things and update all of the code to C# 3.0
There have also been a few minor architectural changes making the different managers (shaders, objects, input etc.) into GameComponents and DrawableGameComponents – which I have been thinking about doing for a while – that drastically simplified the Game class itself.
Take a look at the new setup and let me know what you all think in the forums.
The projects in svn will now require Visual Studio 2008 to be run, and some parts of the code use features available only in C# 3.0, but any of these that your compiler doesn’t support should be fairly easy to write in a C# 2.0 manner.
I’ll let the video do most of the talking, but the progress on the soft body work from the last two posts is coming along nicely. Correct pressure, momentum, and spring handling throughout the body is now fully working, and I can begin moving on to collision detection and other physics aspects outside the body itself now.
Here is a video of the current state of things. I start the demo out with half of the sphere scaled outwards from the center just to give the body something to fix when I start the update cycle. You can easily see the accuracy in the waves moving through the body and how far it has come in only a couple of days of work.
Here’s a first cut of a video of the soft body in action. This one I just offset a vertex near the top of the object a bit to show waves moving through the body after it is released.
So lately alongside the UI tutorial that I have been slowly churning out and making some hard decisions on I have also been throwing together a nice little tech demo using some soft body dynamics that I want to eventually use in a fast action fun XNA game possibly for later release on Xbox Live Arcade.
Assuming things on the Creator’s Club website go as expected, I would like to release the game (which isn’t even fully in the design stage yet) to the site and see what people think of it and hopefully push it all the way through the process out for public download from XBLA.
I’ll get some videos of the soft body stuff up as soon as I am happy with how all the physics behaviors are working out (hopefully soon).
All of the updates for the tutorials to the 3.0 version of the XNA Framework have been completed. I will be uploading and moving the projects in the svn to their appropriate locations and updating the PDF’s as well for the tutorial posts here on the blog.