| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>AsciiEffect - 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">AsciiEffect</h1>
- <section>
- <header>
- <div class="class-description"><p>A class that creates an ASCII effect.</p>
- <p>The ASCII generation is based on <a href="https://github.com/hassadee/jsascii/blob/master/jsascii.js">jsascii</a>.</p></div>
- </header>
- <article>
- <h2 class="subsection-title">Import</h2>
- <p><span translate="no">AsciiEffect</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
- <pre><code class="language-js">import { AsciiEffect } from 'three/addons/effects/AsciiEffect.js';</code></pre>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="AsciiEffect" translate="no">new <a href="#AsciiEffect">AsciiEffect</a><span class="signature">( renderer : <span class="param-type">WebGLRenderer</span>, charSet : <span class="param-type">string</span>, options : <span class="param-type">AsciiEffect~Options</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new ASCII effect.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name"><code>renderer</code></td>
- <td class="description last"><p>The renderer.</p></td>
- </tr>
- <tr>
- <td class="name"><code>charSet</code></td>
- <td class="description last"><p>The char set.<br/>Default is <code>' .:-=+*#%@'</code>.</p></td>
- </tr>
- <tr>
- <td class="name"><code>options</code></td>
- <td class="description last"><p>The configuration parameter.</p></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="domElement" translate="no">.<a href="#domElement">domElement</a><span class="type-signature"> : HTMLDivElement</span> </h3>
- <div class="description">
- <p>The DOM element of the effect. This element must be used instead of the
- default <a href="WebGLRenderer.html#domElement">WebGLRenderer#domElement</a>.</p>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <h3 class="name name-method" id="render" translate="no">.<a href="#render">render</a><span class="signature">( scene : <span class="param-type">Object3D</span>, camera : <span class="param-type">Camera</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>When using this effect, this method should be called instead of the
- default <a href="WebGLRenderer.html#render">WebGLRenderer#render</a>.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name"><code>scene</code></td>
- <td class="description last"><p>The scene to render.</p></td>
- </tr>
- <tr>
- <td class="name"><code>camera</code></td>
- <td class="description last"><p>The camera.</p></td>
- </tr>
- </tbody>
- </table>
- </div>
- <h3 class="name name-method" id="setSize" translate="no">.<a href="#setSize">setSize</a><span class="signature">( w : <span class="param-type">number</span>, h : <span class="param-type">number</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Resizes the effect.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name"><code>w</code></td>
- <td class="description last"><p>The width of the effect in logical pixels.</p></td>
- </tr>
- <tr>
- <td class="name"><code>h</code></td>
- <td class="description last"><p>The height of the effect in logical pixels.</p></td>
- </tr>
- </tbody>
- </table>
- </div>
- <h2 class="subsection-title">Type Definitions</h2>
- <div class="member">
- <h3 class="name" id="~Options" translate="no">.<a href="#~Options">Options</a> </h3>
- <div class="description">
- <p>This type represents configuration settings of <code>AsciiEffect</code>.</p>
- </div>
- <h5 class="subsection-title">Properties:</h5>
- <table class="props">
- <thead>
- <tr>
- <th>Name</th>
- <th>Type</th>
- <th>Attributes</th>
- <th>Default</th>
- <th class="last">Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="name"><code>resolution</code></td>
- <td class="type">
- <span class="param-type">number</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- 0.15
- </td>
- <td class="description last"><p>A higher value leads to more details.</p></td>
- </tr>
- <tr>
- <td class="name"><code>scale</code></td>
- <td class="type">
- <span class="param-type">number</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- 1
- </td>
- <td class="description last"><p>The scale of the effect.</p></td>
- </tr>
- <tr>
- <td class="name"><code>color</code></td>
- <td class="type">
- <span class="param-type">boolean</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- false
- </td>
- <td class="description last"><p>Whether colors should be enabled or not. Better quality but slows down rendering.</p></td>
- </tr>
- <tr>
- <td class="name"><code>alpha</code></td>
- <td class="type">
- <span class="param-type">boolean</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- false
- </td>
- <td class="description last"><p>Whether transparency should be enabled or not.</p></td>
- </tr>
- <tr>
- <td class="name"><code>block</code></td>
- <td class="type">
- <span class="param-type">boolean</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- false
- </td>
- <td class="description last"><p>Whether blocked characters should be enabled or not.</p></td>
- </tr>
- <tr>
- <td class="name"><code>invert</code></td>
- <td class="type">
- <span class="param-type">boolean</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- false
- </td>
- <td class="description last"><p>Whether colors should be inverted or not.</p></td>
- </tr>
- <tr>
- <td class="name"><code>strResolution</code></td>
- <td class="type">
- <span class="param-type">'low'</span>
- |
- <span class="param-type">'medium'</span>
- |
- <span class="param-type">'high'</span>
- </td>
- <td class="attributes">
- <optional><br>
- </td>
- <td class="default">
- 'low'
- </td>
- <td class="description last"><p>The string resolution.</p></td>
- </tr>
- </tbody>
- </table>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/effects/AsciiEffect.js" target="_blank" rel="noopener" translate="no">examples/jsm/effects/AsciiEffect.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|