I am not sure if I understood your requirement correctly, but I think you try to following workflow:
- use the tracking aqcuired event for the Image Target to start a function.
another option is to check the istracked property of the image target widget e.g. : app.view['Home'].wdg['imageTarget-1']['istracked']. You can e.g. create a binding to parameter:
and the use $watch construct to check if there is change for the istracked value:
if( val==true) //tracked
//play this code first time and set a global variable to
//ignorre further changes later
Means that you can use such sample event to call a function . Because you can lose the tracking and start it later again - in this case you have to pay attention to start only one time--e.g. when the function is started first time you can set a global variable and always check when tracking was acquired if the variable was already set.
The started function will move then the model by setting the coordinate. Here is not clear:
- what should be moved - the whole model (model widget) or only particular component - modelItem. (the principle should be the same but different type of widgets.
- is the direction clear e.g. in positive z direction or is it depending on the camera position / the position of your device?
-movement should be continuous movements / speed or it could be a jump - value change only. For speed you can use an interval function.
- it is important that when you move component (modelItem) you need to unset the sequence property of the model widget because it could block the movement of a particular modelItem. When you move the complete model widget - in this case this is not relevant
Here to the mentioned above the following post could contain a helpful information: