Log in or register to post comments

Fluent transition from 1 MultiTarget to another

July 10, 2012 - 8:20am #1

Fluent transition between multiple MultiTargets

 

Imagine this:

I have a maquette. It contains several buildings.

For this I want to make a AR app that projects animations onto this maquette, using an iPad for example. Because this is an maquette, I want to be able to walk around it and at all times keeping the animations (or whatever that's projected) on screen. A problem that could occur is the height of the different buildings. I thought I could tackle this by making a few MultiTargets with roughly the same dimensions of the buildings.

So far so good. I made a test-setup with 2 cubes and each one is projecting the model at the right place. But the transition between the different MultiTargets is not as fluent as the transition between the sides 1 cube. So if I have one cube and rotate it 360 degrees everything is fine. But when I have 2 cubes in view, and cover 1 cube. It takes a while before the app registers the other cube.

If something is not clear than please ask and I will do my best to clarify.

Thanks!

 

P.S. Not sure if it's helpful, I'm not a programmer and the intern-guy is no longer working here, but we use the following code. Maybe it's helpfull?
It's a console thing that displays which marker is detected. We allways get only 1 detected. Even if we set the "Max simultaneous images" to 4 or so..

 

Sorry for the layout. At the moment I can't use ftp, so for the moment no .rtf.. Will fix the layout asap!

</p><p>using UnityEngine;<br />using System.Collections;<br /><br />public class GUIManager : MonoBehaviour <br />{<br />    public string consoleTitle = "Console";<br />    public int maxOutPutCounter = 25;<br />    public bool useConsoleWindow = true;<br />    public Vector2 debugWindowPos;<br />    public bool startBottom = false;<br />    public bool enableErrorSound = true;<br />    public AudioSource errorSound;<br />    // Use this for initialization<br />    private string output = "";<br />    private Rect debugWindowRect;<br />    private Vector2 scroller;<br />    private ScreenOrientation currentOrientation;<br />    void Start () <br />    {<br />        if(useConsoleWindow)<br />        {<br />            Application.RegisterLogCallback(handleLog);<br />            if(startBottom)<br />            {<br />                debugWindowPos.y = Screen.height - 250;<br />            }<br />            debugWindowRect = new Rect(debugWindowPos.x,debugWindowPos.y,Screen.width,250);<br />            scroller = Vector2.zero;<br />        }<br />        if(enableErrorSound)<br />        {<br />            errorSound.gameObject.transform.position = Camera.mainCamera.transform.position;<br />            errorSound.gameObject.transform.parent = Camera.mainCamera.transform;<br />        }<br />#if !UNITY_EDITOR<br />        currentOrientation = Screen.orientation;<br />#endif<br />        print("iPad console started!");<br />    }<br />    // Update is called once per frame<br />    void OnGUI() <br />    {<br />        if(useConsoleWindow)<br />        {<br />            debugWindowRect = GUI.Window(0,debugWindowRect,debugWindow,consoleTitle);<br />        }<br />    }<br />    void Update()<br />    {<br />#if !UNITY_EDITOR<br />        if(Screen.orientation != currentOrientation)<br />        {<br />            if(startBottom)<br />            {<br />                debugWindowPos.y = (Screen.height - debugWindowRect.height);<br />            }<br />            debugWindowRect.x = debugWindowPos.x;<br />            debugWindowRect.y = debugWindowPos.y;<br />            debugWindowRect.width = Screen.width;<br />            currentOrientation = Screen.orientation;<br />        }<br />#else<br />        if(startBottom)<br />        {<br />            debugWindowPos.y = (Screen.height - debugWindowRect.height);<br />        }<br />        debugWindowRect.x = debugWindowPos.x;<br />        debugWindowRect.y = debugWindowPos.y;<br />        debugWindowRect.width = Screen.width;<br />        currentOrientation = Screen.orientation;<br />#endif<br />        <br />    }<br />    void handleLog(string logString,string stackTrace,LogType type)<br />    {<br />        if(type == LogType.Log)<br />        {<br />            output += type +":" + logString + "\n";// + stackTrace;<br />        }<br />        else<br />        {<br />            output += type +":" + logString + "\n" + "stack: " + stackTrace + "\n";<br />            if(enableErrorSound)<br />            {<br />                if(!errorSound.isPlaying)<br />                    errorSound.Play();<br />            }<br />        }<br />        <br />        string[] newOutput = output.Split('\n');<br />        float scrollPosition = (newOutput.Length * 17) - (debugWindowRect.height - 50);<br />        <br />        if(scrollPosition < 0)<br />            scroller.y = 0;<br />        else<br />            scroller.y = scrollPosition;<br />        if(newOutput.Length > maxOutPutCounter)<br />        {<br />            output = "";<br />            for(int i = maxOutPutCounter; i > -1; i--)<br />            {<br />                output += newOutput[newOutput.Length - i] + "\n";<br />            }<br />        }<br />    }<br />    <br />    void debugWindow(int id)<br />    {<br />        scroller = GUI.BeginScrollView(new Rect(25,25,debugWindowRect.width - 50,debugWindowRect.height - 50),scroller,new Rect(0,0,Screen.width,Screen.height * 2));<br />        GUI.Label(new Rect(0,0,Screen.width,Screen.height * 2),output);<br />        GUI.EndScrollView();<br />    }<br />}<br /><br /></p><p>

Fluent transition from 1 MultiTarget to another

August 4, 2012 - 4:03am #6

Ok, I got your pm. Better to email me though. This forum doesn't provide a proper notification system when you get a new pm so I often overlook it. My email is in MarkerRecorder.cs in at the top, located in the UCS package.

Fluent transition from 1 MultiTarget to another

July 31, 2012 - 5:47am #5

Quote:

Try increasing your Max Simultaneous Image Targets value, on the ARCamera, until you see the tracking performance that you're looking for.

Tried that, didn't make any difference.

Would it be better if I made 1 ImageTarget per side of a building? So, 5 ImageTargets per building (all sides except bottom).
If I have, for example, 19 buildings, that would be 19x5=95 ImageTargets. Should work, right?

At moment like these I ask myself: isn't there a easier way to upload all these images to the online target management system at once?

@ Elecman
Did you get my pm?

Fluent transition from 1 MultiTarget to another

July 14, 2012 - 5:51am #4

Fluent transition from 1 MultiTarget to another

July 12, 2012 - 9:07am #3

Try increasing your Max Simultaneous Image Targets value, on the ARCamera, until you see the tracking performance that you're looking for.

 

Fluent transition from 1 MultiTarget to another

July 12, 2012 - 5:35am #2

So here is a quick render to show you what I mean. Basically every (well, not every, but as much as I need) building will get markers glued on it. So evey building will act like a MultiTarget.

For clarification; when I walk around the table (i.e. the fysical maquette) I want at any time that the maquette is trackable.

Anyone with tips/tricks to make this work?

Edit: anyone seeing the image I included in my post? If not here's the link: http://tweakers.net/ext/f/FeMIWQ35ms0QodpL2uZLJJ4R/full.jpg

Log in or register to post comments