<?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 — Orbit rotation camera.]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=2045</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=2045&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Orbit rotation camera..]]></description>
		<lastBuildDate>Fri, 07 Oct 2022 22:16:22 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Orbit rotation camera.]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8646#p8646</link>
			<description><![CDATA[<p>Exactly ! Perfect ! Thanks Alex! Thank you</p>]]></description>
			<author><![CDATA[null@example.com (LazzLab)]]></author>
			<pubDate>Fri, 07 Oct 2022 22:16:22 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8646#p8646</guid>
		</item>
		<item>
			<title><![CDATA[Re: Orbit rotation camera.]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8645#p8645</link>
			<description><![CDATA[<p>Ahhh, I get it.<br />In this case, everything is much easier:<br /></p><div class="codebox"><pre><code>using UnityEngine;

namespace InfinityCode.OnlineMapsSupport
{
    public class RotateMap : MonoBehaviour
    {
        public OnlineMapsCameraOrbit cameraOrbit;
        public float duration = 3;
        private int direction;

        private void OnGUI()
        {
            if (GUILayout.Button(&quot;Left&quot;)) direction = 1;
            if (GUILayout.Button(&quot;Right&quot;)) direction = -1;
            if (GUILayout.Button(&quot;Stop&quot;)) direction = 0;
        }

        private void Update()
        {
            if (direction == 0) return;

            cameraOrbit.rotation.y += 360 * Time.deltaTime / duration * direction;
        }
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 07 Oct 2022 21:44:20 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8645#p8645</guid>
		</item>
		<item>
			<title><![CDATA[Re: Orbit rotation camera.]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8644#p8644</link>
			<description><![CDATA[<p>With LearpAngle the camera will always stop at zero (North). It has to keep turning and always in a direction that I choose. As you suggest, if I start from the west it goes north clockwise and stops. If I start from the east it goes north counterclockwise and stops. I want to choose which direction to turn and stop it when I want. The &quot;narrator&quot; will read a text (story = time) while the camera orbits around a marker and at the end of the (story = time) the animation of the orbiting camera stops.</p>]]></description>
			<author><![CDATA[null@example.com (LazzLab)]]></author>
			<pubDate>Fri, 07 Oct 2022 19:10:06 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8644#p8644</guid>
		</item>
		<item>
			<title><![CDATA[Re: Orbit rotation camera.]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8643#p8643</link>
			<description><![CDATA[<p>You wrote this code based on ResetCameraRotationExample, right?!<br />Try replacing:<br /></p><div class="codebox"><pre><code>cameraOrbit.rotation.y = Mathf.Lerp(camY, -360 * 2, f);     </code></pre></div><p>to<br /></p><div class="codebox"><pre><code>cameraOrbit.rotation.y = Mathf.LerpAngle(camY, 0, f);</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 07 Oct 2022 13:57:57 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8643#p8643</guid>
		</item>
		<item>
			<title><![CDATA[Re: Orbit rotation camera.]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8642#p8642</link>
			<description><![CDATA[<p>I am working on this:</p><p>public float animationTime = 3;&nbsp; &nbsp; <br />&nbsp; &nbsp; public AnimationCurve animationCurve = AnimationCurve.EaseInOut(0, 0, 1, 1);<br />&nbsp; &nbsp; private float time;<br />&nbsp; &nbsp; private bool isReset;&nbsp; &nbsp; <br />&nbsp; &nbsp; private float camY;<br />&nbsp; &nbsp; private OnlineMapsCameraOrbit cameraOrbit;</p><p>&nbsp; &nbsp; public void ButtonInteract()<br />&nbsp; &nbsp; {&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; camY = cameraOrbit.rotation.y;<br />&nbsp; &nbsp; &nbsp; &nbsp; isReset = true;&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; private void Start()<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; cameraOrbit = OnlineMapsCameraOrbit.instance;<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; private void Update()<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if (!isReset) return;&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; time += Time.deltaTime;<br />&nbsp; &nbsp; &nbsp; &nbsp; float t = time / animationTime;&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; if (t &gt;= 1)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Reset values<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; time = 0;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; isReset = false;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; t = 1;<br />&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; float f = animationCurve.Evaluate(t);&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; cameraOrbit.rotation.y = Mathf.Lerp(camY, -360 * 2, f);&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; }</p><p>The problem is that in this way I can only do 2 laps and I don&#039;t understand the behavior. I would like to spin the Chamber around its map center.</p>]]></description>
			<author><![CDATA[null@example.com (LazzLab)]]></author>
			<pubDate>Fri, 07 Oct 2022 10:46:19 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8642#p8642</guid>
		</item>
		<item>
			<title><![CDATA[Re: Orbit rotation camera.]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8641#p8641</link>
			<description><![CDATA[<p>Hello.</p><p>Unfortunately, I didn&#039;t understand your question.<br />Please rephrase it.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 07 Oct 2022 10:22:43 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8641#p8641</guid>
		</item>
		<item>
			<title><![CDATA[Orbit rotation camera.]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8640#p8640</link>
			<description><![CDATA[<p>Hi Alex. <br />An orbital rotation of the chamber is possible with speed and direction to infinity?<br />I tried with OnlineMapsCameraOrbit.instance cameraOrbit.rotation.y = float * Time.deltaTime but it doesn&#039;t work.<br />Any suggestions? Cheers</p>]]></description>
			<author><![CDATA[null@example.com (LazzLab)]]></author>
			<pubDate>Fri, 07 Oct 2022 09:54:51 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8640#p8640</guid>
		</item>
	</channel>
</rss>
