Torch How-To: Track more than two images in a project

If you are looking to set up simple image target tracking, please first review the Image Tracking help page. If you have set up Image Tracking in Torch, you will learn that we are limited to two continuously tracked images per scene. This How-To will tell you how to set up a project to track much more than two images. Using this technique, we have seen projects track as many as 16 images and there's no reason that it couldn't track more. 

Summary

At a high level, this approach is a series of "image finder" scenes that look for images and automatically switch into each other to create a search loop. If any of the scenes in the loop finds the image, it will break out of the loop to the appropriate content scene. We use a trick with delayed interaction responses to enable the image detection to take place. 

The Delayed Scene Switch Trick

In order for the each finder scene to have the opportunity to run the Image Found interactions, we must delay the automatic scene switch. To control timing in an interaction, you can use the Curves Editor to set a delay and duration for responses specified by an interaction. At the time of this writing, there is not a way to enter a delay for the scene change response. But for interactions that do contain a scene change response, it is always executed last after the other responses in that interaction. Because of this, we can effectively control the timing of the scene change by putting in a simple object in the scene and set a property change on it. This delay can be a fraction of a second and this is long enough for the Image Found interactions to get run before the scene change.

Let's see what this looks like in practice...

This scene is looking for a banana or apple image. Otherwise it will move on to the next image finder scene. The key is that "No Images Found" interaction.

Above we are looking at the interactions in a "finder" scene that is looking for a banana or apple image. If either of the "Image Found" interactions fire, it will switch out of the scene loop. Otherwise it will hit the "No Images Found" interaction and move on to the next image finder scene which continues the loop. The simple magic is in that "No Images Found" interaction. 

Looking at the "No Images Found" interaction settings above, you can see it triggers on Enter Scene and in the responses, it has the scene change (under Action Response) but it also changes a scene object. 

At a minimum, one property of the object must be changed. In this example, we are simply changing the visibility. With this one property change, we can now go into the Curve Editor by tapping "Edit Curves" for this interaction.

Because this property change is happening in the same interaction as the scene change – and scene changes always happen last – we are effectively delaying the scene change by 0.1 seconds.

Example Scene Architecture with Interaction Details

Here is an example scene architecture for a project looking for four images.

Image Finder Scene 1  (looks for image A and B, automatically switches to Scene 2)
  • Content: any object that will be used for the scene change delay.
  • Scene Interaction - Trigger: Image A Found. Response: Change to Image A Scene
  • Scene Interaction - Trigger: Image B Found. Response: Change to Image B Scene
  • Scene Interaction - Trigger: Enter Scene Responses: Change object visibility, 0.1 second delay, Go to Finder Scene 2
Image Finder Scene 2 (looks for image C and D, automatically switches to Scene 1)
  • Content: any object that will be used for the scene change delay.
  • Scene Interaction - Trigger: Image C Found. Response: Change to Image C Scene
  • Scene Interaction - Trigger: Image D Found. Response: Change to Image D Scene
  • Scene Interaction - Trigger: Enter Scene Responses: Change object visibility, 0.1 second delay, Go to Finder Scene 1

Content Scene for Image A

  • Scene Interaction - Trigger: Image A Lost. Response: Change to any Finder Scene (1 or 2)

Content Scene for Image B

  • Scene Interaction - Trigger: Image B Lost. Response: Change to any Finder Scene (1 or 2)

Content Scene for Image C

  • Scene Interaction - Trigger: Image C Lost. Response: Change to any Finder Scene (1 or 2)

Content Scene for Image D

  • Scene Interaction - Trigger: Image D Lost. Response: Change to any Finder Scene (1 or 2)

Still need help? Contact Us Contact Us