setup.html 5.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!DOCTYPE html><html lang="ko"><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="../resources/lesson.css">
  12. <link rel="stylesheet" href="../resources/lang.css">
  13. <script type="importmap">
  14. {
  15. "imports": {
  16. "three": "../../build/three.module.js"
  17. }
  18. }
  19. </script>
  20. <link rel="stylesheet" href="/manual/ko/lang.css">
  21. </head>
  22. <body>
  23. <div class="container">
  24. <div class="lesson-title">
  25. <h1>개발 환경 구성하기</h1>
  26. </div>
  27. <div class="lesson">
  28. <div class="lesson-main">
  29. <p>※ 이 글은 Three.js의 튜토리얼 시리즈로서,
  30. 먼저 <a href="fundamentals.html">Three.js의 기본 구조에 관한 글</a>을
  31. 읽고 오길 권장합니다.</p>
  32. <p>Three.js의 다른 요소를 더 살펴보기 전에, 개발 환경을 구축하는 방법에 대해
  33. 알아보겠습니다. WebGL은 보안 때문에 기본적으로 로컬 파일을 직접 가져다 쓸
  34. 수 없습니다. 말인즉 실제 프로젝트를 배포/테스트하려면 웹 서버를 써야한다는
  35. 이야기죠. 다행히도 웹 서버 관련 라이브러리는 굉장히 많고, 사용하기도 쉽습니다.</p>
  36. <p>먼저 서버에 올릴 예시를 준비해야 합니다. 원한다면 <a href="https://github.com/gfxfundamentals/threejsfundamentals/archive/gh-pages.zip">이 사이트 전체를 다운</a>
  37. 받을 수도 있죠. 다운 받은 뒤에는 압축 프로그램으로 압축을 풀어주세요.</p>
  38. <p>다음으로 간단한 웹 서버를 하나 다운 받습니다.</p>
  39. <p>만약 UI가 있는 웹 서버를 찾는다면
  40. <a href="https://greggman.github.io/servez">Servez</a>를 추천합니다.</p>
  41. <p></p><div class="threejs_image border">
  42. <img class="" src="../resources/servez.gif">
  43. </div>
  44. <p></p>
  45. <p>압축을 푼 경로를 지정하고, "Start" 버튼을 클릭하세요. 그런 다음
  46. <a href="http://localhost:8080/"><code class="notranslate" translate="no">http://localhost:8080/</code></a>로 이동하기만
  47. 하면 됩니다. 만약 예제를 보고 싶다면 <a href="http://localhost:8080/threejs"><code class="notranslate" translate="no">http://localhost:8080/threejs</code></a>로
  48. 이동하세요.</p>
  49. <p>서버를 중지하려면 Servez를 멈추거나 종료하면 됩니다.</p>
  50. <p>만약 CLI(Command Line Interface, 명령 줄 인터페이스)를 선호한다면(전 선호합니다)
  51. <a href="https://nodejs.org">node.js</a>를 써도 좋습니다. 다운 받아 설치한 다음 프롬프트 /
  52. 콘솔 / 터미널 창을 엽니다. 윈도우를 사용한다면 설치 마법사가 "Node Command Prompt"를
  53. 추가할 테니 그걸 사용해도 좋습니다.</p>
  54. <p>창을 띄웠으면 <a href="https://github.com/greggman/servez-cli"><code class="notranslate" translate="no">servez</code></a>를 설치합니다.</p>
  55. <pre class="prettyprint showlinemods notranslate notranslate" translate="no">npm -g install servez
  56. </pre><p>OS X를 사용한다면 다음과 같이 설치할 수 있습니다.</p>
  57. <pre class="prettyprint showlinemods notranslate notranslate" translate="no">sudo npm -g install servez
  58. </pre><p>설치가 완료되면 다음과 같이 Servez를 실행합니다.</p>
  59. <pre class="prettyprint showlinemods notranslate notranslate" translate="no">servez path/to/folder/where/you/unzipped/files
  60. </pre><p>사족이지만, 다음처럼 쓸 수도 있죠.</p>
  61. <pre class="prettyprint showlinemods notranslate notranslate" translate="no">cd path/to/folder/where/you/unzipped/files
  62. servez
  63. </pre><p>정상적으로 작동했다면 다음과 같은 메시지가 뜰 겁니다.</p>
  64. <p></p><div class="threejs_image ">
  65. <img class="" src="../resources/servez-response.png">
  66. </div>
  67. <p></p>
  68. <p>다음으로 브라우저에서 <a href="http://localhost:8080/"><code class="notranslate" translate="no">http://localhost:8080/</code></a>로
  69. 접속하세요. 경로를 지정하지 않으면 현재 경로를 서버의 ROOT 경로로 사용합니다.</p>
  70. <p>만약 Servez가 마음에 들지 않는다면, <a href="https://stackoverflow.com/questions/12905426/what-is-a-faster-alternative-to-pythons-servez-or-simplehttpserver">다른 간단한 웹 서버</a>를 사용해도 좋습니다.</p>
  71. <p>이제 개발 환경을 갖추었으니, <a href="textures.html">텍스처</a>에 대해 알아봅시다.</p>
  72. </div>
  73. </div>
  74. </div>
  75. <script src="../resources/prettify.js"></script>
  76. <script src="../resources/lesson.js"></script>
  77. </body></html>