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

68
Views
Animar matriz de objetos de malla en tres js

Estoy tratando de animar una matriz de objetos de malla, la matriz se ve así

 [{truck_id:1,sphere:MeshObject,vec:Vector3Object,positions:[{instance:20,x:1,y:2,z:0},{instance:40,x:4,y:1,z:0},{instance:60,x:2,y:1,z:0}]},{truck_id:2,sphere:MeshObject,vec:Vector3Object,positions:[{instance:20,x:10,y:2,z:0},{instance:40,x:14,y:1,z:0},{instance:60,x:2,y:1,z:0}]},{truck_id:3,sphere:MeshObject,vec:Vector3Object,positions:[{instance:20,x:11,y:20,z:0},{instance:40,x:42,y:1,z:0},{instance:60,x:2,y:11,z:0}]}]

Estoy tratando de recorrer la instancia 20 a la instancia 60 y animar los cambios de posición de estas 3 esferas simultáneamente de manera escalonada.

hasta ahora lo he intentado

 for (let i =20; i<=60;i+=20){ task(i); } function task(i) { setTimeout(function () { for(let j=0;j<trucks_arr.length;j++){ var position = trucks_arr[j].positions.find(function (el) {return el.instance == i}); trucks_arr[j].vec.x=position.x trucks_arr[j].vec.y=position.y } }, 100 * i); }
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!