image marker as trigger

0 votes
asked Jan 18, 2020 by holmesc123 (230 points)
Hi, i was wondering, after the marker detected, can we choose and select which AR model to display?

say for example, consider the following diagram, i want to click one of the button to display the respective model.
also, i can click other button to change other model to be display.
diagram: https://imagizer.imageshack.com/img922/9319/KB0Hcz.png

i know there is something that i should do with ImageTrackerFrameFilter and ImageTargetController. But which function should look in to that control the display of the AR model?

Thanks.

TM

1 Answer

0 votes
answered Jan 19, 2020 by kenn (18,750 points)
edited Jan 20, 2020 by kenn
Let's assume a basic understanding of how to change gameobject tree in Unity.

EasyAR Sense Unity Plugin does this: the ImageTargetController controls the object which the the script is on. The core idea is to control the relative transform of camera and the ImageTarget object (GameObject) to reflect real world spatial relationship, and generally touches nothing else.

All AR models are just normal Unity GameObjects, and are normally put under the ImageTarget object. So what you need to do is as simple as changing an object's children, with a little careful about local transform, to make the object bottom aligned with target (if all zero, it will be center aligned).

UPDATE: Take a look at AddCubeOnTarget in ImageTracking_CloudRecognition sample, that may help.
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...