LatheBufferGeometry.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. [page:BufferGeometry] &rarr;
  12. <h1>[name]</h1>
  13. <p class="desc">This is the [page:BufferGeometry] port of [page:LatheGeometry].</p>
  14. <iframe id="scene" src="scenes/geometry-browser.html#LatheBufferGeometry"></iframe>
  15. <script>
  16. // iOS iframe auto-resize workaround
  17. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  18. var scene = document.getElementById( 'scene' );
  19. scene.style.width = getComputedStyle( scene ).width;
  20. scene.style.height = getComputedStyle( scene ).height;
  21. scene.setAttribute( 'scrolling', 'no' );
  22. }
  23. </script>
  24. <h2>Example</h2>
  25. <code>
  26. var points = [];
  27. for ( var i = 0; i < 10; i ++ ) {
  28. points.push( new THREE.Vector2( Math.sin( i * 0.2 ) * 10 + 5, ( i - 5 ) * 2 ) );
  29. }
  30. var geometry = new THREE.LatheBufferGeometry( points );
  31. var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  32. var lathe = new THREE.Mesh( geometry, material );
  33. scene.add( lathe );
  34. </code>
  35. <h2>Constructor</h2>
  36. <h3>[name]([param:Array points], [param:Integer segments], [param:Float phiStart], [param:Float phiLength])</h3>
  37. <p>
  38. points — Array of Vector2s. The x-coordinate of each point must be greater than zero.<br />
  39. segments — the number of circumference segments to generate. Default is 12.<br />
  40. phiStart — the starting angle in radians. Default is 0.<br />
  41. phiLength — the radian (0 to 2PI) range of the lathed section 2PI is a closed lathe, less than 2PI is a portion. Default is 2PI.
  42. </p>
  43. <p>
  44. This creates a LatheBufferGeometry based on the parameters.
  45. </p>
  46. <h2>Properties</h2>
  47. <h3>[property:Object parameters]</h3>
  48. <p>
  49. An object with a property for each of the constructor parameters. Any modification after instantiation does not change the geometry.
  50. </p>
  51. <h2>Source</h2>
  52. [link:https://github.com/mrdoob/three.js/blob/master/src/geometries/LatheGeometry.js src/geometries/LatheGeometry.js]
  53. </body>
  54. </html>