ãUnityãmetaioã¨Unityã§ãã±ã¼ã·ã§ã³ãã¼ã¹ARã¢ããªã±ã¼ã·ã§ã³ãä½ã
Unityãç¨ããARã¢ããªã¯ä½åº¦ãVuforiaã§ä½ã£ã¦ããã®ã§ãã©ã¡ããã¨ããã¨Vuforiaã好ããªã®ã§ãããæ®å¿µãªããç¾ç¶ã®Vuforiaã§ã¯ãã±ã¼ã·ã§ã³ãã¼ã¹ã®ARã¢ããªãä½æåºæ¥ãªããããmetaioã¨ããARã©ã¤ãã©ãªã使ç¨ãã¦ãç°¡åãªãã±ã¼ã·ã§ã³ãã¼ã¹ARã¢ããªã±ã¼ã·ã§ã³ãä½æãã¦ã¿ããã¨æãã¾ãã
ã¡ãªã¿ã«ãå®æ©ãããã°ã¯Androidã®çä½ã§è¡ãã¾ãã
ç°å¢
Mac OSX Mavericks
Unity v5.0.1
metaio v6.0.2
Android v4.4.2
metaioSDKã®æºå
ã¾ãã¯metaioSDKã®å°å ¥ãè¡ãã¾ãã
ä¸è¨URLã«ã¢ã¯ã»ã¹ããå¿ è¦æ å ±ãå ¥åå¾Submitãæ¼ãã¨ãã¦ã³ãã¼ããã¼ã¸ã«ç§»åãã¾ãã
Macã¦ã¼ã¶ã¼ã®å ´åããã¦ã³ãã¼ãããdmgãã¡ã¤ã«ãéããã©ã¤ã»ã³ã¹ã«åæãã¾ãã
ãã®å¾åºç¾ããä¸è¨ã¦ã£ã³ãã¦ä¸ã®ãã©ã«ããèªåã®PCä¸ã®ã©ããã«ãã©ãã°ã¢ã³ãããããããã°OKã§ãã
Windowsã¦ã¼ã¶ã¼ã®å ´åãã¤ã³ã¹ãã¼ã©ã¼ã«å¾ã£ã¦ã¤ã³ã¹ãã¼ã«ãè¡ãã°ãã¹ã¿ã¼ãã¡ãã¥ã¼ã®ããã°ã©ã ãªã¹ãã«ç»é²ãããããã§ãã
Windowsã§ã®Unityã®å ´åãä¿®æ£ããªããã°ãªããªãç®æãä»ã«ããããããªã®ã§ã詳ããã¯ä¸è¨ãåç
§ãã¦ãã ããã
Setting up the Development Environment | metaio Developer Portal
ARã¢ããªã±ã¼ã·ã§ã³ä½æ
æ°è¦ããã¸ã§ã¯ãä½æ
ã¾ãã¯Unityãéãã ãFile -> New Projectã ã§é©å½ãªæ°è¦ããã¸ã§ã¯ããä½æãã¾ãã
metaioSDKã¤ã³ãã¼ã
次ã«ãAssets -> Import Package -> Custom Packageããã¯ãªãã¯ããå ã»ã©æºåããmetaioSDKãããmetaioSDK.unitypackageãé¸æãã¾ãï¼Macã®å ´å_Unityãã©ã«ãä¸ã«ããã¾ãï¼ã
ã¬ã¤ã¤ã¼ã®è¨å®
metaioãæ£å¸¸ã«åä½ãããããã«ã¯ãããã±ã¼ã¸ã®ã¤ã³ãã¼ãå¾ããã¤ãã®è¨å®ãå¿ è¦ã«ãªãã¾ãã
ã¾ãã¯ã¬ã¤ã¤ã¼ã®è¨å®ãè¡ãã¾ãã
Unityã®ã¨ãã£ã¿å³ä¸ã«ããLayersããEdit Layersãé¸æãã¾ãã
User Layerã®ç©ºãã¦ããä¸çªè¥ãLayerã«metaioLayerãæ°è¦ã§è¿½å ãã¾ãã
ç½²åã®ä½æã¨è¨å®
次ã«ã¢ããªã±ã¼ã·ã§ã³ã«ç½²åãè¨å®ãã¾ãã
Welcome to the metaio Developer Portal
æ°ããèªåã®ã¢ããªã±ã¼ã·ã§ã³ç¨ã®ç½²åãä½ãå¿
è¦ãããã®ã§ãä¸è¨Developerãµã¤ãã«ã¢ã¯ã»ã¹ãããã°ã¤ã³ãã¾ãã
ã¢ã«ã¦ã³ããã¾ã ãªãå ´åã¯ããµã¤ãå³ä¸ã®Sign upããæ°è¦ã¢ã«ã¦ã³ãä½æå¾ããã°ã¤ã³ãã¦ãã ããã
ãã°ã¤ã³å¾ãã¼ã¸ä¸é¨ã®ã¡ãã¥ã¼ããMy Appsã«ç§»åãã¾ãã
My Appsãã¼ã¸ä¸é¨ã®App registrationã§æ°è¦ã«ã¢ããªã±ã¼ã·ã§ã³ã®ç»é²ãè¡ãã¾ãã
App Nameã¨App Identifierã«é©å½ãªååãå
¥ããRegister your Appãæ¼ãæ°è¦ã«ç»é²ãã¾ãã
æ°ããã¢ããªã±ã¼ã·ã§ã³ã追å ããã¾ããã
ã¾ãã追å ãããã¢ããªã±ã¼ã·ã§ã³åãé¸æããã¨ã
ä¸è¨ç»åã®ããã«ç½²åãã¼ã¿ã表示ããã¾ãã
èªåã®ä½¿ç¨ããSDKã®ãã¼ã¸ã§ã³ã«å¯¾å¿ããSignatureã®å¤ãã³ãã¼ãã¦ããã¾ãã
Unityã¨ãã£ã¿ã«æ»ããããã©ã«ãã§è¨ç½®ããã¦ããMain Cameraãåé¤ãã¾ãã
ãã®å¾ããã¸ã§ã¯ããã¥ã¼ãããAssets -> metaio -> Prefabsãå
ã«ããmetaioSDKãHierarchyãã¥ã¼ã«ãã©ãã°ã¢ã³ããããããã¾ãã
Hierarchyãã¥ã¼ã®metaioSDKãé¸æããInspectorãã¥ã¼å SDK Signatureã®æ¬ã«å ã»ã©ã³ãã¼ããå¤ããã¼ã¹ããã¾ãã
ããã§ç½²åã®è¨å®ã¯å®äºã§ãã
ãã©ããã³ã°è¨å®
ã¾ãå ç¨ã®ç½²åè¨å®ã¨åæ§ã«ãHierarchyãã¥ã¼ã®metaioSDKãé¸æããTracking configurationã®ãããããã¦ã³ã¡ãã¥ã¼ããGPSãé¸æãã¾ãã
ãã©ãã«ã¼è¨ç½®
ãAssets -> metaio -> PrefabsãããmetaioTrackerãHierarchyãã¥ã¼ã«ãã©ãã°ã¢ã³ãããããããmetaioSDKã®åè¦ç´ ã«ãã¾ãã
ã¾ããHierarchyãã¥ã¼ã®metaioTrackerãé¸æãã¦Inspectorãã¥ã¼ã表示ããGeo Locationã®å¤ã®è¨å®ã¨ãTransform cameraã®ãã§ãã¯ããªãããã³Enable LLA Limitsã®ãã§ãã¯ããªã³ã«ãã¾ãã
metaio社ããã¥ã³ãã³ã«ããã¨ãããã¨ã§ãGeo Locationã®å¤ã¯ãã¥ã³ãã³ã®åº§æ¨ã«ãã¦ã¿ã¾ããã
ãã®Geo Locationã®å¤ãªã®ã§ãããããããX, Yã¨ããå¤æ°åãã¤ãããã¦ãããããX=çµåº¦ã§Y=緯度ã ã¨åæã«åéããã¦ãã¾ãããæ£ããã¯ãXY=緯度çµåº¦ã§åé¡ãªãããã§ããæ°ä»ãã試è¡ãã¦ãããããæ£ããä½ç½®ã§è¡¨ç¤ºãã¦ãããªãã¦ç¦ãã¾ããã
3Dã¢ãã«è¨ç½®
æå¾ã«ã3Dã¢ãã«ãmetaioTrackerã®åè¦ç´ ã¨ãã¦è¨å®ããã°å®äºã§ãã
ã¢ãã«ã¯ä½ã§ãæ§ããªãã®ã§ãããããããæã«ã¯å®çªã¨ãããã¨ã§unity-chanã«ãç»å ´é¡ãã¾ãããé¢åãªæ¹ã¯CubeãSphereçã§å
¨ãåé¡ããã¾ããã
ä¸è¨ããããã¤ãéãUnity-chanå
¬å¼ããã¢ãã«ãå«ã.unitypackageããã¦ã³ãã¼ããã¾ãã
è¦ç´åæå¾ã3Dã¢ãã«ãã¼ã¿ããã¦ã³ãã¼ãã
ãAssets -> Import Package -> Custom Packageããããå ã»ã©å ¥æããunity-chanã®ããã±ã¼ã¸ãã¤ã³ãã¼ããã¾ãã
ã¨ããããã¢ãã«ã ã使ç¨ã§ããã°è¯ãã®ã§ãä»ã®ãã§ãã¯ã¯æ¶ãã¦ã¤ã³ãã¼ãï¼Voiceãã¡ã¤ã«ã¨ãå¤ããã¦å®¹é大ããâ¦â¦ï¼ã
ã¤ã³ãã¼ãå¾ãUnityChan -> Models -> unitychanããHierarchyãã¥ã¼ã«ãã©ãã°ã¢ã³ãããããããmetaioTrackerã®åè¦ç´ ã«ãã¾ãã
ã¾ããæããã§ãããããã©ã«ãã®ãµã¤ãºã§ã¯å°ãããã¦ã¢ãã«ãè¦ããªãã®ã§ãunitychanã®ScaleãXYZãããã100ã«è¨å®ãã¾ãã
ãã«ãï¼ ãã㦠ã©ã³ï¼
ããã¾ã§æ¥ãããã¨ã¯å®è¡ããã®ã¿ã§ãã
ã¾ãç¾å¨ã®ã·ã¼ã³ãé©å½ãªååã§ä¿åãã¾ãã
次ã«ãFile -> Build Settingsããé¸æããAdd Currentã§ä¿åããã·ã¼ã³ã追å ãã¾ãã
ã¾ããPlatformã¯Androidãé¸æãã¾ãï¼Unityã§ã®Androidã®ãã«ãã«é¢ãã¦ã¯é©å®æ¤ç´¢ãã¦ãã ããï¼ã
ãã®å¾Build And Runãé¸æãã¾ãã
Buildãå®äºã次第ãå®æ©ã®Androidã§ã¢ããªã®å®è¡ãéå§ããã¾ãã
èµ·åå¾ãå®æ©ãæã«ãã¥ã³ãã³ã®æ¹åãåãã¦ã¿ãã¨â¦â¦
ç¡äºunity-chanã表示ããã¾ããï¼
ç·æ¬
ãã±ã¼ã·ã§ã³ãã¼ã¹ã®ARã¯é£ããå°è±¡ããã£ãã®ã§ãããmetaioãªãã¨ã¦ãç°¡åã«å®è£ ãããã¨ãåºæ¥ã¾ããã Vuforiaã¨åãããiOSãAndroidããã¦Unityã¨ãã£ãå種ãã©ãããã©ã¼ã ããµãã¼ãããã¦ããç¹ãé åçãã¨æãã¾ãã
å±å ã®éããå ´æã§ããã°ã精度ãããã¾ã§æªããªãããã§ãã®ã§ãè²ã ã¨éãã§ã¿ãã¨æ¥½ããããããã¾ããã