1 of 2
1
Can someone plz explain touchlib sourcecode ? 
Posted: 02 April 2008 09:16 AM   [ Ignore ]
Jr. Member
Avatar
RankRank
Total Posts:  121
Joined  2008-01-28

can someone who knws VC++ .NET explain in short, how the code works ??? ......
i am confused with the usage of -> and * .....

 Signature 

..’m not the best..but ‘m not like the rest....

Profile
 
 
Posted: 02 April 2008 10:59 AM   [ Ignore ]   [ # 1 ]
New Member
Rank
Total Posts:  39
Joined  2007-09-10

My advice is to buy a book to learn C++. Your question suggests that you are new to C++, so you first need to grasp the basic concepts of C++.

Profile
 
 
Posted: 02 April 2008 12:19 PM   [ Ignore ]   [ # 2 ]
New Member
Avatar
Rank
Total Posts:  87
Joined  2008-01-16

I am currently working on code documentation and a short tutorial for the Google Summer of Code students so they can ramp up quickly. I will likely be done by the end of this week.  It is difficult to stay on top of commenting other people’s code while you’re trying to fix it too!  Most people are focusing on developing applications using Flash or AIR instead of tweaking OSC or touchlib.  I am working on both touchlib and a better configapp.  If you aren’t familiar with C++ you might want to start with the Flash or AIR application programming. smile

 Signature 

EasterIsland, LLC.
My Signature Quote

Profile
 
 
Posted: 02 April 2008 12:56 PM   [ Ignore ]   [ # 3 ]
Jr. Member
Avatar
RankRank
Total Posts:  121
Joined  2008-01-28

@Adam ....
can u gimme some rough idea regarding the touchlib OSC program ?? .....
it wud be gr8 to see a documentation .....

 Signature 

..’m not the best..but ‘m not like the rest....

Profile
 
 
Posted: 02 April 2008 01:46 PM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRankRankRank
Total Posts:  1508
Joined  2007-04-08

Hi Adam,

It’s great to hear you’re working on some improvements. I agree, they’re definitely needed. I think people are more caught up in making applications in general right now. I’ve been wanting to fix some things, but haven’t had the chance to learn enough cpp yet to make it worthwhile. I can’t wait to test out your improvements and read over the documentation. Sounds great!

 Signature 

My Multitouch Blog
My Youtube
Multitouch FAQ - Need Help? Click here!

Profile
 
 
Posted: 03 April 2008 02:14 PM   [ Ignore ]   [ # 5 ]
Sr. Member
Avatar
RankRankRank
Total Posts:  398
Joined  2007-09-18

great , a lantern to show the darkside !!

 Signature 

http://sassexperience.org

Profile
 
 
Posted: 03 April 2008 03:51 PM   [ Ignore ]   [ # 6 ]
New Member
Avatar
Rank
Total Posts:  87
Joined  2008-01-16

I am currently commenting CTouchScreen.cpp which I think would be the most helpful for beginners to really grok. I don’t have permission to include the comments in the latest code, but I will be posting it here and on my website for viewing or downloading.  It is long, boring, tedious work to comment someone else’s code.  I haven’t contributed any code yet, so I’m bound to misinterpret code or explain something wrong, but I hope I do well enough for the masses.

 Signature 

EasterIsland, LLC.
My Signature Quote

Profile
 
 
Posted: 06 April 2008 09:12 PM   [ Ignore ]   [ # 7 ]
New Member
Avatar
Rank
Total Posts:  87
Joined  2008-01-16

Here you go! smile I hope this helps a little.  I’m going to try to have a more in-depth, easier to read explanation later.

File Attachments
CTouchScreen.rar  (File Size: 9KB - Downloads: 245)
 Signature 

EasterIsland, LLC.
My Signature Quote

Profile
 
 
Posted: 07 April 2008 11:09 AM   [ Ignore ]   [ # 8 ]
Jr. Member
Avatar
RankRank
Total Posts:  121
Joined  2008-01-28

thnx man !!! ....
tht will surely help !! ......
waiting for a few more though ... [wink]

 Signature 

..’m not the best..but ‘m not like the rest....

Profile
 
 
Posted: 06 May 2008 10:01 AM   [ Ignore ]   [ # 9 ]
New Member
Rank
Total Posts:  59
Joined  2007-07-09

I figure this would be the tread to ask this question. I’ve been looking at the source code to figure this out without much success.
How does touchlib figure out if the blob from the last frame is the same as the blob from this frame? I think it happens here but its all a bit confusing.

// now figure out the 'error' for all the blobs in the current frame
    

        for(i=0i<cursizei++)
        
{
                current[i]
.error.clear();
                
current[i].closest.clear();

                for(
j=0j<prevsizej++)
                
{
                        float error 
0.0f;
                        
error getError((*prev)[j]current[i]);
                        
current[i].error.push_back(error);
                        
current[i].closest.push_back(j);
                
}
        }


       
..............All the way to here.........

                    if(
best_error_ndx != -1)
        
{
                
for(i=0i<cursizei++)
                
{
                        
if(matrix[best_error_ndx][i] != -1)
                                
current[i].ID = (*prev)[matrix[best_error_ndx][i]].ID;
                        else
                                
current[i].ID = -1;

                        if(
current[i].ID != -1)
                        
{
                                CFinger 
*oldfinger = &(*prev)[matrix[best_error_ndx][i]];
                                
current[i].delta = (current[i].center oldfinger->center);
                                
current[i].deltaArea current[i].area oldfinger->area;
                                
current[i].predictedPos current[i].center current[i].delta;
                                
current[i].displacement oldfinger->displacement current[i].delta;
                        
else {
                                current[i]
.delta vector2df(00);
                                
current[i].deltaArea 0;
                                
current[i].predictedPos current[i].center;
                                
current[i].displacement vector2df(0.0f0.0f);
                        
}
                }

                
//printf("Best index = %d\n", best_error_ndx);
        
}

Thanks,

Alain

Profile
 
 
Posted: 16 June 2008 03:24 PM   [ Ignore ]   [ # 10 ]
New Member
Rank
Total Posts:  87
Joined  2008-05-20

Seeking for better documentation of touchlib here as well… like class diagrams etc.

Profile
 
 
Posted: 16 June 2008 03:46 PM   [ Ignore ]   [ # 11 ]
New Member
Avatar
Rank
Total Posts:  87
Joined  2008-01-16

I am trying to comment the source so that it’s compatible with Doxygen formats.  Doxygen provides meaningful graphs on class inheritance and dependencies pretty much automatically once the code is properly commented.  That is a *huge* task that I am working on a little bit each day. Next few weeks and I should have everything up on a website for everyone’s browsing pleasure.

 Signature 

EasterIsland, LLC.
My Signature Quote

Profile
 
 
Posted: 17 June 2008 02:20 AM   [ Ignore ]   [ # 12 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  549
Joined  2006-11-09

Hey Adam let me or Cerupcat know if you need any help on that… I’m sure its a daunting task.

 Signature 

~

Profile
 
 
Posted: 17 June 2008 07:58 AM   [ Ignore ]   [ # 13 ]
New Member
Rank
Total Posts:  87
Joined  2008-05-20
Adam - 16 June 2008 03:46 PM

I am trying to comment the source so that it’s compatible with Doxygen formats.  Doxygen provides meaningful graphs on class inheritance and dependencies pretty much automatically once the code is properly commented.  That is a *huge* task that I am working on a little bit each day. Next few weeks and I should have everything up on a website for everyone’s browsing pleasure.

great! can’t wait to see… anyway will u be explaining the algorithm for the detection and tracking?

cheers

Profile
 
 
Posted: 17 June 2008 04:16 PM   [ Ignore ]   [ # 14 ]
New Member
Avatar
Rank
Total Posts:  87
Joined  2008-01-16

Okay, I had time today to run the touchlib rev.395 through Doxygen and post it to my site. It’s not perfect or pretty, but we’ll fix that.  Remember that it’s nothing at all like a tutorial but definitely a good read for a newbie to poke around in. Just click on the touchlib button on my home page http://easterisland-llc.com

 Signature 

EasterIsland, LLC.
My Signature Quote

Profile
 
 
Posted: 18 June 2008 05:52 AM   [ Ignore ]   [ # 15 ]
New Member
Avatar
Rank
Total Posts:  21
Joined  2008-04-25

great job, good link adam!!

Profile
 
 
   
1 of 2
1