Hello,
I'm newbie in Vumark. I want to make a simple app that get the ID of a trackable Vumark and depending on the ID, It swap the 3D model.
For example :
public VumarkTarget vumark;
public Gameobject teapot;
public Gameobject tower;
if (vumark.ID = 1)
{ teapot.setactive(true);
tower.setactive(false);}
else {
teapot.setactive(false);
tower.setactive(true);
}
I wonder how can I instantiate my vumark via editor or via script like I can do to Gameobject (teapot and tower) ? I read the vumark sample and the imagetarget sample but I couldn't understand how I instantiate my vumarktarget to get its ID.
Thanks for helping
To answer your question directly:
1 - Update() is a continuous loop that runs over and over as long as your application is running.
2 - foreach is another form of loop but these are specific and need direction like "loop through each vumark".
3 - This entire foreach loop is basically saying:
- For each vumark you find remember it (vumark = bhvr.VuMarkTarget)
- If its ID is "VuMark00", then turn on the teapot and turn off the tower
- If its ID IS NOT "VuMark00", then do the opposite (teapot off, tower on)
So, for example, if you wanted to do something ONLY for a vumark with an id of "VuMarkCowFace":
Hope this helps.