Objective:

  • Use gesture to select an auto-generated button
  • Generate new design object from backend compiler

Implementation Steps

  1. Detect hand gesture at every frame, when current gesture is the gesture defined for creating (in our example case, gesture "point"), ready for creating.
  2. Find index fingertip position.
  3. Find the button that is within range (use button's WithinRange function as defined before).
  4. Detect the vertical distance between fingertip and the within-range button.
  5. If the vertical distance <= "hover threshold" and > "touch threshold", send "hover" signal along with button name (= new object type name) to Update function; change button color to "hover color" (orange).
  6. If the vertical distance <= "touch threshold", send "touch" signal along with button name to Update function; change button color to "touch color" (green).
  7. For buttons that are not within range or the vertical distance > "hover distance", all in original/reset color and status, send no signal to Update function.
  8. In Update function, if the previous frame receives "hover" signal, and the next frame receives "touch" signal (simulate process of pressing a real button), then act on the button name.
  9. If the button name is object name, send it to backend compiler, and generate new object with initial default parameters.
  10. If the button is one of the functional buttons ("Reset", "Export", "Delete", "Exit"), define and act correspondingly.
  11. For convenience of usage, implement "Export" anytime before "Reset", "Delete", and "Exit".
  12. "Reset", "Export", and "Delete" require first select an object and then take actions.
  13. "Export" saves both STL file of the selected object and parameters in a text file.
  14. "Reset" moves the selected object to initial default position, rotation and scale, and all the parameters return to the initial default values.
  15. "Delete" destroys the object.
  16. "Exit" exits the system whether in developer's window or play mode.

Demo video of creating new objects

In this demo video, the hand created a Paperbot, a Cat Foil, a Caramaran, and a Rocker Chair.

Limitation:

  • As seen from the video, when the object is complicated or large, the creating process can take few seconds and the whole scene is frozen during the process.
  • The new object is created in the same position every time, which might cause some unnecessary collision and affect user experience.

Next Post Previous Post