LatheGeometry.html 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <!DOCTYPE html>
  2. <html lang="ko">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:BufferGeometry] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">꽃병과 같은 축 대칭으로 메쉬를 만듭니다. 선반은 Y축을 중심으로 회전합니다.</p>
  13. <iframe id="scene" src="scenes/geometry-browser.html#LatheGeometry"></iframe>
  14. <script>
  15. // iOS iframe auto-resize workaround
  16. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  17. const scene = document.getElementById( 'scene' );
  18. scene.style.width = getComputedStyle( scene ).width;
  19. scene.style.height = getComputedStyle( scene ).height;
  20. scene.setAttribute( 'scrolling', 'no' );
  21. }
  22. </script>
  23. <h2>코드 예제</h2>
  24. <code>
  25. const points = [];
  26. for ( let i = 0; i < 10; i ++ ) {
  27. points.push( new THREE.Vector2( Math.sin( i * 0.2 ) * 10 + 5, ( i - 5 ) * 2 ) );
  28. }
  29. const geometry = new THREE.LatheGeometry( points );
  30. const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  31. const lathe = new THREE.Mesh( geometry, material );
  32. scene.add( lathe );
  33. </code>
  34. <h2>생성자</h2>
  35. <h3>[name]([param:Array points], [param:Integer segments], [param:Float phiStart], [param:Float phiLength])</h3>
  36. <p>
  37. points — Vector2의 배열. 각 점의 x 좌표는 0보다 커야 합니다. 기본값은 단순한 다이아몬드 모양을 만드는 (0,-0.5), (0.5,0) 및 (0,0.5)의 배열입니다.<br />
  38. segments — 생성할 원주 세그먼트의 수입니다. 기본값은 12 입니다.<br />
  39. phiStart — 시작 각도(라디안 단위). 기본값은 0 입니다.<br />
  40. phiLength — 선반 섹션의 라디안(0 ~ 2PI) 범위 2PI는 닫힌 선반이고, 2PI 미만이 한 부분입니다. 기본값은 2PI 입니다.
  41. </p>
  42. <p>
  43. 이렇게 하면 매개변수를 기반으로 [name]가 생성됩니다.
  44. </p>
  45. <h2>프로퍼티</h2>
  46. <p>일반 프로퍼티는 기본 [page:BufferGeometry] 클래스를 참조하십시오.</p>
  47. <h3>[property:Object parameters]</h3>
  48. <p>
  49. 각 생성자 매개 변수에 대한 속성을 가진 개체입니다. 인스턴스화 후에 수정해도 지오메트리는 변경되지 않습니다.
  50. </p>
  51. <h2>메서드</h2>
  52. <p>일반 메서드는 기본 [page:BufferGeometry] 클래스를 참조하십시오.</p>
  53. <h2>소스 코드</h2>
  54. <p>
  55. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  56. </p>
  57. </body>
  58. </html>