DecalGeometry.html 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:BufferGeometry] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. [name] can be used to create a decal mesh that serves different kinds of purposes e.g. adding unique details
  14. to models, performing dynamic visual environmental changes or covering seams.
  15. </p>
  16. <h2>Import</h2>
  17. <p>
  18. [name] is an add-on, and must be imported explicitly.
  19. See [link:#manual/introduction/Installation Installation / Addons].
  20. </p>
  21. <code>
  22. import { DecalGeometry } from 'three/addons/geometries/DecalGeometry.js';
  23. </code>
  24. <h2>Code Example</h2>
  25. <code>
  26. const geometry = new DecalGeometry( mesh, position, orientation, size );
  27. const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
  28. const mesh = new THREE.Mesh( geometry, material );
  29. scene.add( mesh );
  30. </code>
  31. <h2>Examples</h2>
  32. <p>[example:webgl_decals WebGL / decals]</p>
  33. <h2>Constructor</h2>
  34. <h3>[name]( [param:Mesh mesh], [param:Vector3 position], [param:Euler orientation], [param:Vector3 size] )</h3>
  35. <p>
  36. mesh — Any mesh object.<br />
  37. position — Position of the decal projector.<br />
  38. orientation — Orientation of the decal projector.<br />
  39. size — Size of the decal projector.
  40. </p>
  41. <h2>Source</h2>
  42. <p>
  43. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/geometries/DecalGeometry.js examples/jsm/geometries/DecalGeometry.js]
  44. </p>
  45. </body>
  46. </html>