<p>Before you can use three.js, you need somewhere to display it. Save the following HTML to a file on your computer, along with a copy of <ahref="http://threejs.org/build/three.js">three.js</a> in the js/ directory, and open it in your browser.</p>
<p>Before you can use three.js, you need somewhere to display it. Save the following HTML to a file on your computer, along with a copy of [link:https://threejs.org/build/three.js three.js] in the js/ directory, and open it in your browser.</p>
<p>These tags control viewport size and scale for mobile browsers (where page content may be rendered at different size than visible viewport).</p>
<p><ahref="https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html">Safari: Using the Viewport</a></p>
<p>[link:https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html Safari: Using the Viewport]</p>
<p><ahref="https://developer.mozilla.org/en/Mobile/Viewport_meta_tag">MDN: Using the viewport meta tag</a></p>
<p>[link:https://developer.mozilla.org/en/Mobile/Viewport_meta_tag MDN: Using the viewport meta tag]</p>
</div>
<h2>How can scene scale be preserved on resize?</h2>
<p>Three.js is published as an npm module, see: <ahref="https://www.npmjs.com/package/three"target="_blank">npm</a>. This means all you need to do to include three.js into your project is run "npm install three"</p>
<p>Three.js is published as an npm module, see: [link:https://www.npmjs.com/package/three npm]. This means all you need to do to include three.js into your project is run "npm install three"</p>
<h2>Importing the module</h2>
<p>Assuming that you're bundling your files with a tool such as <ahref="https://webpack.github.io/"target="_blank">Webpack</a> or <ahref="https://github.com/substack/node-browserify"target="_blank">Browserify</a>, which allow you to "require('modules') in the browser by bundling up all of your dependencies."</p>
<p>Assuming that you're bundling your files with a tool such as [link:https://webpack.github.io/ Webpack] or [link:https://github.com/substack/node-browserify Browserify], which allow you to "require('modules') in the browser by bundling up all of your dependencies."</p>
<p>
You should now be able to import the module into your source files and continue to use it as per normal.
...
...
@@ -41,7 +41,7 @@
</code>
<p>
You're also able to leverage <ahref="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import"target="_blank">ES6 import syntax</a>:
You're also able to leverage [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import ES6 import syntax]: