<?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 OnlineMapsDrawingRect]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=2280</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=2280&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Rotate OnlineMapsDrawingRect.]]></description>
		<lastBuildDate>Fri, 27 Dec 2024 13:33:25 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Rotate OnlineMapsDrawingRect]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9746#p9746</link>
			<description><![CDATA[<p>@savvas_6 Thanks. This works for me.</p>]]></description>
			<author><![CDATA[null@example.com (A1)]]></author>
			<pubDate>Fri, 27 Dec 2024 13:33:25 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9746#p9746</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rotate OnlineMapsDrawingRect]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9625#p9625</link>
			<description><![CDATA[<p>Hi A1. </p><p>Try the following code to rotate the Line.</p><div class="codebox"><pre><code>using System.Collections.Generic;
using UnityEngine;

public class LineRotator
{
    public static void RotateLine(OnlineMapsDrawingLine line, Vector2 pivot, float angleDegrees)
    {
        // Convert the rotation angle from degrees to radians
        float angleRadians = angleDegrees * Mathf.Deg2Rad;

        // Get the list of original points from the line
        List&lt;Vector2&gt; originalPoints = line.points;

        // Create a list to store the rotated points
        List&lt;Vector2&gt; rotatedPoints = new List&lt;Vector2&gt;();

        // Calculate the sine and cosine of the rotation angle
        float cosTheta = Mathf.Cos(angleRadians);
        float sinTheta = Mathf.Sin(angleRadians);

        // Iterate over each point and apply the rotation
        foreach (Vector2 point in originalPoints)
        {
            // Translate the point to the origin (pivot as the origin)
            float translatedX = point.x - pivot.x;
            float translatedY = point.y - pivot.y;

            // Apply the rotation matrix
            float rotatedX = translatedX * cosTheta - translatedY * sinTheta;
            float rotatedY = translatedX * sinTheta + translatedY * cosTheta;

            // Translate the point back
            rotatedX += pivot.x;
            rotatedY += pivot.y;

            // Add the rotated point to the new points list
            rotatedPoints.Add(new Vector2(rotatedX, rotatedY));
        }

        // Update the line&#039;s points with the rotated points
        line.points = rotatedPoints;

        // Refresh the map to reflect the changes
        OnlineMaps.instance.Redraw();
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (savvas_6)]]></author>
			<pubDate>Fri, 23 Aug 2024 14:09:06 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9625#p9625</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rotate OnlineMapsDrawingRect]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9624#p9624</link>
			<description><![CDATA[<p>I noticed that for OnlineMapsDrawingLine has an option for&nbsp; followRelief = true, which it works great on 3D terrain. </p><p>Is there any possibility to make OnlineMapsDrawingRect and OnlineMapsDrawingPoly follow Relief? <br />I couldn&#039;t find any similar function in API Reference.</p><p>thanks</p>]]></description>
			<author><![CDATA[null@example.com (savvas_6)]]></author>
			<pubDate>Fri, 23 Aug 2024 13:54:10 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9624#p9624</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rotate OnlineMapsDrawingRect]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9623#p9623</link>
			<description><![CDATA[<p>Do you have a function to rotate clockwise a OnlineMapsDrawingPoly ?</p>]]></description>
			<author><![CDATA[null@example.com (A1)]]></author>
			<pubDate>Fri, 23 Aug 2024 09:16:00 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9623#p9623</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rotate OnlineMapsDrawingRect]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9566#p9566</link>
			<description><![CDATA[<p>Thank you Alex.</p>]]></description>
			<author><![CDATA[null@example.com (savvas_6)]]></author>
			<pubDate>Wed, 12 Jun 2024 13:36:07 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9566#p9566</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rotate OnlineMapsDrawingRect]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9565#p9565</link>
			<description><![CDATA[<p>Thank you Alex.</p>]]></description>
			<author><![CDATA[null@example.com (savvas_6)]]></author>
			<pubDate>Wed, 12 Jun 2024 12:42:00 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9565#p9565</guid>
		</item>
		<item>
			<title><![CDATA[Re: Rotate OnlineMapsDrawingRect]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9561#p9561</link>
			<description><![CDATA[<p>Hi. </p><p>No, you can&#039;t rotate the rectangle. Use OnlineMapsDrawingPoly instead.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 12 Jun 2024 09:49:12 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9561#p9561</guid>
		</item>
		<item>
			<title><![CDATA[Rotate OnlineMapsDrawingRect]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9558#p9558</link>
			<description><![CDATA[<p>Hi is there any way to rotate a Rectangle on the map?</p><p>eg. rotate the Rectangle by 45 degrees.</p>]]></description>
			<author><![CDATA[null@example.com (savvas_6)]]></author>
			<pubDate>Tue, 11 Jun 2024 13:19:39 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9558#p9558</guid>
		</item>
	</channel>
</rss>
