OctahedronBufferGeometry.js 583 B

12345678910111213141516171819202122232425262728293031
  1. import { PolyhedronBufferGeometry } from './PolyhedronBufferGeometry.js';
  2. class OctahedronBufferGeometry extends PolyhedronBufferGeometry {
  3. constructor( radius = 1, detail = 0 ) {
  4. const vertices = [
  5. 1, 0, 0, - 1, 0, 0, 0, 1, 0,
  6. 0, - 1, 0, 0, 0, 1, 0, 0, - 1
  7. ];
  8. const indices = [
  9. 0, 2, 4, 0, 4, 3, 0, 3, 5,
  10. 0, 5, 2, 1, 2, 5, 1, 5, 3,
  11. 1, 3, 4, 1, 4, 2
  12. ];
  13. super( vertices, indices, radius, detail );
  14. this.type = 'OctahedronBufferGeometry';
  15. this.parameters = {
  16. radius: radius,
  17. detail: detail
  18. };
  19. }
  20. }
  21. export { OctahedronBufferGeometry };