Log in or register to post comments

Anchor a character to the ground

November 6, 2016 - 10:50am #1

To start, I'm developing a Unity mobile app (iOS to start, then hopefully Android).  I've got a few apps in the iTunes app store, developed using both Xcode (objective-C) and a few Unity specific apps, however this is my very first integration with Vuforia.  

I just tried the FindThePenquin sample from the Best Practices section of the Vuforia Developer Portal and everything worked good.  

My question stems from the description of this sample on the portal page is states:

"...With Vuforia you can anchor a character to the ground so that you can actually walk around it and get closer."

Can someone explain how I get started with this very thing?  I'm confused because the FindThePenguin sample has two features.  The first, when the application starts, it where the user turns in a circle (rotating the iPhone around) until the correct angle is achieved, at which time the user will see the penguin in the scene (on the screen).  After seeing the penguin, the next feature uses a 2D target for tracking, but I'm not interested in the 2D tracking functionality (at least I don't think).  

What I want is to be able to walk up to the anchored 3D object, and walk around it (as mentioned by the description).  

Is this possible?  

Should I be using 2D tracking for this?

Can I rotate around with my device and see multiple anchored 3d game objects, and walk up to (and around) them?

Lastly, I wanted to mention where I'm going with this (in case it's relevant)...ideally I want to place 3D game objects into a scene based on latitude/longitude.  I have this functionality working perfectly in my Unity project using google static maps following this tutorial https://ralphbarbagallo.com/2013/02/19/displaying-maps-in-unity3d/.  I would like to take this to the next level using Vuforia and AR and I just need to figure it out.  If I'm on the wrong track with the FindThePenguin sample please let me know.  As a "plan B" I thought maybe I could do something like the following:

1.  Determine where the 3D map markers (Unity game objects) are in pixel coordinates in the static map texture.

2.  Calculate the UV coordinate of the pixel coordinate.

3.  Calculate the world coordinate of the texel the UV coordinate resides at.

4.  And finally convert this to Vuforia ARCamera coordinates (simple right?  LOL)

Like I said, I have #1-3 above working perfect.  I just need #4 solved.

Any ideas on this would be super appreciated, including if it's even possible.  Thanks everyone

 

 

Log in or register to post comments