Group.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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:Object3D] &rarr;
  11. <h1>组([name])</h1>
  12. <p class="desc">
  13. 它几乎和[page:Object3D Object3D]是相同的,其目的是使得组中对象在语法上的结构更加清晰。
  14. </p>
  15. <h2>代码示例</h2>
  16. <code>
  17. const geometry = new THREE.BoxGeometry( 1, 1, 1 );
  18. const material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
  19. const cubeA = new THREE.Mesh( geometry, material );
  20. cubeA.position.set( 100, 100, 0 );
  21. const cubeB = new THREE.Mesh( geometry, material );
  22. cubeB.position.set( -100, -100, 0 );
  23. //create a group and add the two cubes
  24. //These cubes can now be rotated / scaled etc as a group
  25. const group = new THREE.Group();
  26. group.add( cubeA );
  27. group.add( cubeB );
  28. scene.add( group );
  29. </code>
  30. <h2>构造器</h2>
  31. <h3>[name]( )</h3>
  32. <h2>属性</h2>
  33. <p>共有属性请参见其基类[page:Object3D]。</p>
  34. <h3>[property:String type]</h3>
  35. <p>一个字符串:“Group”。这个属性不应当被改变。</p>
  36. <h2>方法</h2>
  37. <p>共有方法请参见其基类[page:Object3D]。</p>
  38. <h2>源代码</h2>
  39. <p>
  40. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  41. </p>
  42. </body>
  43. </html>