Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology
Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered
You are not logged in.
Pages: 1
colleagues:
use as you wish. this is a modified button plugit, with these changes:
it tries to emulate a spring loaded joystick. so you can only initiate touchpoints from the vertical center. when you let go, movement stops and you must touch your finger to the vertical center of the throttle to get it moving again
if you are trying to control the walkthrough plugit z motion, link the throttle's 'throttle' event to the walkthrough.control action
set the throttle link dialog to:
0 0 $1
_ _ _
the throttle only outputs one parameter (fy, movement in the y axis, like a gas pedal.
the plugit prevents you from adding more than one touchpoint at any one time, if you have poor finger control or someone else is trying to interfere with your activities.
if you start moving your finger in the vertical middle of the throttle, and keep your finger down, you will move a walkgthrough plugit until you release your finger, regardless of what your other fingers or other people are doing to your touchscreen
todo: code cleanup, remove some of the button options (justification makes things tricky, especially when you are resizing the scene) make the alphabitmap that appears under the finger appear to snap back to the vertical center for more feedback, other bitmaps to indicate relative speed.
the .zip includes the image for the touchpoint only. use whatever you want for the throttle image, and feel free to replace the touchpoint image, just keep in mind the code is written for a touchpoint image that is 64x64 pixels
posted to:
http://ifam.net/mediaoctopus3d/throttle.zip
it works on my windows 8.1 dell venue pro tablet, let me know if it works for you
i plan to make a trackpad for x rotation/y rotation that behaves in a similar way.
Last edited by hebdemnobad (4-Dec-2014 15:59:36)
Offline
I updated the .zip file.....the throttle should handle mouse and multitouch events the same , although I haven't tested that (mouseclick should =addcursor behavior, and mouse move should = update cursor behavior), and i added code to allow for setting of z order of throttle. (I forgot to set z order of the touchpoint/mouseclick image, I will do that so it is always the z order of the throttle +1, that way you can put another button over the throttle, so it looks like you are moving the 'handle' of the throttle under the mouse/widget under glass or plastic (by setting the z order of the button on top of it to be higher, so you have, from bottom to top, the throttle image, the 'handle' widget, and then the glass/plastic covering.... I don't know who will be using mice and multitouch at the same time, and I don't have a machine to test that (I have to get a bluetooth mouse for my tablet to see how everything behaves.)
arkeon feel free to use code from editor for button plugit (the button plugit doesn't allow you to set zorder in the editor...maybe there is a reason for that that I don't realize.)
Offline
I updated the .zip file, I haven't tested on multitouch. You can now set the z order of the throttle and the relative size of the handle of the throttle as a percentage of the width of the throttle. (you can make the handle tiny or large, to your taste, but it will always be a square shape (height will equal width.)
When you release the mouse, the output (fy) is set to 0.0, If your mouse leaves the area of the button, the output (fy) is set to 0.0 as well. (I think that may be better as an option...will set that option tomorrow.)
I will also add a file selection box for the author to specify the image to be used for the throttle handle.
Last edited by hebdemnobad (2-Dec-2014 18:05:04)
Offline
hehe keep going
once finished and polished I'll add it int the next release
Thx!
It needs a lot of polishing. I think a power sander first.....
Offline
When I got the mouse functions working on the throttle, the multitouch functions broke.
I couldn't handle all of the different inputs affecting one another.
So I cleared out the mouse functions of any content. I am trying to think when someone using touchpoint would switch to a mouse, I guess that will happen with some touchscreen enabled laptop users.
Unless someone is ambidextrous, I think mouse events won't be needed for the throttle, but i will set up an action that can respond to keyboard or joystick input and the throttle will give the user feedback. And even if someone is ambidextrous, they will want their more accurate hand to be moving rotation. (I see some problem solving down the road, when I make a trackpad. In that case, someone using a touchscreen may switch to a mouse since the trackpad will be used for rotations...hmm, maybe this problem will come back but I won't worry about it today, and perhaps the conditional statements I put in the client file this morning will clear up problems if I put the mouse functions back in the throttle, but that is for another day...or I will make one trackpad plugit for touch, and another for mouse)
I posted the files to : http://ifam.net/mediaoctopus3d/touchpoi … 042014.zip
I think in that case plugits can be used, so if a mouse event occurs, the touchpoint throttle is disabled. If a multitouch event occurs (setPluginInstanceCbTouchPointAdd), the multitouch plugit will tell the touchpoint throttle plugit to be enabled again. More plugits, but less complicated coding. (for me at least.)
So basically this is where I was the other day, maybe I cleared some bugs up. there is still alot of junk code in the client. It does work with the button plugit, so I can use the throttle while using a button to steer, although I will be modding the throttle to be a trackpad instead of the button (since I put in conditions that prevent more than one touchpoint controlling the plugit at any one time.)
Offline
in the button plugit I set a boullean and disable mouse callbacks when a touch point is found, and reset the mouse callbacks when there is no more points.
you can also just call the plugit "touch throttle" and leave it to the user to use is or not and only for touch systems.
Offline
you can also just call the plugit "touch throttle" and leave it to the user to use is or not and only for touch systems.
yes that is what i'm thinking.
Offline
I updated the client and editor files to load and save a user-defined throttle handle. If the author doesn't specify a throttle handle image, the plugit uses res/tips.png. Tomorrow I will add an option to enable or disable the throttle handle in case the author finds it annoying. The remaining functionality I am thinking of is making the throttle handle move back to the vertical center of the throttle, like a spring loaded joystick.
ifam.net/mediaoctopus3d/touchpointthrottle12052014.zip
Offline
I updated the latest .zip upload, now the throttle handle "springs" back to the center of the throttle whenever the user removes a finger from the throttle. (except for extra fingers, which are ignored)
time to take a break from coding and do some cleanup of the code, it has all these conditions for mice events that I assume I should clean out.
Offline
I have tested this plugit both with a mouse on a laptop and touchpoints on a tablet, and it works identically. still i have some cleanup to do. and add an option to put the throttle on the left side of the screen or right, allowing the author and user to swap its position depending on preference.
i have not tested this on a tablet or touchscreen device while using a mouse and then using touchpoints...so there may be a bug there. i don't have a bluetooth mouse atm for the tablet.
when combined with a trackpad plugit, i don't know whether anyone will want to use this with a mouse, since you would need two mice. i've tried to set that up but gave up (at least using the sw i found)
Offline
I updated parts of the .xml file, editor and client. The update places padding between the throttle handle and the top and bottom of the throttle itself, so the handle doesn't move to high or two low. The -.1.0 to .1.0 values are adjusted taking into consideration the padding specified by the user.
I haven't coded the touchpoint behavior into this, so the adjustments just work with a mouse.
This is more or less like a slider control, where 0 is at the middle and the values go up or down from there. I think I will take some options out of the editor (such as the hover/active states)
Uses: moving a handle up and down and making numbers move from 0.0 up to 1.0 and 0.0 down to -1.0.
I plan to put in more options (swapping from left to right or vice versa. maybe making an option to make the throttle horizontal instead of vertical.
Iri I have taken your advice and have broken down some functions into smaller parts so several functions can call on a common function.
It makes things less confusing, but I see where whiteboards come in useful.
Offline
Pages: 1