brianpeiris / RiftSketch

A virtual reality live-coding environment based on WebXR
https://brianpeiris.github.io/RiftSketch
MIT License
888 stars 100 forks source link

[Draft] text area position input selection #28

Closed pehrlich closed 2 years ago

pehrlich commented 9 years ago

This probably isin't ready to be merged, but I think presents an interesting concept:

To allow position parameters to be tuned using a Leap Motion controller. Functionally, the code would use regex to detect variables in the JS editor, and when the cursor is in position, allow a pinched-hand to be used to adjust the numbers in z,y,z at the same time, rather than keyboard shortcuts.

It's done as far as detecting when the cursor is over a variable, but hasn't been leap-enabled yet.

screenshot 2014-10-09 15 37 35

I have to put this down for a few days, but would be excited to resume work when possible.

Edit: this may be helpful as well - I've found that adding these lines to matrixFromOrientation flips the up-down on newer firefox VR builds, correcting the motion:

  // invert y so that up-down is correct
  m[1] = -m[1];
  m[5] = -m[5];
  m[9] = -m[9];
  m[13] = -m[13];
  m[4] = -m[4];
  m[5] = -m[5];
  m[6] = -m[6];
  m[7] = -m[7];
brianpeiris commented 9 years ago

It's not exactly what you proposed and it's definitely not as nice as your highlighting directive but 109dde5 hacks in a Leap controller to edit individual numbers. I kinda like the interaction and it allows you to change any number, not just positions. Although, now that I think about it, changing position or rotation triples might be even nicer in certain situations. Next iteration perhaps.

P.S. Thanks for the tip about the new builds.