LogoLogo
  • Home
  • Projects
  • About
  • Contact

Flash, HTML5, Unity3D, && Augmented Reality

Devon O. · February 09, 2010 · Flash · 8 comments
9

Can’t decide which trendy tech bandwagon to hop onto? Try them all at once!

Okay – so I’d never recommend mixing all this crap together in a real world app, but it was fun just to give it a go and see what would happen. Thought maybe the internet would explode or something.

To see what I’m rambling about, check out the experiment here.

You’ll need this augmented reality marker (just ignore the “right hand”/”left hand” business). When prompted, allow webcam access in the Flash portion of the experiment (bottom left). Hold the marker upside right towards your camera (a green rectangle will appear around the embedded flash when the marker is detected) and spin it like a steering wheel to steer the car in the Unity3D portion of the experiment (top center). The harder you steer, the more purpley the background will appear (that’s the HTML5 canvas bit).

Here’s a little screenshot below for those not interested in being bothered by all the hassle…

tech mash screenshot

  Facebook   Pinterest   Twitter   Google+
augmented realityhtml5unity
  • Another Year, Another Look
    March 21, 2010 · 2 comments
    1829
    4
    Read more
  • Particle Editor for Starling Framework
    October 01, 2011 · 65 comments
    13853
    7
    Read more
  • Fred Never Had it so Fun – 1st Crack at Unity
    January 09, 2010 · 14 comments
    3205
    6
    Read more
8 Comments:
  1. 404?

    wee · February 09, 2010
  2. link fixed.. user error.. never could figure out this whole ‘internet’ thing…

    Devon O. · February 09, 2010
  3. I was curious, how you are communicating with Unity through Flash? I assume you’re using Flash (ExternalInterface) to call Javascript function(s) in your page. I looked over the page source quickly but didn’t find what I was looking for. Let me know how you pulled this off if you don’t mind. Good work.

    derek knox · February 09, 2010
  4. Hey Derek, in essence, the Flash file sends the rotation of the AR marker to a js function (using ExternalInterface). That function sets the color of the canvas background and also passes the rotation on to Unity which normalizes the value and uses it to steer the car rather than the normal horizontal input. One thing I found, if you remove the canvas background color change, the app actually runs quite smoothly. Meaning, using Flash and Unity for AR is actually a viable thing…

    Devon O. · February 09, 2010
  5. A little hard to steer, but it’s a fun experiment :)

    vamapaull · February 09, 2010
  6. can u share the code please

    Hellen · February 12, 2010
  7. Some time ago I’m trying to connect unity & flash through sockets, but fail.

    Reasons described here:
    http://answers.unity3d.com/questions/980/connect-flash-unity-through-an-socket-connection

    peko · February 15, 2010
  8. @Peko – I used a simple javascript connection rather than socket although the socket idea is an interesting concept. It’s a shame you couldn’t get it to work.

    @Hellen – the code is a bit of a mess – I just took an old AR project and and changed it around a bit adding and deleting so it’s very disorganized. If I get some time to clean it up, I’ll post it. The whole concept is quite simple though. Just take the z rotation of your AR marker (see how to get rotations in this old post: https://blog.onebyonedesign.com/?p=254) and pass it to a javascript function with ExternalInterface. Pass that value to the Unity object to steer the car (you can find plenty of Unity3d driving tutorials and, if you want, do a view source to see how the value is passed – it’s fairly easy).

    d.

    Devon O. · February 16, 2010

Leave a Comment! Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Devon O. Wolfgang

AIR | Unity3D | AR/VR

Unity Certified Developer

Technical Reviewer of “The Essential Guide to Flash CS4 AIR Development” and “Starling Game Development Essentials”

Reviewer of “The Starling Handbook”

Unity Engineer at Touch Press.

Categories
  • Actionscript (95)
  • AIR (16)
  • Flash (99)
  • Games (7)
  • Liberty (13)
  • Life (53)
  • Shaders (20)
  • Unity3D (21)
Recent Comments
  • MainDepth on Unity Ripple or Shock Wave Effect
  • Devon O. on Unity Ripple or Shock Wave Effect
  • Feral_Pug on Unity Ripple or Shock Wave Effect
  • bavvireal on Unity3D Endless Runner Part I – Curved Worlds
  • Danielius Vargonas on Custom Post Processing with the LWRP
Archives
  • December 2020 (1)
  • December 2019 (1)
  • September 2019 (1)
  • February 2019 (2)
  • December 2018 (1)
  • July 2018 (1)
  • June 2018 (1)
  • May 2018 (2)
  • January 2018 (1)
  • December 2017 (2)
  • October 2017 (1)
  • September 2017 (2)
  • January 2017 (1)
  • July 2016 (1)
  • December 2015 (2)
  • March 2015 (1)
  • September 2014 (1)
  • January 2014 (1)
  • August 2013 (1)
  • July 2013 (1)
  • May 2013 (1)
  • March 2013 (2)
  • December 2012 (1)
  • November 2012 (1)
  • September 2012 (3)
  • June 2012 (2)
  • May 2012 (1)
  • April 2012 (1)
  • December 2011 (2)
  • October 2011 (3)
  • September 2011 (1)
  • August 2011 (1)
  • July 2011 (1)
  • May 2011 (2)
  • April 2011 (2)
  • March 2011 (1)
  • February 2011 (1)
  • January 2011 (2)
  • December 2010 (3)
  • October 2010 (5)
  • September 2010 (1)
  • July 2010 (2)
  • May 2010 (5)
  • April 2010 (2)
  • March 2010 (7)
  • February 2010 (5)
  • January 2010 (5)
  • December 2009 (3)
  • November 2009 (1)
  • October 2009 (5)
  • September 2009 (5)
  • August 2009 (1)
  • July 2009 (1)
  • June 2009 (2)
  • May 2009 (6)
  • April 2009 (4)
  • March 2009 (2)
  • February 2009 (4)
  • January 2009 (1)
  • December 2008 (5)
  • November 2008 (2)
  • September 2008 (1)
  • August 2008 (6)
  • July 2008 (6)
  • June 2008 (9)
  • May 2008 (4)
  • April 2008 (3)
  • March 2008 (4)
  • February 2008 (9)
  • January 2008 (7)
  • December 2007 (6)
Copyright © 2021 Devon O. Wolfgang