<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: yang rocky</title>
    <description>The latest articles on DEV Community by yang rocky (@yang_rocky_2ac2041abd9a8c).</description>
    <link>https://dev.to/yang_rocky_2ac2041abd9a8c</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4255714%2F57dc4e74-7c41-4599-b449-e3f8fe4b80f6.png</url>
      <title>DEV Community: yang rocky</title>
      <link>https://dev.to/yang_rocky_2ac2041abd9a8c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yang_rocky_2ac2041abd9a8c"/>
    <language>en</language>
    <item>
      <title>Why Mercator Maps Lie: Building 84 Equal-Area 3D Countries &amp; 247 Orthographic Models in Vanilla JS</title>
      <dc:creator>yang rocky</dc:creator>
      <pubDate>Fri, 20 Nov 2026 12:49:07 +0000</pubDate>
      <link>https://dev.to/yang_rocky_2ac2041abd9a8c/why-mercator-maps-lie-building-84-equal-area-3d-countries-247-orthographic-models-in-vanilla-js-536f</link>
      <guid>https://dev.to/yang_rocky_2ac2041abd9a8c/why-mercator-maps-lie-building-84-equal-area-3d-countries-247-orthographic-models-in-vanilla-js-536f</guid>
      <description>&lt;p&gt;Most online size comparison games rely on flat black silhouettes—and when they compare countries, they often inherit Web Mercator distortion that makes Greenland look as large as Africa (even though Africa is &lt;strong&gt;14× larger&lt;/strong&gt; in true surface area).&lt;/p&gt;

&lt;p&gt;Today I launched &lt;strong&gt;&lt;a href="https://playsizecomparison.com/" rel="noopener noreferrer"&gt;Play Size Comparison&lt;/a&gt;&lt;/strong&gt;, a free browser-based 3D visual scale estimation game and 1:1 visual reference studio built with zero-dependency vanilla JavaScript under a strict 100 KB script budget.&lt;/p&gt;

&lt;p&gt;Here are the four engineering problems we solved to make spatial scale feel mathematically honest and genuinely addictive.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Zero-Perspective-Distortion 3D Models (247 Verified Assets)
&lt;/h2&gt;

&lt;p&gt;When you compare a bull moose next to a school bus or Saturn next to Earth, perspective foreshortening ruins accuracy—objects closer to a perspective camera look artificially larger.&lt;/p&gt;

&lt;p&gt;To keep every visual comparison geometrically fair:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;163 studio-rendered 0°-orthographic 3D models&lt;/strong&gt; (&lt;code&gt;.webp&lt;/code&gt; over CDN) spanning everyday objects, wildlife, dinosaurs, world landmarks, vehicles, rockets, and NASA planets, each tagged with an explicit verified measurement axis (&lt;code&gt;height&lt;/code&gt; or &lt;code&gt;width&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;84 extruded 3D countries, islands, and US states&lt;/strong&gt; rendered from Natural Earth public-domain polygon data using a centered &lt;strong&gt;Lambert Azimuthal Equal-Area (LAEA)&lt;/strong&gt; projection—eliminating high-latitude Mercator inflation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can test the equal-area projection directly in the dedicated &lt;a href="https://playsizecomparison.com/country-size-comparison-game" rel="noopener noreferrer"&gt;3D Country Size Comparison Game&lt;/a&gt; or read our breakdown of &lt;a href="https://playsizecomparison.com/guides/mercator-projection-country-size-myths" rel="noopener noreferrer"&gt;10 Mercator projection myths&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Fill-Ratio Math Compensation for Irregular Map Shapes
&lt;/h2&gt;

&lt;p&gt;If you scale two country bounding boxes purely by height or width, a long thin country like Chile or Japan looks wildly mis-scaled next to a compact polygon like France.&lt;/p&gt;

&lt;p&gt;We compute each country's true solid land pixel coverage ratio (&lt;code&gt;fillRatio&lt;/code&gt;) on the top orthographic face of its extruded 3D relief and normalize display scaling by &lt;code&gt;sqrt(area / fillRatio)&lt;/code&gt; so that &lt;strong&gt;1 square pixel on screen represents the exact same number of square kilometers&lt;/strong&gt; for both landmasses.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Symmetric Logarithmic Scoring &amp;amp; "Boss Blind" Calibration
&lt;/h2&gt;

&lt;p&gt;Linear percentage error punishes over-estimates much harder than under-estimates (&lt;code&gt;2×&lt;/code&gt; too big is &lt;code&gt;+100%&lt;/code&gt; error, while &lt;code&gt;0.5×&lt;/code&gt; too small is only &lt;code&gt;-50%&lt;/code&gt;). Instead, we use symmetric logarithmic error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;ratio&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;guess&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1e-6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;actual&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1e-6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ratio&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Under this curve, guessing &lt;strong&gt;2× too large&lt;/strong&gt; and &lt;strong&gt;0.5× too small&lt;/strong&gt; earn the exact same score (&lt;code&gt;50/100&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;To stop trivia pros from gaming the slider by memorizing meter numbers, we added a &lt;strong&gt;Blind Eye&lt;/strong&gt; toggle—and automatically trigger &lt;strong&gt;Round 5 Boss Blind&lt;/strong&gt; during the synchronized Daily 5 Expedition (00:00 UTC), hiding all live meter/km² readouts until you lock in your visual estimate.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Hitting CLS = 0.000 &amp;amp; Shareable 1:1 Deep-Links
&lt;/h2&gt;

&lt;p&gt;Because the interactive stage hydrates client-side inside an SSR shell, we reserved exact responsive container heights (&lt;code&gt;min-height: 556px&lt;/code&gt; desktop / &lt;code&gt;516px&lt;/code&gt; mobile), moved &lt;code&gt;&amp;lt;meta charset="utf-8"&amp;gt;&lt;/code&gt; to byte 36, and deferred Google Fonts—measuring &lt;strong&gt;&lt;code&gt;CLS = 0.000&lt;/code&gt;&lt;/strong&gt; live via &lt;code&gt;PerformanceObserver&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Every pair in our 247-model catalog (13,590 valid pairs) can also be linked directly in 1:1 Showroom mode via URL query params:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://playsizecomparison.com/?compare=adult-human,alaskan-moose" rel="noopener noreferrer"&gt;Alaskan Bull Moose vs. Adult Human&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://playsizecomparison.com/?compare=school-bus,blue-whale" rel="noopener noreferrer"&gt;Blue Whale vs. School Bus&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://playsizecomparison.com/size-comparison-game-unlimited" rel="noopener noreferrer"&gt;Play Unlimited Mode&lt;/a&gt; | &lt;a href="https://playsizecomparison.com/planet-size-comparison-game" rel="noopener noreferrer"&gt;Planet Size Comparison&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Would love feedback from fellow web &amp;amp; game devs on the log-scale feel and Round 5 Boss Blind difficulty!&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>gajwebdev</category>
      <category>avascript</category>
      <category>medev</category>
    </item>
  </channel>
</rss>
