1 of 4
1
.NET multitouch framework
Posted: 01 July 2007 05:12 PM   [ Ignore ]
Sr. Member
RankRankRank
Total Posts:  317
Joined  2007-03-13

so i’m on to my next project...CsTI was just a small step into this project. i also decided to start this project to find out if my implementation of CsTI is correct..

this project does not have a name *yet*

and here is the description:

it’s basically the .net framework, but allows for multitouch interaction.
it uses touchlib and CsTI
it’s written entirely in C#
it’s WPF(Windows Presentation Foundation) or .NET 3 based - so it won’t work on .NET 2 btw

it’s a framework of custom controls. ie. image/button/video/etc. for .net
so i aim to enable people to write code, like they would in c#, like

Button but = new Button();
etc...

but allows for touch interaction, like

TouchButton but = new TouchButton();
etc...

That means the second code example will allow you to press the button WITHOUT simulating the mouse, also write your own code for what to happen when one/two/three/etc fingers are on one image. WPF allows for animation/layers/ and a bunch of other cool stuff.

i will have a working prototype of a multitouch image app (like white’s flash app) within the week.

i’ll appreciate if anyone could give some feedback on the idea.

 Signature 

my multitouch blog: http://www.whitespaced.co.za/
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 02 July 2007 05:24 AM   [ Ignore ]   [ # 1 ]
Jr. Member
RankRank
Total Posts:  106
Joined  2007-03-15

sounds like a great idea, almost exactly the same thing that im working on, except recently I havnt had enough free time to get anything decent together.

I have been playing around with .Net 3.0 and WPF and its a very similar programming model to Adobe Flex. I have been working mostly on multitouch interop with non multitouch applications. Which should slot in nicely to your project.

If I write a class that inherits a WPF image that handles all the window updates and mouse clicks then in theory we can just use it to replace the Image you are using in your prototype image app and it will give us a kind of multitouch shell.

Ive been working in Vista, but the method ive used to get the window content should work in XP too.

Cant wait for your prototype image app :D

Profile
 
 
Posted: 04 July 2007 12:07 PM   [ Ignore ]   [ # 2 ]
Sr. Member
RankRankRank
Total Posts:  317
Joined  2007-03-13

yeah, our projects should work together well. I’ve never used Adobe Flex, but i have done a lot of ASP.NET websites, and the whole XAML/Code-behind thing is very much ASP.NET.

I’ve actually had an idea of instead of using TouchImage and TouchButton, i’m writing multitouch-’containers’. take for example Canvas. I’m going to write TouchCanvas that figures out what was press, and so, which will make it VERY easy to add touch capabilities to an ‘already-written’ app.

ex. Someone somewhere wrote a cool app, the whole app runs in a Canvas. now to add multitouch capabilities, just replace Canvas with TouchCanvas and there you go. (some other minor changes might also be needed.) once i get my head around all that WPF is, i’ll have a better idea on what other containers is needed and so…

 Signature 

my multitouch blog: http://www.whitespaced.co.za/
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 04 July 2007 03:32 PM   [ Ignore ]   [ # 3 ]
New Member
Rank
Total Posts:  21
Joined  2007-06-05

Donovan, have you got some code?
thanks a lot !!

Profile
 
 
Posted: 05 July 2007 11:02 AM   [ Ignore ]   [ # 4 ]
Jr. Member
RankRank
Total Posts:  106
Joined  2007-03-15

Here is a rough example of what a image app might look like. I havnt done any of the multitouch stuff, but it will help you get your head around using WPF

left click to move the image
right click to rotate
middle click to scale

p.s. this code is in vb.net, but it should be easy to convert it to C# if you prefer

File Attachments
WPFMTIA.zip  (File Size: 466KB - Downloads: 635)
Profile
 
 
Posted: 05 July 2007 11:47 AM   [ Ignore ]   [ # 5 ]
Sr. Member
RankRankRank
Total Posts:  317
Joined  2007-03-13

@Pleh: thanks a lot, i got the normal dragging working but transforming(scale/rotate) i just couldn’t get working properly,scale just kept on enlarging the image, and rotate - rotated the image out of view.

@euclidez i’ll post the code tomorrow, i’m cleaning the code and fixing some bugs, the code is very uhm...messy at the moment

 Signature 

my multitouch blog: http://www.whitespaced.co.za/
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 10 July 2007 01:57 PM   [ Ignore ]   [ # 6 ]
New Member
Rank
Total Posts:  21
Joined  2007-06-05

Hello Donovan. Any news about the code? I’ve been playing with wpf. I’ve a paint demo and the photo demo I’ve to made the rotation work better.

Any news?

Profile
 
 
Posted: 11 July 2007 12:39 PM   [ Ignore ]   [ # 7 ]
Sr. Member
RankRankRank
Total Posts:  317
Joined  2007-03-13

Download WPF_MTPhotoApp Test1 HERE

i cannot apologise enough for taking so long. my university started again today so i had a very rough weekend with meeting lecturers and dividing students (i’m a teaching assistant) into practical groups

ok, here is a first test of the photoapp. it uses Touchlib rev58 with the newest build of CsTI (beta1_58), both included in the zip, in the bin folder of the project). the drag works about 100% like it should (only gives problems when you drag so fast that the images can’t keep up with your finger), and the rotate works pretty well, might have a small bug in it when your finger leaves the area of the image while rotating. I haven’t had time to do scaling, but i will very soon.

the zip contains the source for the app, with a visual studio 2005 solution. just change the references to the images in the PotoApp.xaml and PhotoApp.xaml.cs. The framework is in the NUIGroup.MultitouchFramework namespace, just note that, and it’s not been put into a seperate DLL. i’ll do that when i have time.

I wrote it in such a way that adding other controls, like buttons,etc… will be easy as well as keeping it possible to do everything through XAML (that’s the point of the XAML right? keeping UI and code seperate!?)

oh, and you’ll need the WPF extensions for Visual Studio 2005, or the June(i think) CTP of Visual Studio ‘Orcas’ . so basically you need to be able to compile WPF apps for this to compile. once you opened the VS.NET solution, just delete the reference to CsTI.dll and add it again. VS.NET sometimes can’t find it when you open someone else’s project file.

Please send comments, especially on the code, there definitely are better more elegant way’s to do everything i’ve done, but i’ll be exploring those better solutions as i continue to work on the framework.

again, sorry for the delay grin

 Signature 

my multitouch blog: http://www.whitespaced.co.za/
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 11 July 2007 01:53 PM   [ Ignore ]   [ # 8 ]
New Member
Rank
Total Posts:  21
Joined  2007-06-05

Great Donovan. I’ll just test today the app.

Thanks a lot !!!!! I’ll send to you the paint app.

Profile
 
 
Posted: 12 July 2007 06:51 AM   [ Ignore ]   [ # 9 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  535
Joined  2006-11-09

I really like this idea donovan, and look forward to see your progress.

You’ll need the WPF extensions for Visual Studio 2005, or the June(i think) CTP of Visual Studio ‘Orcas’

Could anyone provide links to download these?




I posted a simple demo that does not required the Orcas installation. You can find it here: http://nuigroup.com/forums/viewthread/454/

 Signature 

~

Profile
 
 
Posted: 12 July 2007 08:22 AM   [ Ignore ]   [ # 10 ]
Sr. Member
RankRankRank
Total Posts:  317
Joined  2007-03-13

http://www.whitespaced.co.za/vs2005ext.zip

it’s the november Visual Studio 2005 .NET 3/WPF Extentions, it’s about 3MB. that’s all you need, it only updates the compiler you don’t need Orcas. sorry for that mistake grin

also the XAML view might not always display something in VS2005, especially with custom controls, but it will compile and run. it’s just that VS IntelliSense doesn’t know what it is.

 Signature 

my multitouch blog: http://www.whitespaced.co.za/
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 12 July 2007 01:00 PM   [ Ignore ]   [ # 11 ]
Sr. Member
RankRankRank
Total Posts:  317
Joined  2007-03-13

here is some update to the code. check for the parts marked with //-----------------UPDATE------------------//. and place it in the same place in your files, if you have it.

all that this update does is, if your finger is dragged too quickly for the image to keep up (happens with low FPS webcams) it now releases the finger (like mouseLeave event), and when you rotate and your finger goes off the image, it returns to drag mode (also releases the finger)

anyone want to give a better rotate, and scale a crack? because i just don’t get why mine does what it does. with normal mouse it scales correctly, but with fingers, same code, it goes haywire.

File Attachments
TouchCanvas.txt  (File Size: 11KB - Downloads: 403)
TouchImage.txt  (File Size: 13KB - Downloads: 332)
 Signature 

my multitouch blog: http://www.whitespaced.co.za/
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 13 July 2007 10:24 AM   [ Ignore ]   [ # 12 ]
New Member
Rank
Total Posts:  21
Joined  2007-06-05

Yes Donovan I saw that about the Rotate. I’ve use a RenderTransform group to Scale, Translate and Rotate. I’ve the same problem with rotation. One thing I saw that it’s no very performance to do a new Transform, define it in the constructor and change the values of the transform. I’ve problem with rotate, the scale and translate transform is ok. I’m using a different approuch but doing things like you.

I’ll post some example when I fix it.

Thanks a lot for your code.

Profile
 
 
Posted: 13 July 2007 11:17 AM   [ Ignore ]   [ # 13 ]
Sr. Member
RankRankRank
Total Posts:  317
Joined  2007-03-13

ok cool. have a look at the silverlight demo that cmoore posted.i now use that rotation,it works 100%.i’ll fix the scale tonight…

we should have a chat sometime,we could maybe share some ideas!

looking forward to your app!

 Signature 

my multitouch blog: http://www.whitespaced.co.za/
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 13 July 2007 05:33 PM   [ Ignore ]   [ # 14 ]
Sr. Member
RankRankRank
Total Posts:  317
Joined  2007-03-13

ok the app is done, need some eye candy though, but rotate/scale/drag all works 100% now!

Source: http://www.whitespaced.co.za/WPF_MTPhotoApp_SOURCE.zip

Bins: http://www.whitespaced.co.za/WPF_MTImageApp_BIN.zip

the bins are for those that wants to just play with the app, source for those that want to compile/look at code.

ATT: for the source you need to download the bins also, and extract it to the bin/debug folder of the source for it to work. The bins include touchlib rev58 and csti beta1_58, as well as all the other libraries needed for touchlib to run.

youtube video:

 Signature 

my multitouch blog: http://www.whitespaced.co.za/
those that say it can’t be done shouldn’t interrupt those doing it

Profile
 
 
Posted: 14 July 2007 04:16 PM   [ Ignore ]   [ # 15 ]
Sr. Member
RankRankRank
Total Posts:  286
Joined  2007-07-14

This is great!!!!!!!!!!! I don’t have a screen (not yet). But I tested it with my WebCam and two remote controls (at night smile ) and it’s working smile
Now I just have to build my screen. Then I would be glad to help you develop multitouch framework.

Profile
 
 
   
1 of 4
1