AmbientLight.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>AmbientLight - 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="Light.html">Light</a> → </p>
  13. <h1 translate="no">AmbientLight</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This light globally illuminates all objects in the scene equally.</p>
  17. <p>It cannot be used to cast shadows as it does not have a direction.</p></div>
  18. <h2>Code Example</h2>
  19. <div translate="no"><pre><code class="language-js">const light = new THREE.AmbientLight( 0x404040 ); // soft white light
  20. scene.add( light );
  21. </code></pre></div>
  22. </header>
  23. <article>
  24. <div class="container-overview">
  25. <h2>Constructor</h2>
  26. <h3 class="name name-method" id="AmbientLight" translate="no">new <a href="#AmbientLight">AmbientLight</a><span class="signature">( color : <span class="param-type">number | <a href="Color.html">Color</a> | string</span>, intensity : <span class="param-type">number</span> )</span> </h3>
  27. <div class="method">
  28. <div class="description">
  29. <p>Constructs a new ambient light.</p>
  30. </div>
  31. <table class="params">
  32. <tbody>
  33. <tr>
  34. <td class="name">
  35. <strong>color</strong>
  36. </td>
  37. <td class="description last">
  38. <p>The light's color.</p>
  39. <p>Default is <code>0xffffff</code>.</p>
  40. </td>
  41. </tr>
  42. <tr>
  43. <td class="name">
  44. <strong>intensity</strong>
  45. </td>
  46. <td class="description last">
  47. <p>The light's strength/intensity.</p>
  48. <p>Default is <code>1</code>.</p>
  49. </td>
  50. </tr>
  51. </tbody>
  52. </table>
  53. </div>
  54. </div>
  55. <h2 class="subsection-title">Properties</h2>
  56. <div class="member">
  57. <h3 class="name" id="isAmbientLight" translate="no">.<a href="#isAmbientLight">isAmbientLight</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  58. <div class="description">
  59. <p>This flag can be used for type testing.</p>
  60. <p>Default is <code>true</code>.</p>
  61. </div>
  62. </div>
  63. <h2 class="subsection-title">Source</h2>
  64. <p>
  65. <a href="https://github.com/mrdoob/three.js/blob/master/src/lights/AmbientLight.js" translate="no" target="_blank" rel="noopener">src/lights/AmbientLight.js</a>
  66. </p>
  67. </article>
  68. </section>
  69. <script src="../scripts/linenumber.js"></script>
  70. <script src="../scripts/page.js"></script>
  71. </body>
  72. </html>
粤ICP备19079148号