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

216
Views
Three.js - ¿Cómo instanciar una malla de un objeto animado?

Tengo un modelo animado. Si es posible, quiero usar instancedmesh y tener muchos de ellos animados en una sola llamada de sorteo, y hacer que se animen en diferentes intervalos. En mi ejemplo, también he aplicado una textura a uno de los hijos del modelo. Las texturas deberán ser diferentes para cada modelo, pero leí que no sería posible cambiar los materiales en la matriz de instancedmesh de malla.

Una cantidad aproximada del código que tengo para clonar 64 modelos animados y animarlos

 var OBJECT_LIST = []; var models = [];//contains loaded models var model = function( id ) { var self = { id: id, object: cloneGltf(models[0]), position: { x: Math.floor(Math.random() * 100), y: Math.floor(Math.random() * 100), z: Math.floor(Math.random() * 100) } }; self.object.scene.children[1].children[1].skinning = true; self.object.scene.children[1].children[1].morphTargets = true; self.object.scene.children[1].children[1].material = material; self.object.scene.position.set(self.position.x, self.position.y, self.position.z); self.object.scene.rotation.x = self.rotation.x; self.object.scene.rotation.y = self.rotation.y; self.object.scene.rotation.z = self.rotation.z; self.mixer = new THREE.AnimationMixer( self.object.scene ); const clip = THREE.AnimationClip.findByName( self.object.animations, animationName ); self.action = self.mixer.clipAction( clip ); self.action.play(); //self.object.scale.set(0.025, 0.025, 0.025); //self.object.scale.set(0.001, 0.001, 0.001); self.object.scene.scale.set(5, 5, 5); self.mixer = new THREE.AnimationMixer( self.object.scene ); const clip = THREE.AnimationClip.findByName( self.object.animations, animationName ); self.action = self.mixer.clipAction( clip ); self.action.play(); scene.add(self.object.scene); OBJECT_LIST[self.id] = self; } function init(){ for(var i = 0; i < 64; i++){ var tmp = new model(i); } } var delta; function render() { requestAnimationFrame( render ); delta = clock.getDelta(); //Players for(var O in OBJECT_LIST){ var object = OBJECT_LIST[O]; object.mixer.update( delta ); } renderer.render( scene, camera ); }

Si no es posible, ¿cuál sería la forma más cercana de lograr la ambición deseada con el mejor desempeño?

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!