Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

102
Views
Obtener pares de vértices en threejs EdgeGeometry

¿Cómo puedo obtener los pares de vértices que forman los bordes en EdgeGeometry?

Necesito obtener las coordenadas del punto de inicio y del punto final de cada borde. Actualmente estoy usando EdgeGeometry. Sin embargo, no puedo averiguar el orden en que se almacenan los vértices en el atributo.

Quiero almacenar los vértices en una matriz, como pares que forman los bordes.

 addBoxEdgestoCache = () => { const boxEdges = new THREE.EdgesGeometry(this.box.geometry); const lineMaterial = new THREE.LineBasicMaterial( { color: 'black', linewidth: 0.005} ); const line = new THREE.LineSegments(boxEdges, lineMaterial); this.scene.add(line); const arrLength = boxEdges.attributes.position.array.length; for (let i = 0; i < arrLength; i++){ // get start point const startPt = new THREE.Vector3(boxEdges.attributes.position.array[i], boxEdges.attributes.position.array[i+1], boxEdges.attributes.position.array[i+2]); // get end point const endPt = new THREE.Vector3(boxEdges.attributes.position.array[arrLength/2], boxEdges.attributes.position.array[arrLength/2 + 1], boxEdges.attributes.position.array[arrLength/2+2]); // store the edge as pair of vertices this.cache.edges.push([startPt, endPt]); } }

La parte de obtener el punto de inicio y obtener el punto final es actualmente incorrecta.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!