<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Infinity Code Forum — Elevation is wrong]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=1122</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1122&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Elevation is wrong.]]></description>
		<lastBuildDate>Sat, 27 Apr 2019 14:43:45 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Elevation is wrong]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4832#p4832</link>
			<description><![CDATA[<p>Many thanks!<br />Simply using OnlineMapsTileSetControl.instance.GetWorldPositionWithElevation did the job</p>]]></description>
			<author><![CDATA[null@example.com (danielesuppo)]]></author>
			<pubDate>Sat, 27 Apr 2019 14:43:45 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4832#p4832</guid>
		</item>
		<item>
			<title><![CDATA[Re: Elevation is wrong]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4831#p4831</link>
			<description><![CDATA[<p>This is not my code. This is Thibault code.<br />As I wrote in that post, I modified this method without an IDE, so I did not test it.<br />I missed that wrong parameters are used.<br />Sometimes it happens.</p><p>In your case, I tested it because you wrote that elevations is not working correctly, and found that the wrong parameters are used.<br />You only need to replace one line in this method to make it work.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Sat, 27 Apr 2019 13:08:47 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4831#p4831</guid>
		</item>
		<item>
			<title><![CDATA[Re: Elevation is wrong]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4830#p4830</link>
			<description><![CDATA[<p>I&#039;m a bit confused.<br />Actually I think to use &quot;GetUnscaledElevation&quot; in the right way, because the code is:</p><p>...<br /> OnlineMaps.instance.GetCorners(out tlx, out tly, out brx, out bry);<br />...<br />float el = OnlineMapsElevationManagerBase.GetUnscaledElevation(longitude, latitude, tlx, tly, brx, bry);<br />...</p><p>I&#039;ve read your post here<br /><a href="http://forum.infinity-code.com/viewtopic.php?id=1056">http://forum.infinity-code.com/viewtopic.php?id=1056</a><br />and the above code should work.</p><p>I should place my Gameobjects on top of the terrain, just like 3dMarker, based on their Longitude / Latitude.<br />I gave a look to the 3dMarker function to do this, but I could&#039;nt understand the right way...</p>]]></description>
			<author><![CDATA[null@example.com (danielesuppo)]]></author>
			<pubDate>Sat, 27 Apr 2019 12:42:56 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4830#p4830</guid>
		</item>
		<item>
			<title><![CDATA[Re: Elevation is wrong]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4828#p4828</link>
			<description><![CDATA[<p>Hello.</p><p>GetUnscaledElevation requires a point in the scene relative to the top left corner of the map.<br />The right way:<br /></p><div class="codebox"><pre><code>float el = OnlineMapsElevationManagerBase.GetUnscaledElevation(p.x, p.z, tlx, tly, brx, bry);</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Sat, 27 Apr 2019 11:57:48 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4828#p4828</guid>
		</item>
		<item>
			<title><![CDATA[Elevation is wrong]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4824#p4824</link>
			<description><![CDATA[<p>Hello,<br />I should put some Gameobjects at real positions, longitude, latitude and altitude (in meters).</p><p>To do this, I&#039;m using your suggested code:</p><p> public static Vector3 GetWorldPositionWithAltitude(double longitude, double latitude, float elevation)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; double tlx, tly, brx, bry;<br />&nbsp; &nbsp; &nbsp; &nbsp; OnlineMaps.instance.GetCorners(out tlx, out tly, out brx, out bry);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; Vector3 p = OnlineMapsTileSetControl.instance.GetWorldPositionWithElevation(longitude, latitude, tlx, tly, brx, bry);<br />&nbsp; &nbsp; &nbsp; &nbsp; float el = OnlineMapsElevationManagerBase.GetUnscaledElevation(longitude, latitude, tlx, tly, brx, bry);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; float yOff = elevation - el;<br />&nbsp; &nbsp; &nbsp; &nbsp; yOff *= OnlineMapsElevationManagerBase.GetBestElevationYScale(tlx, tly, brx, bry);<br />&nbsp; &nbsp; &nbsp; &nbsp; yOff *= OnlineMaps.instance.transform.localScale.x;<br />&nbsp; &nbsp; &nbsp; &nbsp; p.y += yOff;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; return p;<br />&nbsp; &nbsp; }</p><p>Unfortunately the Gameobjects seem to be placed at a wrong height: someone is more or less right (on the surface), but most of them are a lot under or over the surface.<br />I&#039;ve tried with Mapbox, ArcGis and Bing elevation, but with all of them I get the same result.</p><p>I&#039;d be glad for your help!<br />Thanks!</p>]]></description>
			<author><![CDATA[null@example.com (danielesuppo)]]></author>
			<pubDate>Sat, 27 Apr 2019 00:29:51 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4824#p4824</guid>
		</item>
	</channel>
</rss>
