问题
I need to write a script in p5.js to track the position of the five fingertips (on one or both hands) at a set interval (e.g. 20 ms), and then save the time-finger data to a .csv
I have previously done this in Processing with Table and getting the PVector for the fingers, but I have no idea on how to do this with javascript.
Any and all input would be greatly appreciated!
回答1:
Stack Overflow isn't really designed for general "how do I do this" type questions. It's for specific "I tried X, expected Y, but got Z instead" type questions. But I'll try to help in a general sense:
You need to break your problem down into smaller steps and take those steps on one at a time. For example, are you asking how to connect a Leap Motion to a P5.js sketch? Or are you asking how to output a .csv
file from a P5.js sketch? Those two things are completely independent of each other, and that's how you should approach them.
Try to get a simple "hello world" sketch running. Now add very basic Leap Motion functionality: print something to the screen or the console. Separately from that, try to save a .csv
file that contains some hard-coded values. Then maybe do something like save the previous 100 mouse positions to a .csv
file.
Work your way forward in small steps like that, and if you get stuck, post a MCVE along with a more specific technical question. Good luck.
来源:https://stackoverflow.com/questions/48597177/save-tracking-data-from-leap-motion-with-p5-js-to-csv