Hello,
Can you please let me know the source code which is executed,when the image target is lost.for example in the project ImageTargets when the stone or chip imagetarget is detected the teapot is rendered,but when the focus on the chips or stones is lost,the tea pot is removed,where in the code is this handled.
regards
khegde
- Sort Posts
- 3 replies
- Last post
Code which is triggered when the image target is lost
January 24, 2012 - 7:36am #1
Re: Code which is triggered when the image target is lost
January 27, 2012 - 1:40am #4
Re: Code which is triggered when the image target is lost
January 24, 2012 - 8:20pm #2
This is handled in the renderFrame method in ImageTargets.cpp. This method is called each frame. For each visible target, the teapot is rendered using the pose matrix for that target for that frame. If no targets are visible, nothing is drawn that frame.
Note if you are using the Unity extension this work differently. See the TrackableEventHandler script.
- Kim
If you're using Android and Eclipse look under /jni/ImageTargets.cpp and have a look at the renderFrame method.
The teapot is rendered for every frame the trackable is in view. If the trackable is not in view then the teapot is not rendered for those frames.
There is not any sort of "unrendering" code.
If you want to trigger something when the focus on the target is lost you can try executing something like this in that method: