setup.html 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <!DOCTYPE html><html lang="zh"><head>
  2. <meta charset="utf-8">
  3. <title>设置</title>
  4. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  5. <meta name="twitter:card" content="summary_large_image">
  6. <meta name="twitter:site" content="@threejs">
  7. <meta name="twitter:title" content="Three.js – 设置">
  8. <meta property="og:image" content="https://threejs.org/files/share.png">
  9. <link rel="shortcut icon" href="/files/favicon_white.ico" media="(prefers-color-scheme: dark)">
  10. <link rel="shortcut icon" href="/files/favicon.ico" media="(prefers-color-scheme: light)">
  11. <link rel="stylesheet" href="/manual/resources/lesson.css">
  12. <link rel="stylesheet" href="/manual/resources/lang.css">
  13. <link rel="stylesheet" href="/manual/zh/lang.css">
  14. </head>
  15. <body>
  16. <div class="container">
  17. <div class="lesson-title">
  18. <h1>设置</h1>
  19. </div>
  20. <div class="lesson">
  21. <div class="lesson-main">
  22. <p>这是three.js系列文章的其中之一。
  23. 第一篇是<a href="fundamentals.html">关于three.js基础</a>。
  24. 如果你还没有阅读那你应该从那开始。</p>
  25. <p>在我们深入之前我们需要讨论一下设置你的电脑来开发。
  26. 尤其是,因为安全的原因,
  27. WebGL不能直接从你的硬件使用图片。意思是说
  28. 为了能开发你需要使用web服务。幸运的是
  29. web服务很容易设置和使用。</p>
  30. <p>首先如果你喜欢你可以从<a href="https://github.com/gfxfundamentals/threejsfundamentals/archive/gh-pages.zip">这个链接</a>
  31. 下载整个网站。
  32. 一旦下载完成双击文件来解压。</p>
  33. <p>下一步下载一个简单的web服务。</p>
  34. <p>如果你更喜欢有用户界面的web服务,这有一个
  35. <a href="https://greggman.github.io/servez">Servez</a></p>
  36. <p></p><div class="threejs_image border">
  37. <img class="" src="../resources/servez.gif">
  38. </div>
  39. <p></p>
  40. <p>只要将他指向你解压的文件夹,点击"Start",然后
  41. 打开你的浏览器的<a href="http://localhost:8080/"><code class="notranslate" translate="no">http://localhost:8080/</code></a>或者
  42. 你想浏览例子打开<a href="http://localhost:8080/threejs"><code class="notranslate" translate="no">http://localhost:8080/threejs</code></a>。</p>
  43. <p>点击stop或者推出Servez来停止服务。
  44. 如果你更喜欢命令行(我就是),另一种方法是使用<a href="https://nodejs.org">node.js</a>。
  45. 下载,安装,然后打开一个command prompt / console / terminal窗口。 如果你是在Windows上安装程序会添加一个特别的"Node Command Prompt"所以使用它。</p>
  46. <p>然后安装<a href="https://github.com/greggman/servez-cli"><code class="notranslate" translate="no">servez</code></a>通过输入</p>
  47. <pre class="prettyprint showlinemods notranslate notranslate" translate="no">npm -g install servez
  48. </pre><p>如果你是OSX使用</p>
  49. <pre class="prettyprint showlinemods notranslate notranslate" translate="no">sudo npm -g install servez
  50. </pre><p>一旦你输入完成</p>
  51. <pre class="prettyprint showlinemods notranslate notranslate" translate="no">servez path/to/folder/where/you/unzipped/files
  52. </pre><p>它会打印像这样的东西</p>
  53. <p></p><div class="threejs_image ">
  54. <img class="" src="../resources/servez-response.png">
  55. </div>
  56. <p></p>
  57. <p>然后在你的浏览器中打开<a href="http://localhost:8080/"><code class="notranslate" translate="no">http://localhost:8080/</code></a>。</p>
  58. <p>如果你没有指定路径那么servez会使用当前的文件夹。</p>
  59. <p>如果这些都不是你的选择
  60. <a href="https://stackoverflow.com/questions/12905426/what-is-a-faster-alternative-to-pythons-servez-or-simplehttpserver">这里有很多其他的服务可供选择</a>。</p>
  61. <p>现在你有了服务我们可以移步到<a href="textures.html">纹理</a>.</p>
  62. </div>
  63. </div>
  64. </div>
  65. <script src="/manual/resources/prettify.js"></script>
  66. <script src="/manual/resources/lesson.js"></script>
  67. </body></html>