1 of 2
1
multi touch in other script languages
Posted: 28 July 2007 06:48 PM   [ Ignore ]
New Member
Rank
Total Posts:  36
Joined  2007-07-28

Hello

IM into game scripting. And the program i use for scripting uses something like lite-C or Wdl language.
Actually 3d game studio, i don’t know if you guys know this program, but its very good for 3d aplications.

So..is it possible for me to do games with the MT feature? What kind of components do i need to use, to use more then 2 cursores?

touchlib, has mouse driver.exe thing, what is it for? to create multi touches? i tryied it with paint and it messed up, the number of touches..

how do i get my 3ds game maker program, to understand the MT .. :S

Thanks.. the solution to this would allow me to make wonderful applications.

Profile
 
 
Posted: 28 July 2007 08:24 PM   [ Ignore ]   [ # 1 ]
Administrator
RankRankRank
Total Posts:  300
Joined  2007-01-08

basically you will need a programing environment that can accept XML or OSC input.  That’s what touchlib uses to send the blob ID, X and Y data of each touch.

Then it’s up to you to use that data to make MT interfaces etc.

Profile
 
 
Posted: 29 July 2007 06:40 AM   [ Ignore ]   [ # 2 ]
New Member
Rank
Total Posts:  36
Joined  2007-07-28

ok..
Is there anyway i can use the Blob tracking as a plugin?
having the whole tracking process to finger position event written in a plugin as a Dll..? so that my engine can then read and acess the events and finger data and use it?

Profile
 
 
Posted: 29 July 2007 08:59 AM   [ Ignore ]   [ # 3 ]
Sr. Member
RankRankRank
Total Posts:  314
Joined  2007-03-13

i agree with Joobs. xml/osc is the easiest way.

but if you want to go the dll way,you’ll need to find a way to ‘integrate’ touchlib into your app. what i mean is that you’ll have to write code in c++ to send the touches to your game.

what’s the scripting language called?then i’ll also look into it.

 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: 29 July 2007 01:15 PM   [ Ignore ]   [ # 4 ]
New Member
Rank
Total Posts:  36
Joined  2007-07-28

The language is c-script with uses WDL something like this:

var screen_color[3]1,0,0;
var 
time_passed;
var 
time_control;
panel timer_pan{    
digits
(0,0,"%1.0f",_a4font,1,time_passed);
    
digits(0,10,"%1.0f",_a4font,1,time_control);
    
flagsvisible;
}

function main(){    
while(1)    {
        
if(time_control<= 0)
        
{...}

you can go the engine webpage: http://www.3dgamestudio.com/

Another question.. I have the c++ of touch lib, now what files do i need to export the touches events, and how do i export the touch events as functions or don’t know.. thats why im asking for help…

The code i will need to have to work in my engine might be something like this..

IF touch is detected, assign an id to that touch, and store that touch ID positions (x,y), since each touch needs different ID’s to avoid messing coordinates.
Then, each id positions will generate what i want, maybe a click event or a particle spawn on that position.

The question is that i don’t know exaclty how to deal with the touch events and how to make the engine understand..

maybe Everything i would need is, having the mousedriver application to generate touch id coordenates as strings or functions that will be read using the dll plugin (which contains the touch output ids and positions..)

This 3d engine things is very good for graphic content, and if this can be possible to use the dll, then there are alot of cool interfaces that can be done..

But it is also compatible with c++, using a dll, soo i can write the code in c++ , and then, use some lines to import and read that plugin code(dll) to use it on my engine.

Profile
 
 
Posted: 29 July 2007 03:13 PM   [ Ignore ]   [ # 5 ]
Sr. Member
RankRankRank
Total Posts:  314
Joined  2007-03-13

ok, so before i really dig in, can the compiler of the c-script language compile normal c++ code?  if it can, this will be very easy to do. otherwise, you’ll have to drag COM into this (where i might already have a solution for you).
from what i gathered while I quickly browsed the website, is that it is like an extended c++…

to test it, just write some normal c++ code: (you might need to check more complicated than this, like pointers and so)

int intOne 15;

for working with touchlib, have a look at how the OSC.cpp file looks, that is a basic template to working with touchlib, you need to implement ITouchListener.

 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: 29 July 2007 03:54 PM   [ Ignore ]   [ # 6 ]
New Member
Rank
Total Posts:  36
Joined  2007-07-28

that did not worked in direct c-script, Thats where the DLL ( plugin) comes in!
I have to invoke that int intOne = 15; line from the dll done in c++!
I will try it as a plugin…

Profile
 
 
Posted: 29 July 2007 04:34 PM   [ Ignore ]   [ # 7 ]
Sr. Member
RankRankRank
Total Posts:  314
Joined  2007-03-13

a while ago i wrote a wrapper for touchlib that i used to get touch events into .NET applications. it might just work for this as well. It’s a DLL.

attached is the source files, and the DLL. all i can think were a problem would be is how you get the dll to send those events into your app. the dll provides you with initializing touchlib and so, the CFeedback class then sends the events somewhere, so the code should go into that class to get it into you app. ( the code for that is at the bottom of TouchlibWrapper.cpp)

File Attachments
TouchlibWrapper.zip  (File Size: 20KB - Downloads: 100)
 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: 29 July 2007 04:58 PM   [ Ignore ]   [ # 8 ]
New Member
Rank
Total Posts:  36
Joined  2007-07-28

i can call functions like this using my engine.

dllfunction ldexpc(x,n);

the ldexpc is the function in c++…

then i can use that like this way:

ldexpc(y,n); // calculates x = y * 2n

Profile
 
 
Posted: 29 July 2007 05:13 PM   [ Ignore ]   [ # 9 ]
Sr. Member
RankRankRank
Total Posts:  314
Joined  2007-03-13

ok, so that should be able to get touchlib running. now the next part you need to get those touchevents sent into your app...hmmm...i see the language supports COM, so this shouldn’t be impossible. i’ll see if i can download the game studio and check if i can find a way. i’m really interested in this, next year i have to write a game for a university project, and i want to do a multitouch game...so naturally this will benefit us both!

 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: 29 July 2007 05:31 PM   [ Ignore ]   [ # 10 ]
New Member
Rank
Total Posts:  36
Joined  2007-07-28

well seeing your dll, how do i create the click event on a button.? i mean, the click event.. the output finger events should be managed like what?
if finger down then create particle on that finger position.. thats how it works?

Profile
 
 
Posted: 29 July 2007 07:14 PM   [ Ignore ]   [ # 11 ]
Sr. Member
RankRankRank
Total Posts:  314
Joined  2007-03-13

sorry,i had to leave irc. but check if you can’t find something on calling a lite-c function from c++. thats all we need!

 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: 30 July 2007 01:23 PM   [ Ignore ]   [ # 12 ]
New Member
Rank
Total Posts:  36
Joined  2007-07-28

yes i can.. im just now, trying to find the command to call the dll on the engine.. I lost the manual.. and arg .. well i will find out.. Anyway im trying to learning c++.

Another subject now:

IF i can interpolate the scripts, i also will have to run the video camera source and so right? but calling in my engine or, open it separatly.

OR is there any way that i could hhave a program running, and that program like OSC driver, sending values though the dll, so that my engine could read directly.?

Profile
 
 
Posted: 02 August 2007 02:44 PM   [ Ignore ]   [ # 13 ]
New Member
Rank
Total Posts:  36
Joined  2007-07-28

OK, I already know now how to do the Dll reading..

Ok so whats next??

By the whay i need to edit the wrapper dll you gave, with some litle tags, what will allow me to read it.. The tag is.. on the top

#define WIN32_LEAN_AND_MEAN        // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <math.h.>
// engine specific header file
#define DLL_USE    // always define before including adll.h to make Engine Read DLL AS AN EXTERNAL FUNCTION
#include "adll.h"    

///////////////////////////////////////////////////////////////////////
// the following function MUST be defined in your DLL

// DLL main entry point - normally this needs not to be changed
BOOL APIENTRY DllMainHANDLE hModule,
                       
DWORD  ul_reason_for_call,
                       
LPVOID lpReserved )
{
// make sure the library is linked
    
engine_bind();
    return 
TRUE;
}

And i need these headers , so that i can edit the function to work.. so the headers are:

#include <cv.h>  //this one
#include <cxcore.h>//this one
#include <highgui.h>//this one

#include "TouchScreenDevice.h" //this one

#include "resource.h" //this one

using namespace touchlib;

#include <stdio.h>
#include <string>

//this one

Thank you..

Profile
 
 
Posted: 03 August 2007 10:07 AM   [ Ignore ]   [ # 14 ]
Sr. Member
RankRankRank
Total Posts:  314
Joined  2007-03-13

ok,you want me to compile it with the extra info you need?

EDIT: why do you need those headers? like cv.h?

 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: 03 August 2007 10:34 AM   [ Ignore ]   [ # 15 ]
New Member
Rank
Total Posts:  36
Joined  2007-07-28

i don’t know, but those headers where in your source! and i cannot compile the project, without them (i guess)…

Ps: I sent you a PVT message! rasberry

NEXT PAGE

Profile
 
 
   
1 of 2
1