Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Augmented Reality Capability in Unity

Discussion in 'General Discussion' started by joeycampbell, Sep 29, 2014.

  1. joeycampbell

    joeycampbell

    Joined:
    Sep 3, 2014
    Posts:
    5
    Hi - I 've a few questions linked with augmented reality in Unity if anyone has a free minute I'd appreciate any feedback.

    I was hoping to create a game where a person could 'collect' virtual objects composited in an augmented view by colliding with them. Is there any software that can check for a collision between a virtual object and a real object? (I know there is hand and facial tracking that could be used on a small scale project but what about on a larger scale (ie.if an athlete had to collect virtual coins on a running track).

    Is Vuforia the most uptodate plugin for AR Camera Tracking ?

    What is the spatial limit to how much of a real world environment can be tracked. Most of the examples I've seen involve compositing a virtual animal on a tracker on top of a coffee table. Can multiple tracker markers be used so that you could composit multiple virtual objects over a large surface area ?

    Thanks
    J
     
  2. 3agle

    3agle

    Joined:
    Jul 9, 2012
    Posts:
    508
    This is pretty difficult in most(if not all) existing AR plugins. You might be able to do it with help of gyro/gps data, but it wouldn't be easy and would probably have to be made from scratch.
    Project Tango devices will likely make this much much easier, though:
    https://www.google.com/atap/projecttango/#project

    Up-to-date as in most technically advanced? No, but it is a good API, and a great starting point for AR in Unity for sure.
    Take a look at http://www.metaio.com/ for something a little more technically snazzy (it has real world object tracking, rather than Vuforia which only really supports cuboid 3D object).
    More advanced solutions are coming along for marker-less tracking but as far as I know I haven't seen any in Unity yet.

    This is a tough one to answer. Technically if your tracking image is accurate enough and your camera good enough, you could target an entire building, but I have not tested it. It all depends on your scales, and camera.
    Multiple markers can be used in Vuforia (and I believe Metaio too), how you utilise them is up to you really.

    I hope this helps, if you have any more questions feel free to ask away, I'll try to answer :)
     
  3. lmbarns

    lmbarns

    Joined:
    Jul 14, 2011
    Posts:
    1,628
    Metaio has more features than vuforia, but costs a lot of money.

    Vuforia is very good.

    Not sure what you mean by colliding with the object...in vuforia, the trackable target actually does not move, in unity it's at 0,0,0 and the camera is what moves. Even if you pick it up, spin it around, etc it's always at 0,0,0.

    You can add colliders/triggers to objects and interact with them while they're being tracked.

    Metaio has SLAM tracking where you don't need any target, just uses environment, it's not that great though. Vuforia has a similar feature they've been working on but it's really bad last I checked.

    Both have user defined targets, where you can let the user take a picture of something with enough detail and use that image as the trackable target.

    Multiple targets can have objects that interact with each other when tracked.

    Be aware: any computer vision library is very heavy on mobile devices, you won't be able to use pro image effects, expensive shaders, etc or your frames will drop too low.

    You might be better off using the gps to track if someone's at the same position as a trigger.
     
  4. joeycampbell

    joeycampbell

    Joined:
    Sep 3, 2014
    Posts:
    5
    Thanks for the feedback...now I have even more questions....I know there are a lot of questions but even if you could give me a one liner for each it would be great.

    I've read about Project Tango - is there any due date for release ?
    Has there been any talk of a hook up between either Tango and Google Glass or Tango and Oculus ?

    Have either of you come across demos that are based in a large room/theatre/outdoor place with multiple interactive pieces running simultaneously ?

    Unity seems to be unique in so far that it has the option to sync up with vuforia - it doesn't seem to be an option with UDK/UE4....is Unity the main choice for AR & Interactivity or are some people working off other game engines also ?

    Do you know of any projects,research or games combining Unity, tracking data along with user data from a Microsoft Kinect?

    Imbarns - I presume you mean that when you move/rotate the tracking object that the virtual model moves/rotates also:
    "You can add colliders/triggers to objects and interact with them while they're being tracked."
    Is it possible that the tracking object can also act as a trigger (like an 'if statement') so that when the tracker is pressed or touched that it plays an event such as a piece of audio ?

    Is there any example of this online ?
    "Multiple targets can have objects that interact with each other when tracked."

    Thanks
    J
     
  5. lmbarns

    lmbarns

    Joined:
    Jul 14, 2011
    Posts:
    1,628
    We make oculus + kinect 2 stuff at work. I believe tango comes out spring of 2015.

    The oculus has a usb port where you can plug a usb device into, like a webcam...or probably a mobile device.

    Unity interfaces with so much stuff it's not even funny. Kinect 1 and 2, primesense sensors, omnity, etc. Omnity sell 3d projectors and have a plugin for unity similar to the oculus rift setup. http://www.elumenati.com/products/software/omnity/
    The also have an imax dome which is super awesome, looks like an igloo but it's inflatable.

    Vuforia gives sample projects for each of their tracking types (virtual buttons, image based, user defined, 3d cube, cylinder, etc) that you simply import into unity and open the scene.

    There's a user developed coordinate system for vuforia that lets you place targets around a room and drive a car to them, but it's really tough to setup/work with.

    Vuforia virtual buttons let you press a button on the tracked target to trigger stuff, or you can add colliders to the augmented models and touch on the screen to select each object or trigger something. Then if you have 2 targets, you can have a monster on target a shoot projectiles at target b.

    Yeah you can trigger audio and whatever else you want.

    These are some demos I made with vuforia:




     
  6. 3agle

    3agle

    Joined:
    Jul 9, 2012
    Posts:
    508
    I haven't experienced any personally, and we haven't done any large scale tests here, but there's nothing to say that any of the technologies mentioned wouldn't be able to do it.

    Related, the first few minutes of this video are interactive AR. Most likely using tech a bit more advanced than Vuforia though:

     
  7. joeycampbell

    joeycampbell

    Joined:
    Sep 3, 2014
    Posts:
    5
    Thanks for all the demos and advice.
    Not sure if either of you have seen this game but thought it looked great:
    http://julianoliver.com/output/tag/augmented-reality

    Imbarns my last questions!
    For the cube game with the dragons is your workflow using:
    Cinema 4d, vuforia and unity or is there extra software/plugins required ?
    For a game like that is there much coding involved within Unity or can it be done mainly with premade scripts ?
    Thanks
    J
     
    3agle likes this.
  8. lmbarns

    lmbarns

    Joined:
    Jul 14, 2011
    Posts:
    1,628
    Just Unity and vuforia...the "frame" is just some cube primitives combined in unity. https://developer.vuforia.com/resources/sample-apps/features The "Multitarget" example.

    In Unity I simply made a script to update a guitext with the rotation of the camera, then added some conditions for turning it beyond a threshold to trigger an event as a new side comes into view.

    Displaying stuff on targets doesn't require much coding. There's a function that fires an event as a target is tracked/lost, so you can show/hide stuff. I usually use it to start a coroutine that does an intro effect, then shows the main content, and when a target is lost another to clean up and reset sounds/particles/etc.