1
0

DecalGeometry.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!DOCTYPE html>
  2. <html lang="zh">
  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">[name] 可被用于创建贴花网格物体,以达到不同的目的,例如:为模型增加独特的细节、进行动态的视觉环境改变或覆盖接缝。</p>
  13. <h2>导入</h2>
  14. <p>
  15. [name] 是一个附加组件,必须显式导入。
  16. See [link:#manual/introduction/Installation Installation / Addons].
  17. </p>
  18. <code>
  19. import { DecalGeometry } from 'three/addons/geometries/DecalGeometry.js';
  20. </code>
  21. <h2>代码示例</h2>
  22. <code>
  23. const geometry = new DecalGeometry( mesh, position, orientation, size );
  24. const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
  25. const mesh = new THREE.Mesh( geometry, material );
  26. scene.add( mesh );
  27. </code>
  28. <h2>例子</h2>
  29. <p>[example:webgl_decals WebGL / decals]</p>
  30. <h2>Constructor</h2>
  31. <h3>[name]( [param:Mesh mesh], [param:Vector3 position], [param:Euler orientation], [param:Vector3 size] )</h3>
  32. <p>
  33. mesh — 一个网格对象。<br />
  34. position — 贴花投影器的位置。<br />
  35. orientation — 贴花投影器的朝向。<br />
  36. size — 贴花投影器的尺寸。
  37. </p>
  38. <h2>源代码</h2>
  39. <p>
  40. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/geometries/DecalGeometry.js examples/jsm/geometries/DecalGeometry.js]
  41. </p>
  42. </body>
  43. </html>