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="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. [page:BufferGeometry] &rarr;
  12. <h1>[name]</h1>
  13. <p class="desc">[name] can be used to create a decal mesh that serves different kinds of purposes e.g. adding unique details to models, performing dynamic visual environmental changes or covering seams.</p>
  14. <script>
  15. // iOS iframe auto-resize workaround
  16. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  17. var scene = document.getElementById( 'scene' );
  18. scene.style.width = getComputedStyle( scene ).width;
  19. scene.style.height = getComputedStyle( scene ).height;
  20. scene.setAttribute( 'scrolling', 'no' );
  21. }
  22. </script>
  23. <h2>Example</h2>
  24. <p>[example:webgl_decals WebGL / decals]</p>
  25. <code>var geometry = new THREE.DecalGeometry( mesh, position, orientation, size );
  26. var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
  27. var mesh = new THREE.Mesh( geometry, material );
  28. scene.add( mesh );
  29. </code>
  30. <h2>Constructor</h2>
  31. <h3>[name]( [param:Mesh mesh], [param:Vector3 position], [param:Euler orientation], [param:Vector3 size] )</h3>
  32. <p>
  33. mesh — Any mesh object.<br />
  34. position — Position of the decal projector.<br />
  35. orientation — Orientation of the decal projector.<br />
  36. size — Size of the decal projector.
  37. </p>
  38. <h2>Source</h2>
  39. <p>
  40. [link:https://github.com/mrdoob/three.js/blob/master/examples/js/geometries/DecalGeometry.js examples/js/geometries/DecalGeometry.js]
  41. </p>
  42. </body>
  43. </html>