TouchEdge.js 662 B

123456789101112131415161718192021222324
  1. import * as THREE from "three";
  2. import { Line2 } from 'three/examples/jsm/lines/Line2.js';
  3. import { LineGeometry } from 'three/examples/jsm/lines/LineGeometry.js';
  4. export default class TouchEdge extends THREE.Group {
  5. constructor(positions, matLine) {
  6. super()
  7. positions.forEach((i, j) => { //top left bottom right
  8. const geometry = new LineGeometry();
  9. geometry.setPositions( i );
  10. const line = new Line2( geometry, matLine );
  11. line.scale.set( 1, 1, 1 );
  12. line.position.y += 0.5
  13. line.name = j
  14. line.visible = false
  15. line.x = i[0]
  16. line.y = i[2]
  17. this.add( line );
  18. });
  19. console.log(this)
  20. }
  21. }