GroundedSkybox.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>GroundedSkybox - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Object3D.html">Object3D</a> → <a href="Mesh.html">Mesh</a> → </p>
  13. <h1 translate="no">GroundedSkybox</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A ground-projected skybox.</p>
  17. <p>By default the object is centered at the camera, so it is often helpful to set
  18. <code>skybox.position.y = height</code> to put the ground at the origin.</p></div>
  19. <h2>Code Example</h2>
  20. <div translate="no"><pre><code class="language-js">const height = 15, radius = 100;
  21. const skybox = new GroundedSkybox( envMap, height, radius );
  22. skybox.position.y = height;
  23. scene.add( skybox );
  24. </code></pre></div>
  25. </header>
  26. <article>
  27. <h2 class="subsection-title">Import</h2>
  28. <p><span translate="no">GroundedSkybox</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  29. <pre><code class="language-js">import { GroundedSkybox } from 'three/addons/objects/GroundedSkybox.js';</code></pre>
  30. <div class="container-overview">
  31. <h2>Constructor</h2>
  32. <h3 class="name name-method" id="GroundedSkybox" translate="no">new <a href="#GroundedSkybox">GroundedSkybox</a><span class="signature">( map : <span class="param-type">Texture</span>, height : <span class="param-type">number</span>, radius : <span class="param-type">number</span>, resolution : <span class="param-type">number</span> )</span> </h3>
  33. <div class="method">
  34. <div class="description">
  35. <p>Constructs a new ground-projected skybox.</p>
  36. </div>
  37. <table class="params">
  38. <tbody>
  39. <tr>
  40. <td class="name"><code>map</code></td>
  41. <td class="description last"><p>The environment map to use.</p></td>
  42. </tr>
  43. <tr>
  44. <td class="name"><code>height</code></td>
  45. <td class="description last"><p>The height is how far the camera that took the photo was above the ground.
  46. A larger value will magnify the downward part of the image.</p></td>
  47. </tr>
  48. <tr>
  49. <td class="name"><code>radius</code></td>
  50. <td class="description last"><p>The radius of the skybox. Must be large enough to ensure the scene's camera stays inside.</p></td>
  51. </tr>
  52. <tr>
  53. <td class="name"><code>resolution</code></td>
  54. <td class="description last"><p>The geometry resolution of the skybox.<br/>Default is <code>128</code>.</p></td>
  55. </tr>
  56. </tbody>
  57. </table>
  58. </div>
  59. </div>
  60. <h2 class="subsection-title">Source</h2>
  61. <p>
  62. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/objects/GroundedSkybox.js" target="_blank" rel="noopener" translate="no">examples/jsm/objects/GroundedSkybox.js</a>
  63. </p>
  64. </article>
  65. </section>
  66. <script src="../scripts/linenumber.js"></script>
  67. <script src="../scripts/page.js"></script>
  68. </body>
  69. </html>
粤ICP备19079148号