<?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 — Rotate Map with gyroscope]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=768</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=768&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Rotate Map with gyroscope.]]></description>
		<lastBuildDate>Sun, 11 Feb 2018 11:17:47 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Rotate Map with gyroscope]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3370#p3370</link>
			<description><![CDATA[<p>If you use Allow Camera Control, example:<br /><a href="http://infinity-code.com/atlas/online-maps/pages/RotateCameraByCompassExample.html">http://infinity-code.com/atlas/online-m … ample.html</a></p><p>Otherwise just set<br /></p><div class="codebox"><pre><code>containerTransform.rotation = Quaternion.Euler (0, f, 0);</code></pre></div><p>where f is the value from the example above.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Sun, 11 Feb 2018 11:17:47 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3370#p3370</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rotate Map with gyroscope]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3367#p3367</link>
			<description><![CDATA[<div class="quotebox"><cite>Alex Vertax wrote:</cite><blockquote><p>To do this, rotate the map only using the y-axis.</p><p>Actually you can do it using Allow Camera Control too.<br />Just set Camera Rotation Speed X - 0.</p></blockquote></div><br /><p>Thanks, that worked without using the gyroscope or the compass.</p><p>But I wanted to use maybe the compass to rotate. How can I do it with the compass then?</p>]]></description>
			<author><![CDATA[null@example.com (geral)]]></author>
			<pubDate>Sat, 10 Feb 2018 19:50:18 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3367#p3367</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rotate Map with gyroscope]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3357#p3357</link>
			<description><![CDATA[<p>To do this, rotate the map only using the y-axis.</p><p>Actually you can do it using Allow Camera Control too.<br />Just set Camera Rotation Speed X - 0.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 09 Feb 2018 17:48:15 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3357#p3357</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rotate Map with gyroscope]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3355#p3355</link>
			<description><![CDATA[<p>Thanks, but the thing is i have a kind of a 3D showing map. I rotate the camera to fit a 3D perspective like shown in the image attached.</p><p>I can i use the gyro or the compass to rotate the camera and still maintain the 3D perspective?</p>]]></description>
			<author><![CDATA[null@example.com (geral)]]></author>
			<pubDate>Fri, 09 Feb 2018 16:31:32 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3355#p3355</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rotate Map with gyroscope]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3347#p3347</link>
			<description><![CDATA[<p>Something like that (in the general case):<br /></p><div class="codebox"><pre><code>using UnityEngine;

public class RotateMapUsingGyro:MonoBehaviour
{
    private OnlineMaps map;
    private Transform containerTransform;

    private void Start()
    {
        Input.gyro.enabled = true;
        map = OnlineMaps.instance;

        // Wrap the map in a new GameObject to rotate around the center.
        GameObject container = new GameObject(&quot;Map Container&quot;);
        containerTransform = container.transform;
        containerTransform.position = map.transform.position + new Vector3(map.tilesetSize.x / -2, 0, map.tilesetSize.y / 2);
        map.transform.parent = containerTransform;
    }

    private void Update()
    {
        Vector3 rate = Input.gyro.rotationRate;
        containerTransform.Rotate(rate);
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 09 Feb 2018 11:37:45 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3347#p3347</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rotate Map with gyroscope]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3343#p3343</link>
			<description><![CDATA[<p>Hi again</p><p>I&#039;ve tried to follow your instructions, but im not able to make it... i think i&#039;m confusing all.</p><p>Please can you make an example how to rotate map via gyro without user control? whith the camera fixed...</p><p>Thanks you</p>]]></description>
			<author><![CDATA[null@example.com (geral)]]></author>
			<pubDate>Thu, 08 Feb 2018 23:30:04 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3343#p3343</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rotate Map with gyroscope]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3328#p3328</link>
			<description><![CDATA[<p>How to use a gyroscope:<br /><a href="http://infinity-code.com/atlas/online-maps/pages/ChangePositionUsingGyro.html">http://infinity-code.com/atlas/online-m … gGyro.html</a><br /><a href="https://docs.unity3d.com/ScriptReference/Gyroscope.html">https://docs.unity3d.com/ScriptReference/Gyroscope.html</a></p><p>How to rotate the point (camera) around a point (center):<br /><a href="https://stackoverflow.com/a/13695630">https://stackoverflow.com/a/13695630</a></p><p>The current rotation implementation can be found in OnlineMapsControlBase3D.UpdateCameraPosition.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 05 Feb 2018 11:19:47 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3328#p3328</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rotate Map with gyroscope]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3325#p3325</link>
			<description><![CDATA[<p>Can you make a example how to do it with the device gyroscope?</p>]]></description>
			<author><![CDATA[null@example.com (geral)]]></author>
			<pubDate>Sun, 04 Feb 2018 19:34:35 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3325#p3325</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rotate Map with gyroscope]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3324#p3324</link>
			<description><![CDATA[<p>Hello.</p><p>Yes, of course it&#039;s possible.<br />If you are using Camera Control - OFF, you can control the camera as you want.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Sun, 04 Feb 2018 14:00:59 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3324#p3324</guid>
		</item>
		<item>
			<title><![CDATA[Rotate Map with gyroscope]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3322#p3322</link>
			<description><![CDATA[<p>Hi </p><p>I&#039;m trying to rotate the map with compass, without user control ON (Camera control), and rotate it around the user GPS location.</p><p>The examples only work with Camera control ON...</p><p>Is it possible?</p><p>Best regards</p>]]></description>
			<author><![CDATA[null@example.com (geral)]]></author>
			<pubDate>Sun, 04 Feb 2018 12:07:37 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3322#p3322</guid>
		</item>
	</channel>
</rss>
