ShadowMaterial.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ShadowMaterial - 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="Material.html">Material</a> → </p>
  13. <h1 translate="no">ShadowMaterial</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This material can receive shadows, but otherwise is completely transparent.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const geometry = new THREE.PlaneGeometry( 2000, 2000 );
  19. geometry.rotateX( - Math.PI / 2 );
  20. const material = new THREE.ShadowMaterial();
  21. material.opacity = 0.2;
  22. const plane = new THREE.Mesh( geometry, material );
  23. plane.position.y = -200;
  24. plane.receiveShadow = true;
  25. scene.add( plane );
  26. </code></pre></div>
  27. </header>
  28. <article>
  29. <div class="container-overview">
  30. <h2>Constructor</h2>
  31. <h3 class="name name-method" id="ShadowMaterial" translate="no">new <a href="#ShadowMaterial">ShadowMaterial</a><span class="signature">( parameters : <span class="param-type">Object</span> )</span> </h3>
  32. <div class="method">
  33. <div class="description">
  34. <p>Constructs a new shadow material.</p>
  35. </div>
  36. <table class="params">
  37. <tbody>
  38. <tr>
  39. <td class="name">
  40. <strong>parameters</strong>
  41. </td>
  42. <td class="description last">
  43. <p>An object with one or more properties
  44. defining the material's appearance. Any property of the material
  45. (including any property from inherited materials) can be passed
  46. in here. Color values can be passed any type of value accepted
  47. by <a href="Color.html#set">Color#set</a>.</p>
  48. </td>
  49. </tr>
  50. </tbody>
  51. </table>
  52. </div>
  53. </div>
  54. <h2 class="subsection-title">Properties</h2>
  55. <div class="member">
  56. <h3 class="name" id="color" translate="no">.<a href="#color">color</a><span class="type-signature"> : <a href="Color.html">Color</a></span> </h3>
  57. <div class="description">
  58. <p>Color of the material.</p>
  59. <p>Default is <code>(0,0,0)</code>.</p>
  60. </div>
  61. </div>
  62. <div class="member">
  63. <h3 class="name" id="fog" translate="no">.<a href="#fog">fog</a><span class="type-signature"> : boolean</span> </h3>
  64. <div class="description">
  65. <p>Whether the material is affected by fog or not.</p>
  66. <p>Default is <code>true</code>.</p>
  67. </div>
  68. </div>
  69. <div class="member">
  70. <h3 class="name" id="isShadowMaterial" translate="no">.<a href="#isShadowMaterial">isShadowMaterial</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  71. <div class="description">
  72. <p>This flag can be used for type testing.</p>
  73. <p>Default is <code>true</code>.</p>
  74. </div>
  75. </div>
  76. <div class="member">
  77. <h3 class="name" id="transparent" translate="no">.<a href="#transparent">transparent</a><span class="type-signature"> : boolean</span> </h3>
  78. <div class="description">
  79. <p>Overwritten since shadow materials are transparent
  80. by default.</p>
  81. <p>Default is <code>true</code>.</p>
  82. </div>
  83. <dl class="details">
  84. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Material.html#transparent">Material#transparent</a></dt>
  85. </dl>
  86. </div>
  87. <h2 class="subsection-title">Source</h2>
  88. <p>
  89. <a href="https://github.com/mrdoob/three.js/blob/master/src/materials/ShadowMaterial.js" translate="no" target="_blank" rel="noopener">src/materials/ShadowMaterial.js</a>
  90. </p>
  91. </article>
  92. </section>
  93. <script src="../scripts/linenumber.js"></script>
  94. <script src="../scripts/page.js"></script>
  95. </body>
  96. </html>
粤ICP备19079148号