<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: World position to unity position (from geographical coordinates) in ArcGIS Maps SDK for Unity Questions</title>
    <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1228015#M267</link>
    <description>&lt;P&gt;Ok sounds good. So the solution you shared should work.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Nov 2022 18:14:47 GMT</pubDate>
    <dc:creator>Matt_Nelson</dc:creator>
    <dc:date>2022-11-02T18:14:47Z</dc:date>
    <item>
      <title>World position to unity position (from geographical coordinates)</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1227932#M259</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to get the Unity position from geographical coordinates, I have the following code to get the HPTransform position, but I am not sure how to continue from here, (I'm not sure if this is even possible),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;double3 worldPos = map.View.GeographicToWorld(new ArcGISPoint(x, y, spatialRef));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;map = the ArcGISMapComponent;&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;spatialRef = new ArcGISSpatialReference(4326);&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;x,y = 5.1 &amp;amp; 52.1 (example)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This results in: worldPos = double3(568832.151913682, 0, 6816306.77166522)&lt;/P&gt;&lt;P&gt;I have looked a bit in to the HPTransform code, but I couldn't figure out how it worked.&lt;/P&gt;&lt;P&gt;Some more details about the project: I do not use the rebase component on the ArcGISCamera &amp;amp; and the ArcGISCamera is on a fixed location, and I'm using a local scene.&lt;/P&gt;&lt;P&gt;Thanks for the help,&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Reint.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 15:44:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1227932#M259</guid>
      <dc:creator>ReintJ</dc:creator>
      <dc:date>2022-11-02T15:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: World position to unity position (from geographical coordinates)</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1227949#M261</link>
      <description>&lt;P&gt;Is this value&amp;nbsp;&lt;SPAN&gt;This results in: worldPos = double3(568832.151913682, 0, 6816306.77166522) not correct?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 15:46:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1227949#M261</guid>
      <dc:creator>Matt_Nelson</dc:creator>
      <dc:date>2022-11-02T15:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: World position to unity position (from geographical coordinates)</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1227955#M262</link>
      <description>&lt;P&gt;Hello again,&lt;/P&gt;&lt;P&gt;After some more testing and diving in to the code, I think I got it to work,&lt;/P&gt;&lt;P&gt;I used the following code to transform the worldPos variable to the Unity position, using the HPRoot of the ArcGISMap component:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;HPRoot root = map.GetComponent&amp;lt;HPRoot&amp;gt;();
double3 unityPos = root.TransformPoint(worldPos))&lt;/LI-CODE&gt;&lt;P&gt;I'm not sure if this is a valid method that also works in global scenes for example, but it seems to work for local scenes.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 15:52:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1227955#M262</guid>
      <dc:creator>ReintJ</dc:creator>
      <dc:date>2022-11-02T15:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: World position to unity position (from geographical coordinates)</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1227956#M263</link>
      <description>&lt;P&gt;Ok, any reason you aren't just using a location component on the object of interest?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 15:53:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1227956#M263</guid>
      <dc:creator>Matt_Nelson</dc:creator>
      <dc:date>2022-11-02T15:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: World position to unity position (from geographical coordinates)</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1227989#M265</link>
      <description>&lt;P&gt;Hey Matt, I wanted to create a moderate/large amount of objects after the game has started. I think the code is a bit cleaner and more optimized if you can get the height beforehand (so the object it self does not need a seperate script/function to get the height) (and you need to wait a frame before the transform.position is updated, if I'm corrent).&lt;/P&gt;&lt;P&gt;However, this only works because my project area is kind of small, so everything location is loaded, it would not work with larger areas.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 17:07:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1227989#M265</guid>
      <dc:creator>ReintJ</dc:creator>
      <dc:date>2022-11-02T17:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: World position to unity position (from geographical coordinates)</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1227990#M266</link>
      <description>&lt;P&gt;I need the transform.position for a raycast, and the worldPos is the value of the HPTrarnsform.UniversePosition.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 17:08:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1227990#M266</guid>
      <dc:creator>ReintJ</dc:creator>
      <dc:date>2022-11-02T17:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: World position to unity position (from geographical coordinates)</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1228015#M267</link>
      <description>&lt;P&gt;Ok sounds good. So the solution you shared should work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 18:14:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1228015#M267</guid>
      <dc:creator>Matt_Nelson</dc:creator>
      <dc:date>2022-11-02T18:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: World position to unity position (from geographical coordinates)</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1258881#M439</link>
      <description>&lt;P&gt;Thank you for posting this! Thanks to this info, I was able, not only to get a Unity-world location for a geographic coordinate, but also to use HPRoot.InverseTransformPoint() to go the other direction and get a WGS coordinate for a Unity object without a location component.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 14:42:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1258881#M439</guid>
      <dc:creator>m_d</dc:creator>
      <dc:date>2023-02-16T14:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: World position to unity position (from geographical coordinates)</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1281718#M497</link>
      <description>&lt;P&gt;Sorry, but where is the variable "map" comes from? Do I need to use FindObjectByTags or something else?&lt;/P&gt;</description>
      <pubDate>Sun, 23 Apr 2023 22:48:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1281718#M497</guid>
      <dc:creator>文言李</dc:creator>
      <dc:date>2023-04-23T22:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: World position to unity position (from geographical coordinates)</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1281883#M498</link>
      <description>&lt;P&gt;I think there's a way to find it programmatically. But I just set it up as a serialized field so I could choose it in the IDE:&amp;nbsp;&lt;/P&gt;&lt;P&gt;[SerializeField]&lt;BR /&gt;private ArcGISMapComponent _arcGisMapComponent;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 15:53:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1281883#M498</guid>
      <dc:creator>m_d</dc:creator>
      <dc:date>2023-04-24T15:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: World position to unity position (from geographical coordinates)</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1282691#M506</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have tried your solution, but my ArcGISView does not have a SpatialReference. Do you know how I can assign one?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 07:53:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/world-position-to-unity-position-from-geographical/m-p/1282691#M506</guid>
      <dc:creator>BHenke</dc:creator>
      <dc:date>2023-04-26T07:53:01Z</dc:date>
    </item>
  </channel>
</rss>

