Fog.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Fog - 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. <h1 translate="no">Fog</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>This class can be used to define a linear fog that grows linearly denser
  16. with the distance.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const scene = new THREE.Scene();
  19. scene.fog = new THREE.Fog( 0xcccccc, 10, 15 );
  20. </code></pre></div>
  21. </header>
  22. <article>
  23. <div class="container-overview">
  24. <h2>Constructor</h2>
  25. <h3 class="name name-method" id="Fog" translate="no">new <a href="#Fog">Fog</a><span class="signature">( color : <span class="param-type">number | <a href="Color.html">Color</a></span>, near : <span class="param-type">number</span>, far : <span class="param-type">number</span> )</span> </h3>
  26. <div class="method">
  27. <div class="description">
  28. <p>Constructs a new fog.</p>
  29. </div>
  30. <table class="params">
  31. <tbody>
  32. <tr>
  33. <td class="name">
  34. <strong>color</strong>
  35. </td>
  36. <td class="description last">
  37. <p>The fog's color.</p>
  38. </td>
  39. </tr>
  40. <tr>
  41. <td class="name">
  42. <strong>near</strong>
  43. </td>
  44. <td class="description last">
  45. <p>The minimum distance to start applying fog.</p>
  46. <p>Default is <code>1</code>.</p>
  47. </td>
  48. </tr>
  49. <tr>
  50. <td class="name">
  51. <strong>far</strong>
  52. </td>
  53. <td class="description last">
  54. <p>The maximum distance at which fog stops being calculated and applied.</p>
  55. <p>Default is <code>1000</code>.</p>
  56. </td>
  57. </tr>
  58. </tbody>
  59. </table>
  60. </div>
  61. </div>
  62. <h2 class="subsection-title">Properties</h2>
  63. <div class="member">
  64. <h3 class="name" id="color" translate="no">.<a href="#color">color</a><span class="type-signature"> : <a href="Color.html">Color</a></span> </h3>
  65. <div class="description">
  66. <p>The fog's color.</p>
  67. </div>
  68. </div>
  69. <div class="member">
  70. <h3 class="name" id="far" translate="no">.<a href="#far">far</a><span class="type-signature"> : number</span> </h3>
  71. <div class="description">
  72. <p>The maximum distance at which fog stops being calculated and applied.
  73. Objects that are more than <code>far</code> units away from the active camera won't
  74. be affected by fog.</p>
  75. <p>Default is <code>1000</code>.</p>
  76. </div>
  77. </div>
  78. <div class="member">
  79. <h3 class="name" id="isFog" translate="no">.<a href="#isFog">isFog</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  80. <div class="description">
  81. <p>This flag can be used for type testing.</p>
  82. <p>Default is <code>true</code>.</p>
  83. </div>
  84. </div>
  85. <div class="member">
  86. <h3 class="name" id="name" translate="no">.<a href="#name">name</a><span class="type-signature"> : string</span> </h3>
  87. <div class="description">
  88. <p>The name of the fog.</p>
  89. </div>
  90. </div>
  91. <div class="member">
  92. <h3 class="name" id="near" translate="no">.<a href="#near">near</a><span class="type-signature"> : number</span> </h3>
  93. <div class="description">
  94. <p>The minimum distance to start applying fog. Objects that are less than
  95. <code>near</code> units from the active camera won't be affected by fog.</p>
  96. <p>Default is <code>1</code>.</p>
  97. </div>
  98. </div>
  99. <h2 class="subsection-title">Methods</h2>
  100. <h3 class="name name-method" id="clone" translate="no">.<a href="#clone">clone</a><span class="signature">()</span><span class="type-signature"> : <a href="Fog.html">Fog</a></span> </h3>
  101. <div class="method">
  102. <div class="description">
  103. <p>Returns a new fog with copied values from this instance.</p>
  104. </div>
  105. <dl class="details">
  106. <dt class="tag-returns"><strong>Returns:</strong> A clone of this instance.</dt>
  107. </dl>
  108. </div>
  109. <h3 class="name name-method" id="toJSON" translate="no">.<a href="#toJSON">toJSON</a><span class="signature">( meta : <span class="param-type">Object | string</span> )</span><span class="type-signature"> : Object</span> </h3>
  110. <div class="method">
  111. <div class="description">
  112. <p>Serializes the fog into JSON.</p>
  113. </div>
  114. <table class="params">
  115. <tbody>
  116. <tr>
  117. <td class="name">
  118. <strong>meta</strong>
  119. </td>
  120. <td class="description last">
  121. <p>An optional value holding meta information about the serialization.</p>
  122. </td>
  123. </tr>
  124. </tbody>
  125. </table>
  126. <dl class="details">
  127. <dt class="tag-returns"><strong>Returns:</strong> A JSON object representing the serialized fog</dt>
  128. </dl>
  129. </div>
  130. <h2 class="subsection-title">Source</h2>
  131. <p>
  132. <a href="https://github.com/mrdoob/three.js/blob/master/src/scenes/Fog.js" translate="no" target="_blank" rel="noopener">src/scenes/Fog.js</a>
  133. </p>
  134. </article>
  135. </section>
  136. <script src="../scripts/linenumber.js"></script>
  137. <script src="../scripts/page.js"></script>
  138. </body>
  139. </html>
粤ICP备19079148号