<?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 — Positioning Hot Spots by location]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=1451</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1451&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Positioning Hot Spots by location.]]></description>
		<lastBuildDate>Thu, 18 Jun 2020 17:55:01 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Positioning Hot Spots by location]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=6388#p6388</link>
			<description><![CDATA[<p>Hello.</p><p>Unfortunately, I did not understand the description of your problem.<br />Here is the video that I have when using this script:<br /><a href="https://www.dropbox.com/s/e5tc5qm7em0ub6a/ScreenRecorderProject105.mp4?dl=0">https://www.dropbox.com/s/e5tc5qm7em0ub … 5.mp4?dl=0</a><br />Please explain your problem in more detail.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 18 Jun 2020 17:55:01 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=6388#p6388</guid>
		</item>
		<item>
			<title><![CDATA[Re: Positioning Hot Spots by location]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=6387#p6387</link>
			<description><![CDATA[<p>hi i put it in the code but the hotspot is following the camera wherever i go. i want the the hotspot stay at it&#039;s location. how can i do that?</p>]]></description>
			<author><![CDATA[null@example.com (gbo10001)]]></author>
			<pubDate>Thu, 18 Jun 2020 16:06:25 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=6387#p6387</guid>
		</item>
		<item>
			<title><![CDATA[Positioning Hot Spots by location]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5983#p5983</link>
			<description><![CDATA[<p><span class="postimg"><img src="https://infinity-code.com/sites/default/files/styles/full_post/public/images/news/2020.02.17%20-%20uPano%20-%20Positioning%20Hot%20Spots%20by%20location.jpg?itok=Dri36EyM" alt="Positioning Hot Spots by location" /></span></p><p>When you have locations where the current and target panoramas are located, using uPano API you can convert the location to pan and tilt.</p><p>Example:<br /></p><div class="codebox"><pre><code>using System;
using InfinityCode.uPano;
using InfinityCode.uPano.HotSpots;
using UnityEngine;

public class CreateHotSpotByLocation : MonoBehaviour
{
    public double panoLongitude;
    public double panoLatitude;
    public float panoAltitude;

    public double hotSpotLongitude;
    public double hotSpotLatitude;
    public float hotSpotAltitude;

    public GameObject hotSpotPrefab;
    private HotSpot hotSpot;

    private void Start()
    {
        HotSpotManager hotSpotManager = GetComponent&lt;HotSpotManager&gt;();
        hotSpot = hotSpotManager.Create(0, 0, hotSpotPrefab);
        UpdatePosition(hotSpot, hotSpotLongitude, hotSpotLatitude, hotSpotAltitude);
    }

    private void UpdatePosition(HotSpot hotSpot, double longitude, double latitude, float altitude)
    {
        double tx1, tx2, ty1, ty2;
        GeoHelper.CoordinatesToTile(panoLongitude, panoLatitude, 20, out tx1, out ty1);
        GeoHelper.CoordinatesToTile(longitude, latitude, 20, out tx2, out ty2);

        double distance = GeoHelper.Distance(panoLongitude, panoLatitude, longitude, latitude) * 1000;

        float pan = 90 + (float) MathHelper.Angle2D(tx1, ty1, tx2, ty2);
        float tilt = 0;

        float offset = altitude - panoAltitude;
        if (Math.Abs(offset) &gt; float.Epsilon)
        {
            tilt = (float)Math.Atan2(offset, distance) * Mathf.Rad2Deg;
        }

        hotSpot.SetPanTilt(pan, tilt);
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 17 Feb 2020 09:45:29 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5983#p5983</guid>
		</item>
	</channel>
</rss>
