<?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 — Get world Y position from real elevation]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=1136</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1136&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Get world Y position from real elevation.]]></description>
		<lastBuildDate>Tue, 07 May 2019 11:54:15 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Get world Y position from real elevation]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4883#p4883</link>
			<description><![CDATA[<p>You are my hero!<br />5 stars for your asset, and 6 stars for your support!<br />Many thanks</p>]]></description>
			<author><![CDATA[null@example.com (danielesuppo)]]></author>
			<pubDate>Tue, 07 May 2019 11:54:15 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4883#p4883</guid>
		</item>
		<item>
			<title><![CDATA[Re: Get world Y position from real elevation]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4880#p4880</link>
			<description><![CDATA[<p>Something like that?<br /></p><div class="codebox"><pre><code>using System;
using UnityEngine;

public class GetWorldPositionWithElevation : MonoBehaviour
{
    public GameObject target;
    public float altitude;
    private float _altitude;

    private void Start()
    {
        OnlineMaps.instance.OnChangePosition += UpdatePositionY;
        OnlineMaps.instance.OnChangeZoom += UpdatePositionY;

        UpdatePositionY();
    }

    private void Update()
    {
        if (Math.Abs(_altitude - altitude) &gt; float.Epsilon) UpdatePositionY();
    }

    private void UpdatePositionY()
    {
        _altitude = altitude;

        if (!OnlineMapsElevationManagerBase.isActive) return;

        Vector3 pos = target.transform.position;
        float v = altitude;
        if (OnlineMapsElevationManagerBase.instance.bottomMode == OnlineMapsElevationBottomMode.minValue) v -= OnlineMapsElevationManagerBase.instance.minValue;
        pos.y = OnlineMapsElevationManagerBase.GetBestElevationYScale() * v;
        target.transform.position = pos;
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 06 May 2019 17:44:37 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4880#p4880</guid>
		</item>
		<item>
			<title><![CDATA[Re: Get world Y position from real elevation]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4879#p4879</link>
			<description><![CDATA[<p>Thank-you for your reply,<br />I&#039;ll try to rephrase:<br />I think that OnlineMapsElevationManagerBase.GetElevation use the longitude-latitude of a point to retrieve its elevation from the loaded map (but maybe I&#039;m wrong).<br />Let&#039;s say that I&#039;d like to place a plane over the map, and I know that the plane is flying at the altitude of 350 meters.<br />I don&#039;t care about its longitude-latitude, and I don&#039;t care about the underlying map 3d model, because the elevation accuracy of the map 3d model change on the basis of the zoom (the more is zoomed, the more the altitude is accurate, at least with bing, mapbox, etc, from what I can see).<br />So, maybe my underlying map is not so accurate, but I&#039;d like to place my plane at its real height.<br />It should be easy to place my plane at 350m if the altitude of the map 3d model was the real one in world space, but the lowest elevation of the map is always at 0 (with BottomMode = minValue).<br />I hope I explained myself better.</p>]]></description>
			<author><![CDATA[null@example.com (danielesuppo)]]></author>
			<pubDate>Mon, 06 May 2019 14:19:39 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4879#p4879</guid>
		</item>
		<item>
			<title><![CDATA[Re: Get world Y position from real elevation]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4878#p4878</link>
			<description><![CDATA[<p>Hello.</p><p>Unfortunately, I did not understand your question.</p><p>Most likely you are looking for something from this:<br />OnlineMapsMarker3D.altitude<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsMarker3D.html#ad57c0304a44d03ac16551c5cd33d18f5">http://infinity-code.com/doxygen/online … 5cd33d18f5</a><br />OnlineMapsElevationManagerBase.GetElevation<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsElevationManagerBase.html#a760ac2ee70a31e922011b2a7c3d53b97">http://infinity-code.com/doxygen/online … a7c3d53b97</a><br />OnlineMapsControlBaseDynamicMesh.GetWorldPositionWithElevation<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsControlBaseDynamicMesh.html#aae41909f01e255df50411eaeedf61eb0">http://infinity-code.com/doxygen/online … aeedf61eb0</a></p><p>Or is it from your topic:<br /><a href="http://forum.infinity-code.com/viewtopic.php?pid=4824#p4824">http://forum.infinity-code.com/viewtopi … 4824#p4824</a></p><p>If you are looking for something else, please rephrase your question.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 06 May 2019 12:29:19 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4878#p4878</guid>
		</item>
		<item>
			<title><![CDATA[Get world Y position from real elevation]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4877#p4877</link>
			<description><![CDATA[<p>Hello, I should place some objects at their real height (not on the top of the map mesh, that can be not so much reliable).<br />So, I would&#039;nt care if they them don&#039;t touch the map.<br />I know their real elevation, but looking at OnlineMaps api I can&#039;t find a function to get the world Y position from elevation (maybe I didn&#039;t look so well...).<br />Which could be the best approach to do this?<br />Many thanks!</p>]]></description>
			<author><![CDATA[null@example.com (danielesuppo)]]></author>
			<pubDate>Mon, 06 May 2019 11:13:37 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4877#p4877</guid>
		</item>
	</channel>
</rss>
