<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Akira Game</title>
    <description>The latest articles on DEV Community by Akira Game (@takeda1411123).</description>
    <link>https://dev.to/takeda1411123</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1404958%2F95e18fed-5d70-448b-b67a-337393ed0b0b.png</url>
      <title>DEV Community: Akira Game</title>
      <link>https://dev.to/takeda1411123</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/takeda1411123"/>
    <language>en</language>
    <item>
      <title>Local LLM Memo</title>
      <dc:creator>Akira Game</dc:creator>
      <pubDate>Fri, 14 Feb 2025 20:02:09 +0000</pubDate>
      <link>https://dev.to/takeda1411123/local-llm-memo-2k98</link>
      <guid>https://dev.to/takeda1411123/local-llm-memo-2k98</guid>
      <description>&lt;p&gt;Table of contents&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tool&lt;/li&gt;
&lt;li&gt;How to run LLM localy&lt;/li&gt;
&lt;li&gt;How to use LLM for personal research agent&lt;/li&gt;
&lt;li&gt;Create API Server&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Tool
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Ollama
&lt;/h2&gt;

&lt;p&gt;It can run with large language models (LLMs). &lt;br&gt;
Although each models has different interface, it has unified interface to use lcoal LLM, so you can run LLMs easily. &lt;/p&gt;

&lt;h2&gt;
  
  
  LangChain
&lt;/h2&gt;

&lt;p&gt;LangChain is a composable framework to build with LLMs.&lt;br&gt;
&lt;a href="https://www.langchain.com/" rel="noopener noreferrer"&gt;Langchain&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  LangGraph
&lt;/h2&gt;

&lt;p&gt;LangGraph is the orchestration framework for controllable agentic workflows.&lt;br&gt;
It defines state and create complex workflow. &lt;/p&gt;

&lt;h2&gt;
  
  
  Duckdockgo-search
&lt;/h2&gt;

&lt;p&gt;This is a search engine that protects user privacy. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://duckduckgo.com/" rel="noopener noreferrer"&gt;DuckdockGo&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  How to run LLM locally
&lt;/h1&gt;

&lt;p&gt;I used Ollama to run LLMs locally.&lt;/p&gt;

&lt;h2&gt;
  
  
  Download Ollama
&lt;/h2&gt;

&lt;p&gt;Download Ollama from the official website. &lt;br&gt;
&lt;a href="https://ollama.com/" rel="noopener noreferrer"&gt;Ollama&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;

&lt;p&gt;Install Ollama following the installer. &lt;/p&gt;

&lt;h2&gt;
  
  
  Download LLM
&lt;/h2&gt;

&lt;p&gt;Download the LLM you want to download. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;ollama pull &amp;lt;model_name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Run LLM
&lt;/h2&gt;

&lt;p&gt;Run the LLM&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ollama run &amp;lt;model_name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  How to use LLM for personal research agent
&lt;/h1&gt;

&lt;p&gt;I referred the below technical article. &lt;br&gt;
&lt;a href="https://medium.com/@sahin.samia/how-to-build-a-interactive-personal-ai-research-agent-with-llama-3-2-b2a390eed63e" rel="noopener noreferrer"&gt;How to build a Interactive Personal AI Research Agent with Llama 3.2 : A Step-by-Step Guide using LangChain and Ollama&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Create API Server
&lt;/h1&gt;

&lt;p&gt;I built API server using render and Flask. &lt;/p&gt;

</description>
      <category>llm</category>
      <category>ai</category>
      <category>programming</category>
      <category>data</category>
    </item>
    <item>
      <title>AR Game Dev 1 / 10( Contents )</title>
      <dc:creator>Akira Game</dc:creator>
      <pubDate>Thu, 26 Sep 2024 13:04:47 +0000</pubDate>
      <link>https://dev.to/takeda1411123/ar-game-dev-1-10-contents--38dg</link>
      <guid>https://dev.to/takeda1411123/ar-game-dev-1-10-contents--38dg</guid>
      <description>&lt;p&gt;Table of contents&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Background&lt;/li&gt;
&lt;li&gt;What I want to develop&lt;/li&gt;
&lt;li&gt;Architecture&lt;/li&gt;
&lt;li&gt;Next Step&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Background
&lt;/h1&gt;

&lt;p&gt;I am a postgraduate student at Kingston University in the UK. I am studying games, AR, VR and AI. I have researched AR development through the previous posts. Based on that, I have been implementing an AR game. In the upcoming posts, I will introduce the process of AR game development in them. &lt;/p&gt;

&lt;p&gt;If you are interested in any posts, I would appreciate your reactions. &lt;br&gt;
If there are any companies involved in game or AR development, please feel free to get in touch. &lt;/p&gt;

&lt;h1&gt;
  
  
  What I want to develop
&lt;/h1&gt;

&lt;p&gt;In these days, AR is used in many different fields. It is not only in the entertainment industry, but also various industries such as education and tourism. The AR game I have been implementing is primarily designed for use in the tourism industry. By making effort of AR, the game offers a more immersive experience compared to traditional games. Additionally, it enables users to have experience that would be physically challenging, by using digital objects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Objective
&lt;/h2&gt;

&lt;p&gt;The objective of the game is to enable players to learn about Kingston University while enjoying to play through an AR.&lt;/p&gt;

&lt;p&gt;This game will be available exclusively at Kingston University.&lt;/p&gt;

&lt;h2&gt;
  
  
  Story
&lt;/h2&gt;

&lt;p&gt;The story of the game sets users as a new student arriving at Kingston University for the first time. When they arrive, they discover a book. In this book, it is written that there are seven mysteries hidden at Kingston University. If someone solve them, he/she will get a treasure. Additionally, when the user touched the book, they get a mysterious power. ( It is inspired by Death Note... ) &lt;/p&gt;

&lt;h2&gt;
  
  
  Game Flow
&lt;/h2&gt;

&lt;p&gt;Below is the flow of the game.&lt;br&gt;
It has three main phases, which consist of the 2D section for game progression, the map scene, and the AR scene.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpedk9901gnh5r9f933yy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpedk9901gnh5r9f933yy.png" alt="Image description" width="800" height="186"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Game Progression
&lt;/h3&gt;

&lt;p&gt;The game progression will be based on a 2D character. &lt;/p&gt;

&lt;h3&gt;
  
  
  Map Scene
&lt;/h3&gt;

&lt;p&gt;As I mentioned early, this app is available at Kingston University and requires that users are guided to specific locations. To achieve this, I have created a map scene using the Google Maps API. Like Pokemon Go, the character's movements depend on the user's location. I used the following book as a reference. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://amzn.asia/d/jctLB7T" rel="noopener noreferrer"&gt;https://amzn.asia/d/jctLB7T&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft5avdw8iztt4oknu1bso.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft5avdw8iztt4oknu1bso.png" alt="Image description" width="676" height="1386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  AR Scene
&lt;/h3&gt;

&lt;p&gt;As the game progresses, there is an AR scene for each mystery. They are from simple puzzles to mini-games. Users can collect and use items during AR scene. These items will help users to progress the game.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftx9hiizqy7z01zfgl3ua.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftx9hiizqy7z01zfgl3ua.png" alt="Image description" width="800" height="1749"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By solving all the mysteries, players will get the final treasure. &lt;br&gt;
The details of each mystery and the scenes will be shown in the upcoming posts.&lt;/p&gt;

&lt;h1&gt;
  
  
  Architecture
&lt;/h1&gt;

&lt;p&gt;This image shows the general architecture of this game. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnia31ufvqghtejia1bmm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnia31ufvqghtejia1bmm.png" alt="Image description" width="800" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All process run in Unity. In terms of AR, AR Foundation is used. Also, various APIs like Google Static API are called in Unity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Map Scene
&lt;/h2&gt;

&lt;p&gt;In this scene, the user's consent to data acquisition is assumed. Based on the user location data, the Google Static API is used to display a map of the user's surroundings.&lt;/p&gt;

&lt;h2&gt;
  
  
  AR Scene
&lt;/h2&gt;

&lt;p&gt;AR objects are displayed by using AR Foundation. &lt;/p&gt;

&lt;h3&gt;
  
  
  No require location
&lt;/h3&gt;

&lt;p&gt;If location data is not required to solve the mystery, only AR Foundation is sufficient for implementation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Require location
&lt;/h3&gt;

&lt;p&gt;Since this game aims to create an AR experience within the campus, location data is necessary. Therefore, AR objects are placed at specific locations using the Geospatial API. Additionally, to improve user experience, the Streetscape Geometry API is utilised by using of surrounding's buildings and terrain.&lt;/p&gt;

&lt;h1&gt;
  
  
  Next Step
&lt;/h1&gt;

&lt;p&gt;In this post, I introduced simply the game content and the architecture. In next post, I will show the 2D section for game progression.&lt;/p&gt;

</description>
      <category>unity3d</category>
      <category>gamedev</category>
      <category>design</category>
      <category>csharp</category>
    </item>
    <item>
      <title>AR Game ~ Geospatial Creator ~</title>
      <dc:creator>Akira Game</dc:creator>
      <pubDate>Thu, 25 Jul 2024 09:52:47 +0000</pubDate>
      <link>https://dev.to/takeda1411123/ar-game-geospatial-creator--k4m</link>
      <guid>https://dev.to/takeda1411123/ar-game-geospatial-creator--k4m</guid>
      <description>&lt;p&gt;Table of contents&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Background&lt;/li&gt;
&lt;li&gt;What is Geospatial Creator&lt;/li&gt;
&lt;li&gt;How to use Geospatial Creator&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Background
&lt;/h1&gt;

&lt;p&gt;I am develop AR Game with Unity, AR foundation and so on. To learn AR development, I am researching about AR and the software related it. This blog shows the research and the process of developing AR game. If you have a question, I am happy to answer it.&lt;/p&gt;

&lt;p&gt;When you are implementing AR Game, you need to go out to verify AR scene because you need to check whether AR contents are placed nicely in person, which can lead to wasting a lot time. To avoid the task, you can use Geospatial creator. It helps you place anchors without code in Unity. This post will show what is Geospatial Creator and how to use it. &lt;/p&gt;

&lt;h1&gt;
  
  
  What is Geospatial Creator
&lt;/h1&gt;

&lt;p&gt;Before this was available, it had been necessary to go to the actual location to check if the AR content was displayed. A lot of programming was also required, which made the implementation time-consuming. However,by using it, you can visualize, build, and launch 3D digital content in real world location through Photorealistic 3D Tiles. &lt;/p&gt;

&lt;h1&gt;
  
  
  How to use Geospatial Creator in Unity
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://developers.google.com/ar/geospatialcreator/unity/quickstart" rel="noopener noreferrer"&gt;Reference&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  API Authorization
&lt;/h2&gt;

&lt;p&gt;You need to enable these below API in Google Cloud Platform.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Google Map Tiles API&lt;/li&gt;
&lt;li&gt;ARCore Geospatial API&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Configure in Unity
&lt;/h2&gt;

&lt;p&gt;You mush enable ARCore and ARKit in your Unity project. &lt;/p&gt;

&lt;p&gt;Edit &amp;gt; Project Settings &amp;gt; XR Plug-in Management&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv2qttcn3hctdjucfqs88.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv2qttcn3hctdjucfqs88.png" alt="Image description" width="800" height="564"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7eek8kvc887bpolot39r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7eek8kvc887bpolot39r.png" alt="Image description" width="800" height="564"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add Cesium
&lt;/h2&gt;

&lt;p&gt;The Geospatial Creator uses a third party Unity package called Cesium to render Google Map Tiles in the Unity Editor's Scene window. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You need to download it from the below link. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://github.com/CesiumGS/cesium-unity/releases/" rel="noopener noreferrer"&gt;Releases&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl0cxdtbpvo48ijyoymoe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl0cxdtbpvo48ijyoymoe.png" alt="Image description" width="800" height="202"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the downloaded package in Unity&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Enable Geospatial Creator
&lt;/h2&gt;

&lt;p&gt;You need to set up API key and enable Geospatial Creator.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn9833ks3orkiqlpa0066.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn9833ks3orkiqlpa0066.png" alt="Image description" width="800" height="565"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add a Geospatial Creator Origin with Map Tiles
&lt;/h2&gt;

&lt;p&gt;Add a Geospatial Creator Origin component with Map Tiles in your project.&lt;/p&gt;

&lt;p&gt;You need to set API key too. Also, you can put the position's latitude, longitude, and altitude where you want to create.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftwzovvr7ye4bzs1i517y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftwzovvr7ye4bzs1i517y.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add and place a Geospatial Creator Anchor
&lt;/h2&gt;

&lt;p&gt;Add a Geospatial Creator Anchor component in your project.&lt;/p&gt;

&lt;p&gt;You can place any objects in your porject.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzgj6fk04y5u2vga2tw4e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzgj6fk04y5u2vga2tw4e.png" alt="Image description" width="800" height="757"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>unity3d</category>
      <category>gamedev</category>
      <category>csharp</category>
    </item>
    <item>
      <title>AR Game ~ Geospatial API Sample ~</title>
      <dc:creator>Akira Game</dc:creator>
      <pubDate>Wed, 24 Jul 2024 20:59:14 +0000</pubDate>
      <link>https://dev.to/takeda1411123/ar-game-geospatial-api-sample--2l8g</link>
      <guid>https://dev.to/takeda1411123/ar-game-geospatial-api-sample--2l8g</guid>
      <description>&lt;p&gt;Table of contents&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Background&lt;/li&gt;
&lt;li&gt;Sample&lt;/li&gt;
&lt;li&gt;Code&lt;/li&gt;
&lt;li&gt;Unity&lt;/li&gt;
&lt;li&gt;Next Step&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Background
&lt;/h1&gt;

&lt;p&gt;I am develop AR Game with Unity, AR foundation and so on. To learn AR development, I am researching about AR and the software related it. This blog shows the research and the process of developing AR game. If you have a question, I am happy to answer it.&lt;/p&gt;

&lt;p&gt;I researched Geospatial API before. This post will show the sample of the game with geospatial API. Therefore, it will be my note. If you use it, please do not miss it. &lt;/p&gt;

&lt;h1&gt;
  
  
  Sample
&lt;/h1&gt;

&lt;p&gt;If you use ARCore Extensions, you can import &lt;strong&gt;Geospatial Sample&lt;/strong&gt; and try it easily. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1xdfyfzbrdvtmbxbybeg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1xdfyfzbrdvtmbxbybeg.png" alt="Image description" width="800" height="493"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In sample scene, you can test Geospatial API and put AR object anywhere unless localising area. &lt;/p&gt;

&lt;h1&gt;
  
  
  UI
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Origin
&lt;/h2&gt;

&lt;p&gt;This is basement of AR content and user viewpoint (camera). It used to be called AR Session origin.&lt;/p&gt;

&lt;p&gt;In real world, it can adjust the scale of virtual objects. Also, according user movement, it can update the position and rotation of AR objects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Session
&lt;/h2&gt;

&lt;p&gt;This object is used to manage the whole lifecycle of AR experience and setting. &lt;/p&gt;

&lt;p&gt;It can start, pose, and restart AR experience. &lt;/p&gt;

&lt;h2&gt;
  
  
  ARCore Extensions
&lt;/h2&gt;

&lt;p&gt;This is the package that merge AR Foundation and Google ARCore extension. By using it, you can use the specific AR Core functions.&lt;/p&gt;

&lt;p&gt;For example, it offer the AR experience based on GPS location. By using it, you can put virtual objects on the specific location. &lt;/p&gt;

&lt;h2&gt;
  
  
  UI Information panel
&lt;/h2&gt;

&lt;p&gt;It shows the information like Latitude and Longitude at runtime.&lt;/p&gt;

&lt;h2&gt;
  
  
  Debug Text
&lt;/h2&gt;

&lt;p&gt;It shows the information from API for debug.&lt;/p&gt;

&lt;h2&gt;
  
  
  Privacy Prompt
&lt;/h2&gt;

&lt;p&gt;This is the prompt to get the user agreement.&lt;/p&gt;

&lt;h1&gt;
  
  
  Code
&lt;/h1&gt;

&lt;p&gt;In sample scene, there is Geospatial controller, which manage the API and UI. I believe it is basement, therefore if you understand it, you can use it for your own game. &lt;/p&gt;

&lt;h2&gt;
  
  
  Awake
&lt;/h2&gt;

&lt;p&gt;In Awake function, this app lock the user screen to portrait.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;Screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;autorotateToLandscapeLeft&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;Screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;autorotateToLandscapeRight&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;Screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;autorotateToPortraitUpsideDown&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;Screen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orientation&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ScreenOrientation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Portrait&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  OnEnable
&lt;/h2&gt;

&lt;p&gt;This function starts location service like below code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;_startLocationService&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;StartLocationService&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nf"&gt;StartCoroutine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_startLocationService&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Location Service
&lt;/h3&gt;

&lt;p&gt;When it starts, you can get user location.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;Input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Start&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;LocationServiceStatus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Initializing&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;_waitingForLocationService&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;LocationServiceStatus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Running&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;Debug&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;LogWarning&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"Location service ended with &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;Input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt; status."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;Input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Stop&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Start
&lt;/h2&gt;

&lt;p&gt;When the app starts, the start screen will be displayed. Then when you click the start button, the location service starts. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F182f742yqauvkr6y3q7w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F182f742yqauvkr6y3q7w.png" alt="Image description" width="800" height="616"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this code, when clicked, what user confirmed a privacy prompt will be saved while proceed next screen.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;OnGetStartedClicked&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;PlayerPrefs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SetInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_hasDisplayedPrivacyPromptKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;PlayerPrefs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Save&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nf"&gt;SwitchToARView&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Additionally, it will change UI status.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;_isReturning&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;_enablingGeospatial&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;InfoPanel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SetActive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;GeometryToggle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gameObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SetActive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;AnchorSettingButton&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gameObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SetActive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;AnchorSettingPanel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gameObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SetActive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;GeospatialAnchorToggle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gameObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SetActive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;TerrainAnchorToggle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gameObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SetActive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;RooftopAnchorToggle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gameObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SetActive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;ClearAllButton&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gameObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SetActive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;DebugText&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gameObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SetActive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Debug&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isDebugBuild&lt;/span&gt; &lt;span class="p"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;EarthManager&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, it will switch from the privacy prompt screen to AR view screen.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="nf"&gt;SwitchToARView&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PlayerPrefs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;HasKey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_hasDisplayedPrivacyPromptKey&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Update
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Update debug text
&lt;/h3&gt;

&lt;p&gt;update debug text&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="s"&gt;$"IsReturning: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;_isReturning&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;\n"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
&lt;span class="s"&gt;$"IsLocalizing: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;_isLocalizing&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;\n"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
&lt;span class="s"&gt;$"SessionState: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;ARSession&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;\n"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
&lt;span class="s"&gt;$"LocationServiceStatus: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;Input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;\n"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
&lt;span class="s"&gt;$"FeatureSupported: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;supported&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;\n"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
&lt;span class="s"&gt;$"EarthState: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;EarthManager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EarthState&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;\n"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
&lt;span class="s"&gt;$"EarthTrackingState: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;EarthManager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EarthTrackingState&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;\n"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
&lt;span class="s"&gt;$"  LAT/LNG: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;pose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Latitude&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;F6&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;, &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;pose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Longitude&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;F6&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;\n"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
&lt;span class="s"&gt;$"  HorizontalAcc: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;pose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HorizontalAccuracy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;F6&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;\n"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
&lt;span class="s"&gt;$"  ALT: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;pose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Altitude&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;F2&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;\n"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
&lt;span class="s"&gt;$"  VerticalAcc: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;pose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;VerticalAccuracy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;F2&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;\n"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
&lt;span class="s"&gt;$". EunRotation: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;pose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EunRotation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;F2&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;\n"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
&lt;span class="s"&gt;$"  OrientationYawAcc: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;pose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;OrientationYawAccuracy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;F2&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Check application status
&lt;/h3&gt;

&lt;p&gt;If user leave the app, the app ends.&lt;/p&gt;

&lt;p&gt;Example (When user click escape button, the app ends)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetKeyUp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;KeyCode&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Escape&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;Application&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Quit&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Check localizing status
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Check the AR session state&lt;/li&gt;
&lt;li&gt;Check earth tracking state&lt;/li&gt;
&lt;li&gt;Check earth pose
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;isSessionReady&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ARSession&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;ARSessionState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SessionTracking&lt;/span&gt; &lt;span class="p"&gt;&amp;amp;&amp;amp;&lt;/span&gt;
            &lt;span class="n"&gt;Input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;LocationServiceStatus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Running&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;earthTrackingState&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;EarthManager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EarthTrackingState&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;pose&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;earthTrackingState&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;TrackingState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tracking&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt;
            &lt;span class="n"&gt;EarthManager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CameraGeospatialPose&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;GeospatialPose&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the localizing is lost, error message will be displayed.&lt;br&gt;
While if the localizing success, all anchor will be displayed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;go&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;_anchorObjects&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;go&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SetActive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Anchor Type
&lt;/h2&gt;

&lt;p&gt;To place 3D contents in the real world, the API use &lt;strong&gt;Anchor&lt;/strong&gt;, which eusure these contents appear to stay at the same position and orientation in space. it helps to maintain the illusion of virtual objects placed in the real world. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://developers.google.com/ar/develop/anchors" rel="noopener noreferrer"&gt;Working with Anchors&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are three types of Geospatial anchors, which can handle altitude differently. &lt;/p&gt;

&lt;h3&gt;
  
  
  WGS84 anchors
&lt;/h3&gt;

&lt;p&gt;This type can place 3D contents at any latitude, longitude, and altitude.&lt;/p&gt;

&lt;h3&gt;
  
  
  Terrain anchors
&lt;/h3&gt;

&lt;p&gt;This type can place 3D contents using only latitude and longitude with a height relative to the terrain at that position. The altitude is determined relative to the ground or floor by using VPS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rooftop anchors
&lt;/h3&gt;

&lt;p&gt;This type can place content using only latitude and longitude with a height relative to a building's rooftop at that position. The altitude is determined relative to the top of a building by using Streetscape Geometry.&lt;/p&gt;

&lt;h2&gt;
  
  
  Streetscape Geometry
&lt;/h2&gt;

&lt;p&gt;This function can provide the geometry of terrain , buildings, or other structures in a scene. The geometry can be used for occlusion, rendering, or placing AR content. &lt;/p&gt;

</description>
      <category>unity3d</category>
      <category>programming</category>
      <category>godotengine</category>
    </item>
    <item>
      <title>AR Game ~ ChatGPT API ~</title>
      <dc:creator>Akira Game</dc:creator>
      <pubDate>Tue, 11 Jun 2024 20:15:02 +0000</pubDate>
      <link>https://dev.to/takeda1411123/ar-game-chatgpt-api--1gpg</link>
      <guid>https://dev.to/takeda1411123/ar-game-chatgpt-api--1gpg</guid>
      <description>&lt;p&gt;Table of contents&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Background&lt;/li&gt;
&lt;li&gt;What is ChatGPT API&lt;/li&gt;
&lt;li&gt;Implementation of ChatGPT API&lt;/li&gt;
&lt;li&gt;Execution of ChatGPT API&lt;/li&gt;
&lt;li&gt;Next Step&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Background
&lt;/h1&gt;

&lt;p&gt;I will develop AR Game with Unity, AR foundation and so on. To learn AR development, I am researching about AR and the software related it. This blog shows the research and the process of developing AR game. If you have a question, I am happy to answer it.&lt;/p&gt;

&lt;p&gt;In my AR game, Chat GPT will be used to create automatically character dialog. Therefore, this post  will show how to implement ChatGPT API on Unity. &lt;/p&gt;

&lt;h1&gt;
  
  
  What is ChatGPT API
&lt;/h1&gt;

&lt;p&gt;These days, everyone probably knows ChatGPT. Chat GPT API is a feature that allows you to use ChatGPT via an API. Also, it is available on Unity. &lt;/p&gt;

&lt;h1&gt;
  
  
  Implementation of ChatGPT API
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Obtain API key from Open AI
&lt;/h2&gt;

&lt;p&gt;To use ChatGPT API, it is necessary to get API KEY from Open AI. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Access Open AI platform &lt;br&gt;
&lt;a href="https://platform.openai.com/" rel="noopener noreferrer"&gt;Open AI&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click DashBoard &amp;gt; API keys&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click "Create new secret key"&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feoqh13grqyjlx9gdmaig.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feoqh13grqyjlx9gdmaig.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Request
&lt;/h2&gt;

&lt;p&gt;To confirm the dialog, I implemented two text filed and the button. When the button was clicked, it requests Chat GPT API. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flbzohnjes091c40r125p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flbzohnjes091c40r125p.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Sample
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;

&lt;p&gt;&lt;span class="c1"&gt;// Open API Endpoint&lt;/span&gt;&lt;br&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;apiUrl&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&lt;a href="https://api.openai.com/v1/chat/completions" rel="noopener noreferrer"&gt;https://api.openai.com/v1/chat/completions&lt;/a&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="c1"&gt;// Add message into list&lt;/span&gt;&lt;br&gt;
&lt;span class="n"&gt;_messageList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;ChatGPTMessageModel&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;role&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;userMessage&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="c1"&gt;// Header Information &lt;/span&gt;&lt;br&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;Dictionary&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
    &lt;span class="s"&gt;"Authorization"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Bearer "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;_apiKey&lt;/span&gt;&lt;br&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;&lt;br&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
     &lt;span class="s"&gt;"Content-type"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"application/json"&lt;/span&gt;&lt;br&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;};&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="c1"&gt;// Request Opiton &lt;/span&gt;&lt;br&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ChatGPTCompletionRequestModel&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
  &lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"gpt-3.5-turbo"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br&gt;
  &lt;span class="n"&gt;messages&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_messageList&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;};&lt;/span&gt;&lt;br&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;jsonOptions&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;JsonUtility&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToJson&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;var&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;UnityWebRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;apiUrl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;br&gt;
&lt;span class="s"&gt;"POST"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
  &lt;span class="n"&gt;uploadHandler&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;UploadHandlerRaw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;br&gt;
    &lt;span class="n"&gt;Encoding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;UTF8&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetBytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jsonOptions&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;&lt;br&gt;
            &lt;span class="n"&gt;downloadHandler&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;DownloadHandlerBuffer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;};&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="c1"&gt;// Set Request Header&lt;/span&gt;&lt;br&gt;
&lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
  &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SetRequestHeader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="c1"&gt;// Request &lt;/span&gt;&lt;br&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SendWebRequest&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="c1"&gt;// Process Request&lt;/span&gt;&lt;br&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;UnityWebRequest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ConnectionError&lt;/span&gt; &lt;span class="p"&gt;||&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;UnityWebRequest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ProtocolError&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
  &lt;span class="n"&gt;Debug&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;LogError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;br&gt;
  &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Exception&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;br&gt;
&lt;span class="k"&gt;else&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
  &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;responseString&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;downloadHandler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br&gt;
  &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;responseObject&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;JsonUtility&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FromJson&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ChatGPTResponseModel&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="n"&gt;responseString&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="n"&gt;_messageList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;responseObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;br&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;responseObject&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Set initial message&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;Dialog can be changed by setting initial message. At this time, I changed it to speak more like a German.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;

&lt;p&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ChatGPTMessageModel&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;role&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"system"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"You are German. Please reply like German in English"&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Execution of ChatGPT API on Unity&lt;br&gt;
&lt;/h1&gt;

&lt;p&gt;This video shows the dialog that used Chat GPT API.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/mVCrJQuXJmM"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Next Step
&lt;/h1&gt;

</description>
      <category>unity3d</category>
      <category>gamedev</category>
      <category>chatgpt</category>
      <category>csharp</category>
    </item>
    <item>
      <title>AR Game ~ Geospatial API ~</title>
      <dc:creator>Akira Game</dc:creator>
      <pubDate>Tue, 11 Jun 2024 13:54:38 +0000</pubDate>
      <link>https://dev.to/takeda1411123/ar-game-geospatial-api--2n55</link>
      <guid>https://dev.to/takeda1411123/ar-game-geospatial-api--2n55</guid>
      <description>&lt;p&gt;Table of contents&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Background&lt;/li&gt;
&lt;li&gt;What is Geospatial API&lt;/li&gt;
&lt;li&gt;Implementation of Geospatial API&lt;/li&gt;
&lt;li&gt;Execution of the Geospatial API&lt;/li&gt;
&lt;li&gt;Next Step&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Background
&lt;/h1&gt;

&lt;p&gt;I will develop AR Game with Unity, AR foundation and so on. To learn AR development, I am researching about AR and the software related it. This blog shows the research and the process of developing AR game. If you have a question, I am happy to answer it.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is Geospatial API
&lt;/h1&gt;

&lt;p&gt;I will develop AR game with Geospatial API. Currently, there are several types of AR. I have written the article about these types. If you want, please see it. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/takeda1411123/ar-game-what-is-augmented-reality-ar--24m0"&gt;What is Augmented Reality (AR)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Previous AR technology made it difficult to place AR objects in specific locations, and objects could only be placed around the device.&lt;br&gt;
The Geospatial API uses not only your smartphone's GPS information but also Google Street View data and images from your smartphone's camera to perform precise positioning, allowing you to place AR objects anywhere in the world.&lt;br&gt;
Additionally, this API allows nearby buildings to create an AR world, which can provide a more immersive experience. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://developers.google.com/ar/develop/geospatial" rel="noopener noreferrer"&gt;Geospatial API&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  Implementation of Geospatial API
&lt;/h1&gt;

&lt;p&gt;This post will show how to implement AR using &lt;strong&gt;Geospatial API&lt;/strong&gt;. &lt;/p&gt;
&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Installed Unity&lt;/li&gt;
&lt;li&gt;Installed AR Foundation&lt;/li&gt;
&lt;li&gt;Installed AR core or AR Kit&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Enable the ARCore API
&lt;/h2&gt;

&lt;p&gt;It is necessary to enable the ARCore API in a GCP project to use Geospatial API.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs698wnjrg0rhxsttkbgs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs698wnjrg0rhxsttkbgs.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Add required libraries to your app
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Install ARCore Extension
&lt;/h3&gt;

&lt;p&gt;To use the ARCore Geospatial API, your project must support AR Foundation and the ARCore Extensions for AR Foundation.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Access Package manager&lt;/li&gt;
&lt;li&gt;Click "Add package from git URL"&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;URL&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

https://github.com/google-ar/arcore-unity-extensions.git


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fizcbm21za2bdtbs4x17f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fizcbm21za2bdtbs4x17f.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Add required libraries to your app
&lt;/h3&gt;

&lt;p&gt;You must add libraries to enable Geospatial features in your app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0yj7vtsdmu8l19q2uqzm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0yj7vtsdmu8l19q2uqzm.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Enable Geospatial capabilities in the session configuration
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Create "ARCore Extensions Config"&lt;/li&gt;
&lt;li&gt;Change Geospatial Mode from disabled to enabled&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiz0yjp7w2a9atganw00i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiz0yjp7w2a9atganw00i.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo6a6l589jg3fkc6oezal.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo6a6l589jg3fkc6oezal.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Create ARCore Extensions
&lt;/h2&gt;

&lt;p&gt;Create ARCore Extensions object and attach ARCore Extensions Config on it. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiprguizqv8y3cwk4v28f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiprguizqv8y3cwk4v28f.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Create XR Origin
&lt;/h2&gt;

&lt;p&gt;Create XR Origin (AR) object, which manage user' movement and input.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmym6x9jvg3cgtt2izjx3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmym6x9jvg3cgtt2izjx3.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Add Component
&lt;/h3&gt;

&lt;p&gt;Add these below components&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;AR Earth Manger&lt;/strong&gt; for location &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AR Anchor Manager&lt;/strong&gt; for putting objects in a specific place&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AR Streetscape Geometry Manager&lt;/strong&gt; for getting
Geometry information for buildings and other urban environments&lt;/li&gt;
&lt;li&gt;AR Plane Manager for tracking and managing a plane&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Set AR Camera Manager on Main Camera Object
&lt;/h2&gt;

&lt;p&gt;This component can estimate the light in an AR scene based on light information obtained from camera images. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmanagobgf0ccv2pxnv9t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmanagobgf0ccv2pxnv9t.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Add AR Occlusion Manager onto Main Camera Object
&lt;/h2&gt;

&lt;p&gt;This component can occlude virtual objects with real world exists like buildings and trees. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0a5mxjpx9jnxnqsfouws.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0a5mxjpx9jnxnqsfouws.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Get started with Code
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Start location Service
&lt;/h3&gt;

&lt;p&gt;You can start the location service with "Input.location.Start()". Once started, the service can get the user's location information etc. &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;

&lt;span class="n"&gt;example&lt;/span&gt; 

&lt;span class="n"&gt;_waitingForLocationService&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(!&lt;/span&gt;&lt;span class="n"&gt;Input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isEnabledByUser&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;_waitingForLocationService&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;Debug&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Starting location service."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;Input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Start&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;LocationServiceStatus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Initializing&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Get location information
&lt;/h3&gt;

&lt;p&gt;You can get location information with AR Earth Manger as above.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;

&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;pose&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;earthTrackingState&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;TrackingState&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tracking&lt;/span&gt; 
&lt;span class="n"&gt;EarthManager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CameraGeospatialPose&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;GeospatialPose&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="n"&gt;InfoText&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="s"&gt;"Latitude/Longitude: {1}°, {2}°{0}"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
                &lt;span class="s"&gt;"Horizontal Accuracy: {3}m{0}"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
                &lt;span class="s"&gt;"Altitude: {4}m{0}"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
                &lt;span class="s"&gt;"Vertical Accuracy: {5}m{0}"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
                &lt;span class="s"&gt;"Eun Rotation: {6}{0}"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
                &lt;span class="s"&gt;"Orientation Yaw Accuracy: {7}°"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;NewLine&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;pose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Latitude&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"F6"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                &lt;span class="n"&gt;pose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Longitude&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"F6"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                &lt;span class="n"&gt;pose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HorizontalAccuracy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"F6"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                &lt;span class="n"&gt;pose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Altitude&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"F2"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                &lt;span class="n"&gt;pose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;VerticalAccuracy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"F2"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                &lt;span class="n"&gt;pose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EunRotation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"F1"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                &lt;span class="n"&gt;pose&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;OrientationYawAccuracy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"F1"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Set AR Contents
&lt;/h3&gt;

&lt;p&gt;AR contents can be put by specifying the latitude, longtude, and altitude. &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

anchor = anchorManager.AddAnchor(latitude, longitude, altitude, rotation);
instance = Instantiate(prefab, anchor.transform);


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Execution of the Geospatial API
&lt;/h1&gt;

&lt;p&gt;This video shows the sample game that used Geospatial API.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/hHFIj8Zwc9g"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Next step
&lt;/h1&gt;

&lt;p&gt;As next step, I will research ChatGPT API for the automated creation of character dialog.&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>unity3d</category>
      <category>api</category>
      <category>location</category>
    </item>
    <item>
      <title>AR Game ~ Location Information ~</title>
      <dc:creator>Akira Game</dc:creator>
      <pubDate>Sun, 09 Jun 2024 11:25:57 +0000</pubDate>
      <link>https://dev.to/takeda1411123/ar-game-location-information--1e8k</link>
      <guid>https://dev.to/takeda1411123/ar-game-location-information--1e8k</guid>
      <description>&lt;p&gt;Table of contents&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Background&lt;/li&gt;
&lt;li&gt;Creation of AR game with location information &lt;/li&gt;
&lt;li&gt;Execution of the game &lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Background
&lt;/h1&gt;

&lt;p&gt;I will develop AR Game with Unity, AR foundation and so on. To learn AR development, I am researching about AR and the software related it. This blog shows the research and the process of developing AR game. If you have a question, I am happy to answer it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Creation of AR game with location information
&lt;/h1&gt;

&lt;p&gt;In our game, users' location information will be utilized for showing user on real map. When players move in real move, their characters on the map move. This post will show how to develop the AR game with location information.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technology
&lt;/h2&gt;

&lt;p&gt;These below technologies will be used in this game. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Google Maps API&lt;/li&gt;
&lt;li&gt;CUDLR &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Google Maps API
&lt;/h3&gt;

&lt;p&gt;At this time, Google Maps API will be utilized to show users' character on the map. In google map apps, the map is showed by using still image tile.&lt;br&gt;
In addition to this map information, the Google Maps API can dynamically change the way it is displayed, so you can view the map from the view point of a TPS user. The map display can also be changed to make it look more like a game. &lt;/p&gt;
&lt;h4&gt;
  
  
  API Key
&lt;/h4&gt;

&lt;p&gt;It is necessary to get API keys to use Google Maps API. &lt;/p&gt;

&lt;p&gt;You can get it referencing the below URL.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developers.google.com/maps/documentation/maps-static/get-api-key"&gt;https://developers.google.com/maps/documentation/maps-static/get-api-key&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Sample Request
&lt;/h4&gt;

&lt;p&gt;If you get API Key, you can get static image tile by requesting Map Static API like the below URL.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://maps.googleapis.com/maps/api/staticmap?center=Berkeley,CA&amp;amp;zoom=14&amp;amp;size=400x400&amp;amp;key=%7BYour"&gt;https://maps.googleapis.com/maps/api/staticmap?center=Berkeley,CA&amp;amp;zoom=14&amp;amp;size=400x400&amp;amp;key={Your&lt;/a&gt; API Key}&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;{Your API key} can be changed to your API key. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgvrgccg34pcjwlmcs9oi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgvrgccg34pcjwlmcs9oi.png" alt="Image description" width="400" height="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Request from Unity
&lt;/h4&gt;

&lt;p&gt;Also, you can request from Unity project. If you request, you can see  the map tile like below image.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnsyu5snk044uh9v0fw5b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnsyu5snk044uh9v0fw5b.png" alt="Image description" width="800" height="456"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  CUDLR
&lt;/h3&gt;

&lt;p&gt;CUDLR is one of the debug tool. Log can be seen on web while the game is running on your devices. &lt;/p&gt;
&lt;h4&gt;
  
  
  Important Points
&lt;/h4&gt;

&lt;p&gt;CUDLR is for debug or test, so do not use for production.&lt;br&gt;
Please make sure to delete CUDLR objects before release. &lt;/p&gt;
&lt;h2&gt;
  
  
  Get users' location
&lt;/h2&gt;

&lt;p&gt;This game requires synchronisation of the user's actual position with the player position in the game. For this purpose, the actual position of the user needs to be acquired. &lt;/p&gt;
&lt;h3&gt;
  
  
  Permission for getting user location
&lt;/h3&gt;

&lt;p&gt;This game requires user permission for location data to be acquired, which can be set on PlayerSettings.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flovtx3od5ofcyg7y7r74.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flovtx3od5ofcyg7y7r74.png" alt="Image description" width="800" height="567"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Code sample
&lt;/h3&gt;

&lt;p&gt;You can get user location information on Unity.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// check if the program has the user permission
if (!Input.location.isEnabledByUser)
{
  Debug.Log("Location services are not available");
  yield break;
}

// start location service
Input.location.Start();

// wait for the Initializing services 
int maxWait = 20;
while (Input.location.status == LocationServiceStatus.Initializing &amp;amp;&amp;amp; maxWait &amp;gt; 0)
{
   yield return new WaitForSeconds(1);
   maxWait--;
}


// get location information 
Debug.Log(
   "Location: " + Input.location.lastData.latitude + " " + Input.location.lastData.longitude
);


// stop location service
Input.location.Stop();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Get users rotation
&lt;/h2&gt;

&lt;p&gt;For a better user experience, the orientation of the player is also changed depending on the orientation of the device.&lt;/p&gt;

&lt;h3&gt;
  
  
  Code sample
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// enable compass 
Input.compass.enabled = true;

// change the rotation of the player depending on the rotation of the device
var heading = 180 + Input.compass.magneticHeading;
var rotation = Quaternion.AngleAxis(heading, Vector3.up);
transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.fixedTime * .001f);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Execution of the game
&lt;/h1&gt;

&lt;p&gt;Merging these above implementation, players can see the map around the actual user position. Also, they can see around while changing the rotation of devices. &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/xkTECfwaLe4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Next Step
&lt;/h1&gt;

&lt;p&gt;As next step, I will research Geospatial API for the development using outdoor buildings. &lt;/p&gt;

</description>
      <category>unity3d</category>
      <category>gamedev</category>
      <category>location</category>
      <category>api</category>
    </item>
    <item>
      <title>AR Game ~ Applied AR to practice ~</title>
      <dc:creator>Akira Game</dc:creator>
      <pubDate>Sun, 09 Jun 2024 11:17:36 +0000</pubDate>
      <link>https://dev.to/takeda1411123/ar-game-applied-ar-to-practice--1g25</link>
      <guid>https://dev.to/takeda1411123/ar-game-applied-ar-to-practice--1g25</guid>
      <description>&lt;p&gt;Table of contents&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Background&lt;/li&gt;
&lt;li&gt;Creation of applied AR&lt;/li&gt;
&lt;li&gt;Execution of the game&lt;/li&gt;
&lt;li&gt;Next Step&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Background
&lt;/h1&gt;

&lt;p&gt;I will develop AR Game with Unity, AR foundation and so on. To learn AR development, I am researching about AR and the software related it. This blog shows the research and the process of developing AR game. If you have a question, I am happy to answer it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Creation of applied AR
&lt;/h1&gt;

&lt;p&gt;This post will show the implement of AR game, which is named memorial world. I referenced the below course to learn how to create the AR game. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.udemy.com/course/build-augmented-reality-ar-apps-with-arfoundation-unity/"&gt;https://www.udemy.com/course/build-augmented-reality-ar-apps-with-arfoundation-unity/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to create the similar game, you should check it out. &lt;/p&gt;

&lt;h2&gt;
  
  
  Game Mechanics
&lt;/h2&gt;

&lt;p&gt;In this game, your memories are displayed in an AR space. You can see photos that remind you of your memories in the AR space, and seeing them in places that remind you of your memories will bring back even more memories. &lt;/p&gt;

&lt;h2&gt;
  
  
  Technology
&lt;/h2&gt;

&lt;p&gt;In this game, while players can see pictures when they enter the AR entrance, player can not see them when they are out of the AR entrance. Therefore, it is necessary to change how to draw objects depending on the player's position. To change it, these below functions will be used in this game. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shader&lt;/li&gt;
&lt;li&gt;Stencil Buffer&lt;/li&gt;
&lt;li&gt;Stencil Test&lt;/li&gt;
&lt;li&gt;Culling&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Shader
&lt;/h3&gt;

&lt;p&gt;This is the program that writes the way to draw. This allows objects to show on scenes. It can shows various expressions on objects such as shade. &lt;/p&gt;

&lt;h3&gt;
  
  
  Stencil Buffer
&lt;/h3&gt;

&lt;p&gt;Shader and Stencil are similar and determine how objects are displayed. Stencil makes it possible to change the visibility of objects from certain areas and show pictures only at the entrance of the AR, which is what we want to do this time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stencil Test
&lt;/h3&gt;

&lt;p&gt;Each pixel on the screen has a &lt;strong&gt;Stencil buffer&lt;/strong&gt; value and the object has a &lt;strong&gt;Reference value&lt;/strong&gt;. The stencil test uses these values to determine whether the object is allowed to be drawn.&lt;/p&gt;

&lt;h3&gt;
  
  
  Culling
&lt;/h3&gt;

&lt;p&gt;The process that prevents Unity from performing rendering calculations for GameObjects that are completely obscured (occluded) by other GameObjects. In this game, it is used for being able to see real world from the inside of AR room. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.unity3d.com/Manual/SL-Cull.html"&gt;https://docs.unity3d.com/Manual/SL-Cull.html&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Execution of the game
&lt;/h1&gt;

&lt;p&gt;At this time, I displayed free images related anime OnePiece in the AR space for the purpose of introduction. You can actually your memory images. Also, I deployed it to my iOS device and confirmed to display AR objects. Please watch the video below. &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Nrgw7_sTPD4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;If you have any questions about Unity and AR, I'm happy to answer them. &lt;/p&gt;

&lt;h1&gt;
  
  
  Next step
&lt;/h1&gt;

&lt;p&gt;I will research APIs related AR and location information to use them for my game. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>AR Game ~ Initial AR to practice ~</title>
      <dc:creator>Akira Game</dc:creator>
      <pubDate>Tue, 04 Jun 2024 10:07:11 +0000</pubDate>
      <link>https://dev.to/takeda1411123/ar-game-initial-ar-to-practice--2l6g</link>
      <guid>https://dev.to/takeda1411123/ar-game-initial-ar-to-practice--2l6g</guid>
      <description>&lt;p&gt;Table of contents&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Background&lt;/li&gt;
&lt;li&gt;Creation an AR object on Unity for the first time&lt;/li&gt;
&lt;li&gt;Execution AR &lt;/li&gt;
&lt;li&gt;Next Step&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Background
&lt;/h1&gt;

&lt;p&gt;I will develop AR Game with Unity, AR foundation and so on. To learn AR development, I am researching about AR and the software related it. This blog shows the research and the process of developing AR game. If you have a question, I am happy to answer it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Creation an AR object on Unity for the first time
&lt;/h1&gt;

&lt;p&gt;In this post, I will implement the AR experiment that player put an AR red cube on Unity and show the process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Precondition
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Unity is installed&lt;/li&gt;
&lt;li&gt;AR foundation package is installed&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to implement an AR object
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create Scene&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx9kwt3u6rkkje3oev65h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx9kwt3u6rkkje3oev65h.png" alt="Image description" width="800" height="646"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Delete "Main Camera" &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add "AR Session" ( XR -&amp;gt; AR Session )&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fexpyweho8q0qzm3l5h0x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fexpyweho8q0qzm3l5h0x.png" alt="Image description" width="800" height="664"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add "XR Origin (AR)" (XR -&amp;gt; XR Origin (AR))&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy5hb96bxch7retkx4ne2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy5hb96bxch7retkx4ne2.png" alt="Image description" width="800" height="661"&gt;&lt;/a&gt;&lt;br&gt;
It has "Main Camera", which synchronize the position and direction of user's device in real world. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Put cube under the XR Origin objects &lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh9ewddzfuvehlcc7tp5z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh9ewddzfuvehlcc7tp5z.png" alt="Image description" width="800" height="646"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Execution AR
&lt;/h1&gt;

&lt;p&gt;This part will show how to execute the game on iOS and Android.&lt;/p&gt;

&lt;h2&gt;
  
  
  Execution the game on iOS
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Build Setting&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;iOS&lt;/strong&gt; on Platform&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Switch Platform&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkpzfpix8qxuhhoazgkmg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkpzfpix8qxuhhoazgkmg.png" alt="Image description" width="800" height="797"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add the package &lt;strong&gt;Apple ARKit XR Plugin&lt;/strong&gt; from package manager&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmdrg7mworkee6a0lbee4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmdrg7mworkee6a0lbee4.png" alt="Image description" width="800" height="558"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check &lt;strong&gt;Apple ARKit&lt;/strong&gt; from XR Plug-in Management of Project Settings&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fotgy2bk8r28qzt4ucsfj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fotgy2bk8r28qzt4ucsfj.png" alt="Image description" width="800" height="501"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Build&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Execution the game on Android
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Build Setting&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Android&lt;/strong&gt; on Platform&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Switch Platform&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw7q6p3zhfg5sdoaonwmu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw7q6p3zhfg5sdoaonwmu.png" alt="Image description" width="800" height="796"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add the package &lt;strong&gt;Google ARCore XR Plugin&lt;/strong&gt; from package manager&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3aa2ohae8izawafc5wgy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3aa2ohae8izawafc5wgy.png" alt="Image description" width="800" height="552"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check &lt;strong&gt;Google ARCore&lt;/strong&gt; from XR Plug-in Management of Project Settings&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpbtjozvh2btdok3vnlai.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpbtjozvh2btdok3vnlai.png" alt="Image description" width="800" height="541"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Build&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Finished Product
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/q0M2vQVNOtw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Next Step
&lt;/h1&gt;

&lt;p&gt;As next step, I will develop the applied AR game using these above products.&lt;/p&gt;

</description>
      <category>unity3d</category>
      <category>gamedev</category>
    </item>
    <item>
      <title>AR Game ~Research of AR Foundation~</title>
      <dc:creator>Akira Game</dc:creator>
      <pubDate>Fri, 31 May 2024 13:25:06 +0000</pubDate>
      <link>https://dev.to/takeda1411123/ar-game-research-of-ar-foundation-13eg</link>
      <guid>https://dev.to/takeda1411123/ar-game-research-of-ar-foundation-13eg</guid>
      <description>&lt;p&gt;Table of contents&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Background&lt;/li&gt;
&lt;li&gt;What is AR foundation&lt;/li&gt;
&lt;li&gt;Supported device versions&lt;/li&gt;
&lt;li&gt;Installation of AR foundation&lt;/li&gt;
&lt;li&gt;Functions of AR foundation&lt;/li&gt;
&lt;li&gt;Next Step&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Background
&lt;/h1&gt;

&lt;p&gt;I will develop AR Game with Unity, AR foundation and so on. To learn AR development, I am researching about AR and the software related it. This blog shows the research and the process of developing AR game. If you have a question, I am happy to answer it.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is AR foundation
&lt;/h1&gt;

&lt;p&gt;There are many platforms for developing AR. In 2017, Apple released ARKit, which allows AR development on iOS devices.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ujtei5no9dr1of71qhg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ujtei5no9dr1of71qhg.png" alt="Image description" width="800" height="514"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ref: &lt;a href="https://testgrid.io/blog/automation-testing-an-arkit-application/"&gt;https://testgrid.io/blog/automation-testing-an-arkit-application/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the same year, Google released ARCore, which allows AR development on Android devices.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5z4xa5k24lf599ztswjd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5z4xa5k24lf599ztswjd.png" alt="Image description" width="800" height="243"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ref: &lt;a href="https://developers.googleblog.com/en/announcing-arcore-10-and-new-updates-to-google-lens/"&gt;https://developers.googleblog.com/en/announcing-arcore-10-and-new-updates-to-google-lens/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each platform relies on the device's OS. Therefore, if you wanted to develop an AR application for both iOS and Android devices, you would need to use both platforms (ARKit and ARCore).&lt;/p&gt;

&lt;p&gt;To solve this problem, we can use AR Foundation. It was released by Unity in 2013. By using it, developers can create AR in a single project.&lt;/p&gt;

&lt;h1&gt;
  
  
  Supported device versions
&lt;/h1&gt;

&lt;p&gt;A complete list of ARCore supported android smartphone can be found on the link.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developers.google.com/ar/devices"&gt;https://developers.google.com/ar/devices&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A complete list of ARKit supported android smartphone can be found on the link.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.apple.com/in/augmented-reality/"&gt;https://www.apple.com/in/augmented-reality/&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Installation of AR foundation
&lt;/h1&gt;

&lt;p&gt;You can install AR foundation referencing the below link.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@5.0/manual/project-setup/install-arfoundation.html"&gt;https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@5.0/manual/project-setup/install-arfoundation.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developers.google.com/ar/develop/unity-arf/getting-started-ar-foundation"&gt;https://developers.google.com/ar/develop/unity-arf/getting-started-ar-foundation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In May of 2024, AR Foundation 5.0 is compatible with Unity 2021.2 and up.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to install AR foundation Unity package.
&lt;/h2&gt;

&lt;p&gt;How to install AR foundation from package manager on Unity.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Unity project&lt;/li&gt;
&lt;li&gt;Window &amp;gt; Package Manager&lt;/li&gt;
&lt;li&gt;Select Unity Registry&lt;/li&gt;
&lt;li&gt;Search "AR Foundation"&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Install&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Or &lt;br&gt;
When you create a Unity project, you can choose the AR Mobile project template on Unity Hub, which sets up the necessary AR packages. You do not need to import AR foundation package individually. &lt;/p&gt;

&lt;h1&gt;
  
  
  Functions of AR foundation
&lt;/h1&gt;

&lt;p&gt;The below list is the function of AR foundation. &lt;/p&gt;

&lt;h2&gt;
  
  
  Basic
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Device Tracking

&lt;ul&gt;
&lt;li&gt;Track the device's position and rotation in physical space&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Manage Session

&lt;ul&gt;
&lt;li&gt;Enable, disable, and configure AR on the target platform&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Camera 

&lt;ul&gt;
&lt;li&gt;Render images from device cameras and perform light estimation&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Occlusion

&lt;ul&gt;
&lt;li&gt;Occlude AR content with physical objects&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Detection and Tracking
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Plane detection

&lt;ul&gt;
&lt;li&gt;Detect and track surfaces&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Point clouds

&lt;ul&gt;
&lt;li&gt;Detect and track feature points&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Anchors 

&lt;ul&gt;
&lt;li&gt;Track arbitrary points in space&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Image

&lt;ul&gt;
&lt;li&gt;Detect and track 2D images&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Object

&lt;ul&gt;
&lt;li&gt;Detect and track 3D objects&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Face 

&lt;ul&gt;
&lt;li&gt;Detect and track human faces&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Body 

&lt;ul&gt;
&lt;li&gt;Detect and track a human body&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Participants

&lt;ul&gt;
&lt;li&gt;Track other devices in a shared AR session.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Others
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Raycasts

&lt;ul&gt;
&lt;li&gt;Cast rays against tracked items&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Meshing

&lt;ul&gt;
&lt;li&gt;Generate meshes of the environment&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Environment probes

&lt;ul&gt;
&lt;li&gt;Generate cubemaps of the environment&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Next Step
&lt;/h1&gt;

&lt;p&gt;I was going to display a sample AR object in Unity, but it will take a little more time. Therefore, I will show how to implement AR objects in Unity in the next post.&lt;/p&gt;

</description>
      <category>unity3d</category>
      <category>gamedev</category>
    </item>
    <item>
      <title>AR Game ~ What is Augmented Reality (AR) ~</title>
      <dc:creator>Akira Game</dc:creator>
      <pubDate>Fri, 31 May 2024 10:49:07 +0000</pubDate>
      <link>https://dev.to/takeda1411123/ar-game-what-is-augmented-reality-ar--24m0</link>
      <guid>https://dev.to/takeda1411123/ar-game-what-is-augmented-reality-ar--24m0</guid>
      <description>&lt;p&gt;Table of contents&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Background&lt;/li&gt;
&lt;li&gt;What is Augmented Reality&lt;/li&gt;
&lt;li&gt;Types of Augmented Reality&lt;/li&gt;
&lt;li&gt;Next Step&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Background
&lt;/h1&gt;

&lt;p&gt;I will develop AR Game with Unity, AR foundation and so on. To learn AR development, I am researching about AR and the software related it. This blog shows the research and the process of developing AR game. If you have a question, I am happy to answer it. &lt;/p&gt;

&lt;h1&gt;
  
  
  What is Augmented Reality
&lt;/h1&gt;

&lt;p&gt;The term "augment" means to add something. Augmented Reality (AR) is a technology that enhances the real world by overlaying digital information throungh devices such as smartphones and AR glasses. A well-known application of AR in gaming is Pokemon GO. In Pokemon GO, players use their smartphone cameras to display Pokemon in the real world. When displaying AR on a smartphone, various functionalities such as the camera, GPS, accelerometer, and compass are utiliized to create the augmented experience.&lt;/p&gt;

&lt;h1&gt;
  
  
  Types of Augmented Reality
&lt;/h1&gt;

&lt;p&gt;AR primarily has two types. One of them is Marker-based AR. Another type is Markerless AR.&lt;/p&gt;

&lt;h2&gt;
  
  
  Marker-based AR
&lt;/h2&gt;

&lt;p&gt;This type displays 3D objects on a marker by reading the marker, such as a QR code or an image.&lt;/p&gt;

&lt;p&gt;Example&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/DXheLzszraw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Markerless AR
&lt;/h2&gt;

&lt;p&gt;This type can display 3D objects without markers. Instead, it uses the sensors or camera of smartphones, relying on these functions. &lt;br&gt;
It is used in Pokemon GO.&lt;/p&gt;

&lt;p&gt;This type is further divided into three subtypes, which are location based AR, projection based, and superimpostion AR. &lt;/p&gt;
&lt;h3&gt;
  
  
  Location based
&lt;/h3&gt;

&lt;p&gt;Due to the availability of smartphone feature that provide location detection, it shows AR to  a specific place by getting data from a device’s camera, GPS, digital compass, and accelerometer. &lt;/p&gt;

&lt;p&gt;Example&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/rVw8Mw2rYQg"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Projection based
&lt;/h3&gt;

&lt;p&gt;This type uses a small projecter.It focuses on rendering virtual objects within or on a user’s physical space. Since virtual objects are projected on user's physical space directly, the change of the environment reclects the virtual objects. &lt;/p&gt;

&lt;p&gt;Example&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/CE1B7tdGCw0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Superimpostion (Object Tracking)
&lt;/h3&gt;

&lt;p&gt;This type is also called object tracking AR. It literally tracks objects. It can replace an original view of an object with a scaled version of the same object.&lt;/p&gt;

&lt;p&gt;Example&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/mytxLcNAR2s"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Next step
&lt;/h1&gt;

&lt;p&gt;This post showed what is AR and the types of AR. I will use some of them to create AR Game. &lt;br&gt;
Next post will show the research of AR foundation. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Future my game development</title>
      <dc:creator>Akira Game</dc:creator>
      <pubDate>Wed, 29 May 2024 11:23:30 +0000</pubDate>
      <link>https://dev.to/takeda1411123/future-my-game-development-1md3</link>
      <guid>https://dev.to/takeda1411123/future-my-game-development-1md3</guid>
      <description>&lt;h1&gt;
  
  
  Current
&lt;/h1&gt;

&lt;p&gt;I'm post graduate student in the UK and study game development. &lt;br&gt;
I'm going to create below games in the future.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Kick The Can&lt;/li&gt;
&lt;li&gt;The Sunlight&lt;/li&gt;
&lt;li&gt;AR Game&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Kick The Can
&lt;/h2&gt;

&lt;p&gt;This game is inspired by the traditional game of kick-the-can that everyone played during their childhood. I will start by developing a simple 2D version of the game and work towards its release.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Sunlight
&lt;/h2&gt;

&lt;p&gt;This game is inspired by the idea of everyone in the UK seeking sunlight. I will also start by developing a simple 2D version of the game and work towards its release.&lt;/p&gt;

&lt;h2&gt;
  
  
  AR Game
&lt;/h2&gt;

&lt;p&gt;This game is planned to be developed using AR. It will be designed for use in the tourism industry. Details will be updated regularly in this blog.&lt;/p&gt;

&lt;p&gt;To be continued...&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
