16
Creating Novel Augmented Reality Applications for Android 1 PAUG www.diotasoft.com [email protected] Sebastian Knödel sekond [email protected] Ludovic Perrier ludovic_perrier [email protected] Yohan Hadjedi nah0y

Paug paris 2011

  • Upload
    sekond0

  • View
    2.532

  • Download
    6

Embed Size (px)

Citation preview

Page 1: Paug paris 2011

Creating Novel Augmented Reality Applications for Android

1 PAUG

www.diotasoft.com

[email protected]

Sebastian Knödel

sekond

[email protected]

Ludovic Perrier

ludovic_perrier

[email protected]

Yohan Hadjedi

nah0y

Page 2: Paug paris 2011

Content

Brief History of Mobile AR

Mobile AR SDKs & APIs

Qualcomm AR SDK (QCAR)

QCAR & Unity3D

Mobile AR Games

Future of mobile AR

2 PAUG

Page 3: Paug paris 2011

Brief History of Mobile AR

Sensor based tracking

GPS position Compass orientation

Courtesy Wikitude Wikitude

3 PAUG

2009

Vision based tracking

Courtesy TU Graz

ARToolkitPlus NyARToolkit Special Marker 1999 2007 2009

Page 4: Paug paris 2011

Brief History of Mobile AR

Vision based tracking

Natural Features Diotasoft - Werber

Qualcomm AR

Courtesy Qualcomm

Metaio/Juneio Courtesy Metaio

4 PAUG

2010

Page 5: Paug paris 2011

Mobile AR SDKs & APIs

Proprietary Public

5 PAUG

Page 6: Paug paris 2011

Qualcomm AR SDK (QCAR)

•  Library for mobile AR development

•  Android only

•  Supported devices Qualcomm CPU (Nexus One/S, HTC Desire)

•  SDK with Eclipse integration

Different target types

6 PAUG

Page 7: Paug paris 2011

Mobile application

Target Resources

QCAR library

Workflow QCAR

Target Images (jpg/png)

QDevNet

Target Management Application

Target.dat Config.xml

App Logic & Rendering Engine

Target Position

7 PAUG

Page 8: Paug paris 2011

QCAR API

Android

Camera

Tracker

Rendering

Virtual Button

Multi Image Target

Image Target Marker Developer Application

8 PAUG

Page 9: Paug paris 2011

Developing with QCAR Java

mRenderer = new myRenderer();mGlView.setRenderer(mRenderer);

myRenderer implements GLSurfaceView.Renderer{ void onDrawFrame(GL10 gl){

}}

Initialize SDK

myNativeRenderFrame();

C/CPP

Load Tracker

Update Camera

Pose

Update GL Rendering

Close SDK

9 PAUG

myApp extends Activity{

void onCreate(){

}

void onPause(){

}

void onDestroy(){

}};

Initialize_App();Initialize_QCAR();

mLoadTrackerTask = new LoadTrackerTask();

QCAR.onPause();

QCAR.deinit();

myNativeRenderFrame(JNIEnv *, jobject){

glClear(…);

// Render video background: QCAR::Renderer::getInstance().begin();

for(i … state.getNumActiveTrackables()) {

QCAR::Trackable* trackable = state.getActiveTrackable(i);

modelViewMatrix = convertPose2GLMatrix(trackable->getPose());

glMatrixMode(GL_MODELVIEW); glLoadMatrixf(modelViewMatrix.data); … … Add Your OpenGLES 1.1/2.0 Render Code Here …}

// finish GL Rendering QCAR::Renderer::getInstance().end();

}

Page 10: Paug paris 2011

QCAR and Unity3D

10 PAUG

Page 11: Paug paris 2011

QCAR and Unity3D

11 PAUG

Workflow

•  Create Target QDevNet •  Add target resources to project

•  Add ARCamera Prefab •  Add myTarget Prefab •  Add 3D objects, physics, shaders, Game Logic, etc. •  Deploy on Android device

Page 12: Paug paris 2011

Soundplugin for Unity3D

PAUG 12

AndroidSoundPlugin.CS (C#) public class AndroidSoundPoolPlugin : MonoBehaviour {

[DllImport("javabridge")] private static extern int playSound(int index, float volume, int repeat, float pitch); [DllImport("javabridge")] private static extern void stopSound(int currentStream);};

NativeJavaBridge.CPP (JNI) jint JNI_OnLoad(JavaVM* vm, void* reserved) {

jclass cls_Activity = jni_env->FindClass("com/unity3d/player/UnityPlayer"); jclass cls_JavaClass = jni_env->FindClass("com/diotasoft/pluginunity/JavaClass"); activitySoundPlay = jni_env->GetMethodID(cls_JavaClass, "ActivitySoundPlay", "(IFFIF)I"); …}

int playSound(int index, float volume, int repeat, float pitch) { jint currentStream = (jint)jni_env->CallObjectMethod(JavaClass, activitySoundPlay, index, volume, repeat, pitch); …}

JavaClass.java SoundManager.java

public static void initSounds(Context theContext) { … mAudioManager = (AudioManager) mContext.getSystemService (Context.AUDIO_SERVICE); }

public class JavaClass{private Activity mActivity;

public JavaClass(Activity currentActivity) { mActivity = currentActivity; SoundManager.initSounds(mActivity);}

public int ActivitySoundPlay(int id, float volume) { return SoundManager.playSound(id, volume,…);}

SDK

NDK

Unity

Page 13: Paug paris 2011

ARLabyrinth The Circus

Diotasoft Games

13 PAUG

Page 14: Paug paris 2011

Conclusions

14 PAUG

QCAR Android SDK/NDK

•  Open system (hands on)

•  Existant code integration

•  Features you implement

•  Developer community

QCAR Unity

•  Closed system

•  Fast content creation

•  Plugins & profiling

•  Rich feature sets provided

Page 15: Paug paris 2011

Future is Markerless

PAUG 15

Page 16: Paug paris 2011

Merci beaucoup

16 PAUG