Closed sean-wilk closed 10 years ago
I believe something like this should work:
var z_array = [];
document.addEventListener("headtrackingEvent", function( event ) {
z_array.push(event.z);
});
Thanks for the quick reply!
I had actually tried that already. Turns out after some digging I had made a stupid mistake elsewhere in my code, I'd just assumed I hadn't set the array up properly. Its all working fine now.
Also thank you for making such an amazing library.
Alright, cheers!
Hi,
Sorry if this is a stupid question, I am new to JavaScript and the like. I was wondering is there is a way to collect the data from an event (in this case I am trying to collect the z property from the headTracking event) and input it into an array?
I am trying to collect the data to work out the average of the heads z position over a given amount of time.
Let me know if anymore information is needed,
Cheers
Sean