Log in or register to post comments

Fetch id of detected frame marker, and dynamically assign an object to it?

January 14, 2011 - 11:05pm #1

This is probably too late for the contest, but I'd still like to play with QCAR even after the contest. Staring at the QCAR Hands Logo image too much reminds me that... One of my quirky New Years Resolutions is to learn ASL... So, might as well try learning ASL with some nifty Augmented Reality ASL "3d flashcard spelling blocks" (and, eventually scrabble o.O)

The brute force way to make something like that in Unity QCAR is to just lay out all the frame markers and assign each hand model to each marker.

Is there a way to know which marker is being tracked, and to assign a model to the marker being tracked?

Re: Fetch id of detected frame marker, and dynamically assign an

September 13, 2011 - 4:46pm #8

That's right, you'll want the TrackerBehaviour script now. I should issue a general warning that these scripts are subject to change in future versions, so edit at your own risk!

You no longer have to disable the editor functionality to keep extra frame markers in the config file. Select the FrameMarker prefab, right-click on the MarkerBehaviour script in the Inspector, choose Advanced Settings, and uncheck the Marker Synchronization box.

- Kim

Re: Fetch id of detected frame marker, and dynamically assign an

September 13, 2011 - 2:24pm #7

The script is attached to the AR camera prefab anyway. That should help you locate it if it's placed somewhere else.

I'm still using it in the latest android and ios release. (We made a single-project solution that can target both platforms). It allows us to track all 512 id's on both android and ios.

Re: Fetch id of detected frame marker, and dynamically assign an

September 13, 2011 - 1:53pm #6

Hello Kim,

The TrackerScript.cs file doesn't seem to be in that folder anymore. Is there still a way to implement the solution you gave in this thread?

Thank you!

Re: Fetch id of detected frame marker, and dynamically assign an

July 13, 2011 - 8:21am #5

When applying this hack,
if multiple markers with the same id are in view. Do i loop through both? (enabling me to assign object A to the first and B to the second?

Re: Fetch id of detected frame marker, and dynamically assign an

January 15, 2011 - 6:02pm #4

The frame marker IDs run from 0 to 511. You can put all of those in your config file, although you won't be able to track that many at once :) There's no real limitation to how many you can track at once, just a practical limitation in terms of how many you can fit in the camera view.

- Kim

Re: Fetch id of detected frame marker, and dynamically assign an

January 15, 2011 - 11:10am #3

Kim.. How many markers can we assign for individual objects... Is there any limitation to this....

Re: Fetch id of detected frame marker, and dynamically assign an

January 15, 2011 - 7:55am #2

I'm afraid the brute force way is the easiest way in this iteration of the Unity extension. That is, drag out one FrameMarker prefab per frame marker you want to track. There is a way around this however :)

1) Disable automatic overwriting of the config.xml file. Open the Editor/QCAR/Scripts/ConfigParser.cs file. Comment out everything in the structToFile function.

2) Open the StreamingAssets/QCAR/config.xml file. Add a frame marker line for each frame marker you want to track. Be sure to give each one a unique name!

3) Now you have to dive into the TrackerScript.cs file (located in Qualcomm Augmented Reality/Scripts). In the LateUpdate method, there is a section that loops through all the visible trackables for the frame. Your markers will not have TrackableScript objects associated with them, because you did not add prefabs for each markers. You can insert some code here to handle visibility changes for your markers, however, simply look up the marker name using the getTrackableName function.

It's a bit tricky, but everything you need is there. Let me know if you have any questions!

- Kim

Log in or register to post comments