| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Fog - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <h1 translate="no">Fog</h1>
- <section>
- <header>
- <div class="class-description"><p>This class can be used to define a linear fog that grows linearly denser
- with the distance.</p></div>
- <h2>Code Example</h2>
- <div translate="no"><pre><code class="language-js">const scene = new THREE.Scene();
- scene.fog = new THREE.Fog( 0xcccccc, 10, 15 );
- </code></pre></div>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <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>
- <div class="method">
- <div class="description">
- <p>Constructs a new fog.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>color</strong>
- </td>
- <td class="description last">
- <p>The fog's color.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>near</strong>
- </td>
- <td class="description last">
- <p>The minimum distance to start applying fog.</p>
- <p>Default is <code>1</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>far</strong>
- </td>
- <td class="description last">
- <p>The maximum distance at which fog stops being calculated and applied.</p>
- <p>Default is <code>1000</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="color" translate="no">.<a href="#color">color</a><span class="type-signature"> : <a href="Color.html">Color</a></span> </h3>
- <div class="description">
- <p>The fog's color.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="far" translate="no">.<a href="#far">far</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The maximum distance at which fog stops being calculated and applied.
- Objects that are more than <code>far</code> units away from the active camera won't
- be affected by fog.</p>
- <p>Default is <code>1000</code>.</p>
- </div>
- </div>
- <div class="member">
- <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>
- <div class="description">
- <p>This flag can be used for type testing.</p>
- <p>Default is <code>true</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="name" translate="no">.<a href="#name">name</a><span class="type-signature"> : string</span> </h3>
- <div class="description">
- <p>The name of the fog.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="near" translate="no">.<a href="#near">near</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The minimum distance to start applying fog. Objects that are less than
- <code>near</code> units from the active camera won't be affected by fog.</p>
- <p>Default is <code>1</code>.</p>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <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>
- <div class="method">
- <div class="description">
- <p>Returns a new fog with copied values from this instance.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A clone of this instance.</dt>
- </dl>
- </div>
- <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>
- <div class="method">
- <div class="description">
- <p>Serializes the fog into JSON.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>meta</strong>
- </td>
- <td class="description last">
- <p>An optional value holding meta information about the serialization.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A JSON object representing the serialized fog</dt>
- </dl>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <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>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|