Page 1 of 1

Controlling each finger

Posted: Wed Jun 21, 2017 8:04 pm
by Mr. Kibernetik
This is an example of controlling each finger during multitouch interaction.
This program allows to draw with several fingers simultaneously. Each finger gets its own drawing color.

Code: Select all

#.drawsize(20)
>
  > i, 1..#.tap()
    x,y = #.tap(i,2)
    ? #.tap(i)
      ox = old(oldx,i,x)
      oy = old(oldy,i,y)
      #.drawcolor(#.hsv2rgb(i*60,1,1):3)
      #.drawline(ox,oy,x,y)
    .
    oldx[i] = x; oldy[i] = y
  <
  > j, i..10
    oldx[j],oldy[j] = -1
  <
<
old(array,i,v)=
  x = array[i]
  ? x<0
    <= v
  .
  <= x
.
wp_ss_20170622_0002.png
wp_ss_20170622_0002.png (85.74 KiB) Viewed 2533 times