Group.html 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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:Object3D] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. This is almost identical to an [page:Object3D Object3D]. Its purpose is to
  14. make working with groups of objects syntactically clearer.
  15. </p>
  16. <h2>Code Example</h2>
  17. <code>
  18. const geometry = new THREE.BoxGeometry( 1, 1, 1 );
  19. const material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
  20. const cubeA = new THREE.Mesh( geometry, material );
  21. cubeA.position.set( 100, 100, 0 );
  22. const cubeB = new THREE.Mesh( geometry, material );
  23. cubeB.position.set( -100, -100, 0 );
  24. //create a group and add the two cubes
  25. //These cubes can now be rotated / scaled etc as a group
  26. const group = new THREE.Group();
  27. group.add( cubeA );
  28. group.add( cubeB );
  29. scene.add( group );
  30. </code>
  31. <h2>Constructor</h2>
  32. <h3>[name]( )</h3>
  33. <h2>Properties</h2>
  34. <p>See the base [page:Object3D] class for common properties.</p>
  35. <h3>[property:Boolean isGroup]</h3>
  36. <p>Read-only flag to check if a given object is of type [name].</p>
  37. <h3>[property:String type]</h3>
  38. <p>A string 'Group'. This should not be changed.</p>
  39. <h2>Methods</h2>
  40. <p>See the base [page:Object3D] class for common methods.</p>
  41. <h2>Source</h2>
  42. <p>
  43. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  44. </p>
  45. </body>
  46. </html>