<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Unity space to world space + inverse]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=55&amp;type=atom" />
	<updated>2015-11-24T09:10:59Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=55</id>
		<entry>
			<title type="html"><![CDATA[Re: Unity space to world space + inverse]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=226#p226" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>cshiel wrote:</cite><blockquote><p>new Vector2 (-27.52188f, 153.0187f)</p></blockquote></div><p>It&#039;s wrong. X - longitude, Y - latitude.</p><br /><div class="quotebox"><cite>cshiel wrote:</cite><blockquote><p>newEntity.transform.position = unityPosition;</p></blockquote></div><p>Screen space is not equal World space.<br />No matter what you are using GUI, uGUI, Tileset.<br />It is always wrong.<br />For tileset use GetWorldPosition.<br />For the other controls: you need to convert screen position to world position.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2015-11-24T09:10:59Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=226#p226</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Unity space to world space + inverse]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=225#p225" />
			<content type="html"><![CDATA[<p>I am trying this with the tile example, trying to put in a gameobject around Brisbane.</p><div class="codebox"><pre><code>GameObject newEntity = null;
newEntity = GameObject.Instantiate(pedTemplate);
var unityPosition = OnlineMapsControlBase.instance.GetScreenPosition(new Vector2(-27.52188f, 153.0187f));
newEntity.transform.position = unityPosition;</code></pre></div><p>and</p><div class="codebox"><pre><code>newEntity.transform.position = new Vector3(unityPosition.x, 0, unityPosition.y);</code></pre></div><p>Its not putting the object in the correct place.</p>]]></content>
			<author>
				<name><![CDATA[cshiel]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=55</uri>
			</author>
			<updated>2015-11-24T02:28:00Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=225#p225</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Unity space to world space + inverse]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=224#p224" />
			<content type="html"><![CDATA[<p>bool OnlineMapsControlBase.GetCoords (out double&nbsp; lng, out double&nbsp; lat, Vector2 position) &nbsp; &nbsp; <br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsControlBase.html#adf9dcbf5cec2cdd65d6c614fd5a5a0e1">http://infinity-code.com/doxygen/online … 4fd5a5a0e1</a></p><p>bool OnlineMapsTileSetControl.GetCoordsByWorldPosition (out double lng, out double lat, Vector3 position)<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsTileSetControl.html#a5312d877363f166bb1a9571b58011257">http://infinity-code.com/doxygen/online … 1b58011257</a></p><p>Online Maps v2.3 beta (available through the built-in update):<br />void OnlineMapsControlBase.GetPosition(double lng, double lat, out double px, out double py)<br />Vector2 OnlineMapsControlBase.GetScreenPosition(double lng, double lat)<br />Vector3 OnlineMapsTileSetControl.GetWorldPosition(double lng, double lat)<br />Vector3 OnlineMapsTileSetControl.GetWorldPositionWithElevation(double lng, double lat, double tlx, double tly, double brx, double bry)</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2015-11-24T00:05:27Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=224#p224</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Unity space to world space + inverse]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=223#p223" />
			<content type="html"><![CDATA[<p>I don&#039;t see the double implementation for these methods.</p>]]></content>
			<author>
				<name><![CDATA[cshiel]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=55</uri>
			</author>
			<updated>2015-11-23T21:42:25Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=223#p223</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Unity space to world space + inverse]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=221#p221" />
			<content type="html"><![CDATA[<p>Yes, almost every method (where necessary) has an overload double precision.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2015-11-23T08:42:38Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=221#p221</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Unity space to world space + inverse]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=220#p220" />
			<content type="html"><![CDATA[<p>Consider: <a href="https://en.wikipedia.org/wiki/Decimal_degrees">https://en.wikipedia.org/wiki/Decimal_degrees</a></p><p>Is there a double implementation? I would like centimeter level accuracy.</p>]]></content>
			<author>
				<name><![CDATA[cshiel]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=55</uri>
			</author>
			<updated>2015-11-23T04:06:09Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=220#p220</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Unity space to world space + inverse]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=219#p219" />
			<content type="html"><![CDATA[<p>Hello.</p><p>OnlineMapsControlBase.GetScreenPosition:<br />Geographical coordinate to screen space.<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsControlBase.html#ab7fe66bc85b7642962deedc82e3a5f04">http://infinity-code.com/doxygen/online … c82e3a5f04</a></p><p>OnlineMapsControlBase.GetCoords:<br />Screen space to geographical coordinates.<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsControlBase.html#a51e9b9d7a334ce8f3e1058b99f610155">http://infinity-code.com/doxygen/online … b99f610155</a></p><p>OnlineMapsControlBase.GetPosition:<br />Converts geographical coordinate to position in the scene relative to the top-left corner of the map in map space.<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsControlBase.html#a20d5d2e83ee1407a9b9ef10028781fe8">http://infinity-code.com/doxygen/online … 0028781fe8</a></p><p>OnlineMapsTileSetControl.GetCoordsByWorldPosition:<br />Returns the geographical coordinates by world position.<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsTileSetControl.html#ae9b9a89af9217b3911308f7316430ad9">http://infinity-code.com/doxygen/online … 7316430ad9</a></p><p>OnlineMapsTileSetControl.GetWorldPosition:<br />Converts geographical coordinates to position in world space.<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsTileSetControl.html#a6ddaccd56021f45bcefaeeea663abc1f">http://infinity-code.com/doxygen/online … ea663abc1f</a></p><p>OnlineMapsTileSetControl.GetWorldPositionWithElevation:<br />Converts geographical coordinates to position in world space with elevation.<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsTileSetControl.html#a8315db902faed115a3a9853632bad690">http://infinity-code.com/doxygen/online … 3632bad690</a></p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2015-11-23T00:51:46Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=219#p219</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Unity space to world space + inverse]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=218#p218" />
			<content type="html"><![CDATA[<p>How can I go from Unity coordinates to real world coordinates and vice versa?</p><p>For example I want to create 1000 gameobjects and I need them to be at Lat Lng 51,-1.</p>]]></content>
			<author>
				<name><![CDATA[cshiel]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=55</uri>
			</author>
			<updated>2015-11-23T00:41:39Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=218#p218</id>
		</entry>
</feed>
