<?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 — The scale of the canvas in the "World Space" mode as in the "Overlay"]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=877</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=877&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in The scale of the canvas in the "World Space" mode as in the "Overlay".]]></description>
		<lastBuildDate>Sat, 06 Oct 2018 18:31:39 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: The scale of the canvas in the "World Space" mode as in the "Overlay"]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4014#p4014</link>
			<description><![CDATA[<p>Excellent. Many thanks!)</p>]]></description>
			<author><![CDATA[null@example.com (NovaEiz)]]></author>
			<pubDate>Sat, 06 Oct 2018 18:31:39 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4014#p4014</guid>
		</item>
		<item>
			<title><![CDATA[Re: The scale of the canvas in the "World Space" mode as in the "Overlay"]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4013#p4013</link>
			<description><![CDATA[<p>I think I understand what you are trying to do.</p><p>Unity has a vertical field of view.<br />So let&#039;s supose that for Screen Height is 1080, the scale should be equal to 1.<br />When starting the application and resizing the screen, set scale = 1080 / New Screen Height.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Sat, 06 Oct 2018 17:09:29 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4013#p4013</guid>
		</item>
		<item>
			<title><![CDATA[Re: The scale of the canvas in the "World Space" mode as in the "Overlay"]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4012#p4012</link>
			<description><![CDATA[<p>Sent a project to you in PM</p>]]></description>
			<author><![CDATA[null@example.com (NovaEiz)]]></author>
			<pubDate>Sat, 06 Oct 2018 16:30:00 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4012#p4012</guid>
		</item>
		<item>
			<title><![CDATA[Re: The scale of the canvas in the "World Space" mode as in the "Overlay"]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4011#p4011</link>
			<description><![CDATA[<p>At a screen resolution of 1080x1920, object number 2 needs to set the scale to 0.6, and then both objects will have the same size for the UI canvas</p>]]></description>
			<author><![CDATA[null@example.com (NovaEiz)]]></author>
			<pubDate>Sat, 06 Oct 2018 16:27:48 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4011#p4011</guid>
		</item>
		<item>
			<title><![CDATA[Re: The scale of the canvas in the "World Space" mode as in the "Overlay"]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4010#p4010</link>
			<description><![CDATA[<p>The project has a CanvasMapObj prefab, there is a picture in it.<br />Copies of this prefab: # 1 is in the canvas, and # 2 is inside the card.</p><p><span style="color: #FF0000">URL removed. Please do not post asset on the forum.</span></p>]]></description>
			<author><![CDATA[null@example.com (NovaEiz)]]></author>
			<pubDate>Sat, 06 Oct 2018 16:24:55 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4010#p4010</guid>
		</item>
		<item>
			<title><![CDATA[Re: The scale of the canvas in the "World Space" mode as in the "Overlay"]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3991#p3991</link>
			<description><![CDATA[<p>Please send to support (support@infinity-code.com) a scene (as a package), that shows the problem.<br />I will check it out and give you advice how to fix this.</p><p>I do not need your working project. <br />I need ANY scene where I can check it out.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 03 Oct 2018 19:02:04 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3991#p3991</guid>
		</item>
		<item>
			<title><![CDATA[Re: The scale of the canvas in the "World Space" mode as in the "Overlay"]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3990#p3990</link>
			<description><![CDATA[<p>I return to this issue. This does not work.</p><p>Each zoom has a different scale. I need the object on which the &quot;Canvas&quot; with the &quot;World Space&quot; mode, on any zoom, be of such a scale that it is exactly the same size as the object, but is in the Canvas hierarchy.<br />In NGUI, this is done using the ScreenHeight / ScreenWidth coefficient. But the map also takes into account &quot;Distance a camera&quot;.</p><p>Help!)</p>]]></description>
			<author><![CDATA[null@example.com (NovaEiz)]]></author>
			<pubDate>Tue, 02 Oct 2018 15:15:02 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3990#p3990</guid>
		</item>
		<item>
			<title><![CDATA[Re: The scale of the canvas in the "World Space" mode as in the "Overlay"]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3806#p3806</link>
			<description><![CDATA[<p>In the end, we have to multiply the result by 2 more. Thank you!)</p>]]></description>
			<author><![CDATA[null@example.com (NovaEiz)]]></author>
			<pubDate>Tue, 21 Aug 2018 00:11:43 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3806#p3806</guid>
		</item>
		<item>
			<title><![CDATA[Re: The scale of the canvas in the "World Space" mode as in the "Overlay"]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3805#p3805</link>
			<description><![CDATA[<p>[image]<br /><a href="https://pp.userapi.com/c849136/v849136625/57a96/gdW_0Whupgg.jpg">https://pp.userapi.com/c849136/v8491366 … Whupgg.jpg</a><br />[/image]</p><p>There are objects on the map. When the object is beyond the boundaries of sight of the camera, it is attached to the edge of the screen, passing in the Canvas UI.<br />The picture shows that the objects that are visible to the camera are markers on the map and their scale is ~2 times larger than it should be.<br />This screenshot is made at a distance of the camera = 1000, with a screen resolution of 720 x 1480</p>]]></description>
			<author><![CDATA[null@example.com (NovaEiz)]]></author>
			<pubDate>Mon, 20 Aug 2018 19:33:18 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3805#p3805</guid>
		</item>
		<item>
			<title><![CDATA[Re: The scale of the canvas in the "World Space" mode as in the "Overlay"]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3803#p3803</link>
			<description><![CDATA[<p>I tested your code and it works correctly.<br />Except that it returns a negative value.</p><p>Why should it be -40? <br />This can be any value that the marker occupies on the screen when scale = 1.<br />If you move the camera very close to the map, it will show you very big value.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 20 Aug 2018 16:08:03 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3803#p3803</guid>
		</item>
		<item>
			<title><![CDATA[Re: The scale of the canvas in the "World Space" mode as in the "Overlay"]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3802#p3802</link>
			<description><![CDATA[<p>I did this.<br />When the camera is installed at the distance of 1610, the resolution 720х1480, I have to get a result, which is sent to the input(the value markerHeight). I pass 40 and get -77. Must be -40, right?</p><p>What&#039;s wrong?</p><br /><div class="codebox"><pre><code>        public void CalculateScaleByResolution() {
            if (OnlineMaps.instance == null) {
                return;
            }
            float lon = 38;
            float lat = 45;
            int zoom = OnlineMaps.instance.zoom;
            OnlineMaps.instance.projection.CoordinatesToTile(lon, lat, zoom, out double tx, out double ty);
            float markerHeight = JourneyObject.instance.sizeElement;
            double ty2 = ty - markerHeight / 256;

            OnlineMaps.instance.projection.TileToCoordinates(tx, ty2, zoom, out double lon2, out double lat2);

            var res1 = OnlineMapsControlBase.instance.GetScreenPosition(new Vector2(lon, lat));
            var res2 = OnlineMapsControlBase.instance.GetScreenPosition(new Vector2((float)lon2, (float)lat2));

            Debug.Log(&quot;res1 = &quot; + res1);
            Debug.Log(&quot;res2 = &quot; + res2);

            res1 -= res2;
            Debug.Log(&quot;res3 = &quot; + res1);

            var val = markerHeight / res1.y;
            Debug.Log(&quot;val = &quot; + val);
        }</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (NovaEiz)]]></author>
			<pubDate>Mon, 20 Aug 2018 13:27:35 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3802#p3802</guid>
		</item>
		<item>
			<title><![CDATA[Re: The scale of the canvas in the "World Space" mode as in the "Overlay"]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3801#p3801</link>
			<description><![CDATA[<p>Thank you very much!<br />You are a miracle!</p>]]></description>
			<author><![CDATA[null@example.com (NovaEiz)]]></author>
			<pubDate>Mon, 20 Aug 2018 12:04:41 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3801#p3801</guid>
		</item>
		<item>
			<title><![CDATA[Re: The scale of the canvas in the "World Space" mode as in the "Overlay"]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3800#p3800</link>
			<description><![CDATA[<p>1. Get the tile position of the marker.<br />If you use regular markers:<br />OnlineMapsMarkerBase.GetTilePosition<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsMarkerBase.html#a23d0083576dae410a5ff417f668a7e68">http://infinity-code.com/doxygen/online … 7f668a7e68</a><br />If you are using custom marker engine:<br />OnlineMaps.instance.projection.CoordinatesToTile</p><p>2. Subtract from Tile Y the height of the marker texture in pixels divided by 256.<br />double ty2 = ty - markerHeight / 256.</p><p>3. Convert the new tile position to geographical coordinates.<br />OnlineMaps.instance.projection.TileToCoordinates</p><p>4. Convert the original and new coordinates to the screen positions.<br />OnlineMapsControlBase.GetScreenPosition<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsControlBase.html#ae62dc7dc9d365e0fab178fb35214c35b">http://infinity-code.com/doxygen/online … b35214c35b</a></p><p>5. Subtract the second screen position from the first screen position to calculate the screen height of the marker when scale = 1.</p><p>6. Use this value to calculate the required scale.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 20 Aug 2018 11:39:30 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3800#p3800</guid>
		</item>
		<item>
			<title><![CDATA[Re: The scale of the canvas in the "World Space" mode as in the "Overlay"]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3799#p3799</link>
			<description><![CDATA[<p>For &quot;Canvas / Render Mode - World Space&quot; you need to set &quot;scale&quot; in the &quot;transform&quot;</p>]]></description>
			<author><![CDATA[null@example.com (NovaEiz)]]></author>
			<pubDate>Mon, 20 Aug 2018 11:17:41 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3799#p3799</guid>
		</item>
		<item>
			<title><![CDATA[Re: The scale of the canvas in the "World Space" mode as in the "Overlay"]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3798#p3798</link>
			<description><![CDATA[<p>The height of the camera - &quot;Camera Distance&quot; to &quot;OnlineMapsTileSetControl&quot;.<br />Sorry I wasn&#039;t accurate.</p>]]></description>
			<author><![CDATA[null@example.com (NovaEiz)]]></author>
			<pubDate>Mon, 20 Aug 2018 11:16:17 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3798#p3798</guid>
		</item>
	</channel>
</rss>
