<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Manage height of 3D Marker]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=73&amp;type=atom" />
	<updated>2016-02-01T17:19:16Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=73</id>
		<entry>
			<title type="html"><![CDATA[Re: Manage height of 3D Marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=315#p315" />
			<content type="html"><![CDATA[<p>Hello.</p><p>In «Start» it will always be zero, because Online Maps need to get data from Bing Maps Elevation API, and it takes time.<br />This script uses «LateUpdate» to prevent problems with the script execution order. <br />Theoretically it can be that this script executed earlier than control, and will be calculated elevation data for the previous frame.<br />To use it in «Update», set up «Edit / Project Settings / Script Execution Order».</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2016-02-01T17:19:16Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=315#p315</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Manage height of 3D Marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=314#p314" />
			<content type="html"><![CDATA[<p>Thank you it works great.<br />But is there a way to manage the elevation on Start and not on LateUpdate ?</p><p>When I put the code on late Update the elevation is set at each frame and it works.<br />But If I try to set the elevation juste once on Start it doesn&#039;t work (the elevation is set but it&#039;s automatically reset to 0 at each frame.</p><p>Thank you in advance</p>]]></content>
			<author>
				<name><![CDATA[Pentos]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=73</uri>
			</author>
			<updated>2016-02-01T16:56:07Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=314#p314</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Manage height of 3D Marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=289#p289" />
			<content type="html"><![CDATA[<p>The script and the screenshot attached.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2016-01-18T16:31:13Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=289#p289</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Manage height of 3D Marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=288#p288" />
			<content type="html"><![CDATA[<p>Use elevation is enabled.<br />Here is my code :</p><div class="codebox"><pre><code>Vector2 markerPosition = new Vector2(x,y);
marker3D = control.AddMarker3D(markerPosition, marker);
float originalScale = 1 &lt;&lt; defaultZoom;
float currentScale = 1 &lt;&lt; OnlineMaps.instance.zoom;
marker3D.scale = currentScale / originalScale;
Vector3 pos = marker3D.instance.transform.position;
Vector2 topLeftPosition = OnlineMaps.instance.topLeftPosition;
Vector2 bottomRightPosition = OnlineMaps.instance.bottomRightPosition;
pos.y = 8 * OnlineMapsTileSetControl.instance.GetBestElevationYScale(topLeftPosition, bottomRightPosition) * OnlineMapsTileSetControl.instance.elevationScale;
marker3D.instance.transform.position = pos;</code></pre></div><p>If I Debug.Log(pos) I get a non null value for pos.y but in the inspector the y value stay to 0.</p><p>Thanks again.</p>]]></content>
			<author>
				<name><![CDATA[Pentos]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=73</uri>
			</author>
			<updated>2016-01-18T15:44:05Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=288#p288</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Manage height of 3D Marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=287#p287" />
			<content type="html"><![CDATA[<p>First of all, make sure you use «Use Elevation - ON».<br />If the problem persists, please attach your script, I&#039;ll check it.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2016-01-18T15:30:09Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=287#p287</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Manage height of 3D Marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=286#p286" />
			<content type="html"><![CDATA[<p>Thank you for you answer.<br />I tried your example but my marker y position stay at 0.<br />Even if I tried to increase it manually in the inspector it always return to 0.</p>]]></content>
			<author>
				<name><![CDATA[Pentos]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=73</uri>
			</author>
			<updated>2016-01-18T14:47:06Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=286#p286</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Manage height of 3D Marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=285#p285" />
			<content type="html"><![CDATA[<p>Example:</p><div class="codebox"><pre><code>Vector3 pos = marker3D.instance.transform.position;
Vector2 topLeftPosition = OnlineMaps.instance.topLeftPosition;
Vector2 bottomRightPosition = OnlineMaps.instance.bottomRightPosition;
pos.y = markerAltitude * OnlineMapsTileSetControl.instance.GetBestElevationYScale(topLeftPosition, bottomRightPosition) * OnlineMapsTileSetControl.instance.elevationScale;
marker3D.instance.transform.position = pos;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2016-01-18T11:59:35Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=285#p285</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Manage height of 3D Marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=284#p284" />
			<content type="html"><![CDATA[<p>Yes i&#039;m asking about elevation of 3d marker.<br />To instantiate a 3d marker I use :</p><div class="codebox"><pre><code>Vector2 markerPosition = new Vector2(x,y);
marker3D = control.AddMarker3D(markerPosition, marker);</code></pre></div><p>So I use the couple latitude/longitude to instatiante the marker.<br />I would like to be able to also set the elevation.</p><p>Is OnlineMapsTileSetControl the right way?</p><p>Thank you.</p>]]></content>
			<author>
				<name><![CDATA[Pentos]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=73</uri>
			</author>
			<updated>2016-01-18T11:48:09Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=284#p284</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Manage height of 3D Marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=283#p283" />
			<content type="html"><![CDATA[<p>Hello.</p><p>You ask about the marker elevation, right?<br />There are many ways to do it.</p><p>OnlineMapsTileSetControl.GetElevationValue<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsTileSetControl.html#ade9262f27307f9c6417bcadca7e4a852">http://infinity-code.com/doxygen/online … dca7e4a852</a></p><p>OnlineMapsGetElevation.Find<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsGetElevation.html#ab554a14349595ce6d4502b1b2ee59c64">http://infinity-code.com/doxygen/online … 1b2ee59c64</a></p><p>One more way in «Aircraft.cs».</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2016-01-18T10:35:44Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=283#p283</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Manage height of 3D Marker]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=282#p282" />
			<content type="html"><![CDATA[<p>Hello,</p><p>How can I manage the height of 3d marker? the poisition of the marker is only set by latitude and longitude.<br />Could you please indicate me the good way to manage the height. I wouldn&#039;t make bad modification on the 3d marker code.</p><p>Thanks you.</p>]]></content>
			<author>
				<name><![CDATA[Pentos]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=73</uri>
			</author>
			<updated>2016-01-18T10:21:15Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=282#p282</id>
		</entry>
</feed>
