Tuio-Client for BlitzBasic/Blitz3D
Posted: 24 October 2009 09:06 PM   [ Ignore ]
Rank
Joined  2009-10-15
Total Posts:  17
New Member

Hi there,
I finally got a Client for TUIO in BlitzBasic/Blitz3D working.

After checking the code provided in Thread http://nuigroup.com/forums/viewthread/6165/ I did some research by myself and began from scratch.

It’s quick and dirty, so many functions the OSC provides are not implemented, but the TUIO-Stuff works.

I encountered some problems though:

- Why do i have to swap x and y coordinates for CCV?
- Sometimes, when i touch a certain point on the screen, bytes are missing in the stream (?)
- Maybe caused by the previous problem, the touches near the edges of the screen aren’t properly displayed

Is someone able to help?

What do you guys think? I attached the file below.

Greets,
miLORD

File Attachments
BB_TUIO.zip  (File Size: 573KB - Downloads: 530)
Profile
 
 
Posted: 25 October 2009 12:00 AM   [ Ignore ]   [ # 1 ]
Avatar
RankRank
Joined  2008-11-28
Total Posts:  122
Member

Hot Dang! Beat me to it! :D
Thanks so much for posting!

For an answer to question/problem #3 --> In CCV for some reason when you touch near the edges it will send out 0,0 or bad coordinates… I have no idea why but I remember reading this somewhere on the forums.

Thanks again!

Profile
 
 
Posted: 25 October 2009 10:09 AM   [ Ignore ]   [ # 2 ]
Rank
Joined  2009-10-15
Total Posts:  17
New Member

Are you checking the code and develop it as well, or are you just using it?

If you develope: Is german okay for you? I commented on all the things in german - i can change it to english if you want me to.

EDIT: Oh and thx for answering that question!

Greetz,
miLORD

Profile
 
 
Posted: 25 October 2009 12:14 PM   [ Ignore ]   [ # 3 ]
Rank
Joined  2009-10-15
Total Posts:  17
New Member

Update:

I now added paket\active and ID_number.

paket\active shows how many times the paket has been set. If it is 1 the paket is completely new.
Above it, the blob was dragged or held and therefore existed before the current frame.

ID_number is the number of all currently active pakets.

And the whole thing is optimized for including now, it’s no standalone anymore. But you can easily set up your own frame-program.
I attached a sample below.

Hope it helps,

miLORD

P.S.: Sorry for double-posting smile

File Attachments
TUIO_BB_Include.zip  (File Size: 3KB - Downloads: 440)
Profile
 
 
Posted: 25 October 2009 12:44 PM   [ Ignore ]   [ # 4 ]
Avatar
RankRank
Joined  2008-11-28
Total Posts:  122
Member

I’ve found out why I was getting some weird results in this.... You have it set to receive Y and then X coordinates from the stream but as you can see from the TUIO protocol specification, (http://www.tuio.org/?specification), the OSC message is sent in the order of X and then Y. This gave me a good laugh after wondering for about 2 hours why I was getting a blob nowhere near my finger!

Anyway, thanks for taking this a step further, adn I do intend to use it if I can. Thanks again miLORD!

Profile
 
 
Posted: 25 October 2009 04:51 PM   [ Ignore ]   [ # 5 ]
Rank
Joined  2009-10-15
Total Posts:  17
New Member

Hi hillbilly,
that’s really weird, because - as i wrote above - i had to swap X and Y coordinates to get proper results :D
Suppose my cam’s just weird… it’s a fairly old model anyway…

Sorry to cause this problem wink

In the next update i’ll change the language to english.

Take care!
miLORD

Profile
 
 
Posted: 25 October 2009 05:34 PM   [ Ignore ]   [ # 6 ]
Avatar
RankRank
Joined  2008-11-28
Total Posts:  122
Member

hmmm.... strange nevertheless, this works for me. Now to develop! smile

Profile
 
 
Posted: 25 October 2009 05:47 PM   [ Ignore ]   [ # 7 ]
Rank
Joined  2009-10-15
Total Posts:  17
New Member

Does it work all the time?
I encountered problems with some cursorpositions, wich is a problem when dragging things like rects around my screen…

Have fun, and keep me up to date about all the beta-testing.
You’re my only tester so far smile

Thanks in advance,
miLORD

Profile
 
 
Posted: 25 October 2009 06:46 PM   [ Ignore ]   [ # 8 ]
Avatar
RankRank
Joined  2008-11-28
Total Posts:  122
Member

well what happens is when you get towards the center, the positions are normal, and acurate but then as you move towards the sides or bottom, they get a bit off.. This could be because sf my camera’s unbalanced position though, I don’t know. But, I have calibrated with CCV so I don’t think that my camera’s unbalaced position has anything to do with it… hmmm

Profile
 
 
Posted: 25 October 2009 07:08 PM   [ Ignore ]   [ # 9 ]
Rank
Joined  2009-10-15
Total Posts:  17
New Member

Nope, it doesn’t.

That’s why i’m totally NOT happy with the client so far.

- Still the edge-issue, the whole sensing area seems to have moved a bit on display and/or has some kind of fishlens-effect?!?!?
- Still the errors where not enough bytes are sent

Check the Debug-Console, there are the errors listed in detail. At certain points i get “set failed: not enough bytes”, same for fseq.
As a result, there are sometimes “Wrong adress"-failures as well. These occur often like that:

#bundle ...(all that stuff) BUT ONE BYTE MISSING so that the next adress is tuio/2dcur instead of /tuio/2dcur

so the wrong adress-failure is called.

Why the bytes are missing? Beats me, i haven’t found out yet.

miLORD

Profile
 
 
Posted: 25 October 2009 07:16 PM   [ Ignore ]   [ # 10 ]
Avatar
RankRank
Joined  2008-11-28
Total Posts:  122
Member

hmm… I really don’t know… but anyway, a temporary way to maybe solve this would be to divide (scale) the positions by multiplying by like .96 or something and then center them. But remember, only temporary… -_-

Profile
 
 
Posted: 26 October 2009 06:00 PM   [ Ignore ]   [ # 11 ]
Avatar
RankRank
Joined  2008-11-28
Total Posts:  122
Member

Well, I repositioned the webcam in my table today and it’s fairly straight so I went to CCV and ran and calibrated and then back to Blitz and the blobs are nearer than when I had my webcam slightly tilted to the left. So the whole thing revolves around the positioning of your/my webcam; if it’s not in the center, the blobs will be off-target.

Profile
 
 
Posted: 26 December 2010 04:30 PM   [ Ignore ]   [ # 12 ]
Rank
Joined  2009-10-15
Total Posts:  17
New Member

Seems like noone is interested in a basic-based client, my project was on ice. Without any help regarding the missing bytes…
Dunno what happened to hillbilly - must’ve lost him on the way to a fully-functional client. If i’d work, it’d be in the clients-section i think - wouldn’t that be great? (C’mon, write history bluhbluh...)

And Hafid - any debugging yet?

Regards,
miLORD

Profile
 
 
Posted: 31 December 2010 02:38 PM   [ Ignore ]   [ # 13 ]
Avatar
RankRank
Joined  2008-11-28
Total Posts:  122
Member

I’m still here.... O_o

I haven’t had much luck though with the missing bytes problem so I kind-of gave up… I really don’t know what is causing it and I’m still not sure what it even means. My lack of understanding the OSC protocol really puts me at a disadvantage in this subject. Sorry, miLord :/

Profile
 
 
Posted: 05 January 2011 02:56 AM   [ Ignore ]   [ # 14 ]
Rank
Joined  2009-10-15
Total Posts:  17
New Member

Good to see you wink
I’ll try a new approach I think… The string-based decoding isn’t much good after all…

We’ll see.

Regards,
miLORD

EDIT:
Maybe the Linefeed commands caused an End of Line, so there were bytes missing. Hopefully this will be fixed with the bytewise interpretation of the stream. Got the first bytewise version running…

Profile
 
 
Posted: 24 January 2011 11:37 AM   [ Ignore ]   [ # 15 ]
Rank
Joined  2009-10-15
Total Posts:  17
New Member

Have you worked with the last client yet? As posted earlier, there was some strange kind of fishlens-effect and certain blob-positions provoke a missing-bytes-bug, wich couldn’t be solved yet. My latest conclusion is, that at these positions a EoL is called, so that all bytes following are lost. I’m currently trying to make it bytewise without the ReadLine command.

Regards,
miLORD

Profile