AR With Printed Buttons

210 Views Asked by At

I made an AR Application that detects the printed marker & plays the video on it. I'd like to have a button printed on paper, which triggers an event when its blocked by a finger.

IMAGE LINK: http://tinypic.com/view.php?pic=23le2h2&s=7

The application development is to have an AR Quiz that works with simple printed paper & Webcam only. What is the best solution to have the button event triggered by hiding the marker?

Operating System: Windows PC

Framework: FLARManager

1

There are 1 best solutions below

0
Joao Belchior On

You just need to listen when and what combination of markers is active and make if statments like:

private function onEnterFrame (evt:Event) :void
{           
  if (this.activeMarker_1 && this.activeMarker_2)
  {
     trace("no button is being pressed");
  }
  else if (this.activeMarker_1 && this.activeMarker_2 == null)
  {
      trace("answer: no");
  }
  else if (this.activeMarker_1 == null && this.activeMarker_2)
  {
      trace("answer: yes");
  }
  else if (this.activeMarker_1 == null && this.activeMarker_2 == null)
  {
      trace("both buttons are being pressed");
  }
}