Log in or register to post comments

[Q] Tower model does not show in ImageTarget sample code

September 30, 2015 - 4:18am #1

I'm working with the ImageTarget sample code in Unity Pro 5.2.0f3.

It works fine with the teapots but the tower model does not show up on the target. It does show up in the editor. I already dropped the Teapot material on the Tower model, thinking that it could be a renderer issue.

Why would this be?

Any advice much appreciated.

//Tom

AttachmentSize
Image icon Screen Shot 2015-09-30 at 12.51.00.png619.27 KB

[Q] Tower model does not show in ImageTarget sample code

October 1, 2015 - 12:13am #3

Ahah: just discovered that there is a settings screen in the iPhone executable which has an 'extended tracking' switch. This does help to show the 'tower' model. Apparently the 'extended tracking' switch in the app is not the same as the 'extended tracking' switch in the Unity editor?

[Q] Tower model does not show in ImageTarget sample code

September 30, 2015 - 4:58am #2

Ah. I just discovered the onTrackingFound handler in imageTargetTrackableEventHandler. The Tower model shows up when I add it as an else if clause (commented out below). 

But the code suggests that the tower model should show up when Extended Tracking is enabled. Now I've ticked the Extended Tracking box in the Unity editor but that doesn't seem to make a difference. What am I missing?

        // Enable rendering:
        foreach (Renderer component in rendererComponents)
        {
            if(ImageTargetUIEventHandler.ExtendedTrackingIsEnabled)
            {
                if(component.gameObject.name == "tower")
                {
                     component.enabled = true;
                }
            }
            /*
	    else if(component.gameObject.name == "tower")
	    {
	        component.enabled = true;
	    }
	   */
	    else if(component.gameObject.name == "teapot")
            {
                component.enabled = true;
            }
            else if(component.gameObject.name == "Cube")
	    {
		component.enabled = true;
	    }
        }

 

AttachmentSize
Image icon Screen Shot 2015-09-30 at 13.57.15.png298.59 KB
Log in or register to post comments