Group.html 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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:Boolean isGroup]</h3>
  35. <p>
  36. Read-only flag to check if a given object is of type [name].
  37. </p>
  38. <h3>[property:String type]</h3>
  39. <p>一个字符串:“Group”。这个属性不应当被改变。</p>
  40. <h2>方法</h2>
  41. <p>共有方法请参见其基类[page:Object3D]。</p>
  42. <h2>源代码</h2>
  43. <p>
  44. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  45. </p>
  46. </body>
  47. </html>