| View previous topic :: View next topic |
| Author |
Message |
ZW
Joined: 11 Jan 2007 Posts: 18
Digg It |
Posted: Mon Feb 12, 2007 5:27 pm Post subject: |
|
|
About custom functions:
I read somewhere that GlovePIE can call custom functions in .dll files, but never found any good documentation on how to do this. Anyone know more about this? |
|
| Back to top |
|
 |
TylerK

Joined: 18 Dec 2006 Posts: 384 Location: Springfield, IL
Digg It |
Posted: Mon Feb 12, 2007 5:31 pm Post subject: |
|
|
| ZW wrote: | About custom functions:
I read somewhere that GlovePIE can call custom functions in .dll files, but never found any good documentation on how to do this. Anyone know more about this? | You might be able to glean some info from the Get Pixel script: http://www.wiili.org/index.php/Get_Pixel
It's really the only thing I've experimented with as far as calling DLL functions goes. I'd love to know what other functions are out there. |
|
| Back to top |
|
 |
ZW
Joined: 11 Jan 2007 Posts: 18
Digg It |
Posted: Mon Feb 12, 2007 8:34 pm Post subject: |
|
|
Another question would be how GlovePIE handles the .dll functions. If we write custom functions in C or C++ which are linear, package them in a dll, and call it in glovePIE, will PIE actually run them linearly? If that were the case it shouldn't be too difficult to calculate relative velocity and position from accelerometer data.
Last edited by ZW on Mon Feb 12, 2007 8:37 pm; edited 1 time in total |
|
| Back to top |
|
 |
TylerK

Joined: 18 Dec 2006 Posts: 384 Location: Springfield, IL
Digg It |
Posted: Mon Feb 12, 2007 8:36 pm Post subject: |
|
|
| That's a very good question. Hopefully Carl can answer that one whenever he gets around to it. |
|
| Back to top |
|
 |
SwedishFrog Site Admin

Joined: 25 Jan 2007 Posts: 273 Location: New York
Digg It |
Posted: Wed Feb 14, 2007 8:49 pm Post subject: |
|
|
If you call dll functions, each call to the function should execute linearly (ie once) for every time glovepie calls it.
Since glovepie loops your code, the function call will execute over and over again indefinately until the script stops. This might give the illusion of the function executing non-linearly, but that isn't the case.
Query: Why would a velocity calculation require a dll function call? Is glovepie's math library somehow insufficient for this task? |
|
| Back to top |
|
 |
psyonide
Joined: 14 Feb 2007 Posts: 5
Digg It |
Posted: Fri Feb 16, 2007 12:26 am Post subject: |
|
|
How about:
| Code: | //This is some code...
:START
if do = this then
do that
goto start
else
goto end
//And it won't parse anything after this
endif
:END
|
Sort of like subfunctions, but more like BASIC coding...
If it already has this feature, just call me stupid and laugh, but at least tell me it does.
pSy |
|
| Back to top |
|
 |
SwedishFrog Site Admin

Joined: 25 Jan 2007 Posts: 273 Location: New York
Digg It |
Posted: Fri Feb 16, 2007 4:05 am Post subject: |
|
|
if you think you need goto commands then you probably don't understand that glovepie isn't linear. Glovepie executes your code out of sequence -- It threads the execution of the code to give the illusion of several parts of your code running at once. It also loops automatically back to the top once it reaches the bottom. This fact makes the goto command meaningless. I doubt glovepie even supports goto, but i'm not sure.
Also you should know that goto commands have been 'out of style' in the programming world for quite a while now. This is because they are conducive to hard to read code which is even harder to debug. |
|
| Back to top |
|
 |
|