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

307
Views
¿Actualizando vértices en blendshape (clave de forma)?

Tengo algunos problemas para actualizar las posiciones de los vértices de una clave de forma. Aquí está mi código para controlar la tecla de forma:

 <input style="background: white; border-radius: 128px; cursor: pointer; padding: 8px; width: 200px;" type="range" min="0.1" max="1" step="0.1" value="0" id="slider"> let slider = document.getElementById('slider'); slider.addEventListener('input', (event) => { object.morphTargetInfluences[0] = event.target.value; updateVertices(); });

y así es como obtengo los puntos de vértice:

 <input style="background: white; border-radius: 128px; cursor: pointer; padding: 8px; width: 200px;" type="number" id="vertexid"> <span style="font-size: 14px;" id="vertexposition">position: (x: ?, y: ?, z: ?)</span> function updateVertices() { const geometry = object.geometry; const positionAttribute = geometry.getAttribute('position'); const vertex = new THREE.Vector3(); vertex.fromBufferAttribute(positionAttribute, vertexid.value - 1); object.updateMatrix(); object.updateMatrixWorld(); object.geometry.verticesNeedUpdate = true; object.geometry.attributes.position.needsUpdate = true; const spheregeometry = new THREE.SphereGeometry(0.05, 16, 8); const spherematerial = new THREE.MeshBasicMaterial({ color: 0xff0000 }); const sphere = new THREE.Mesh(spheregeometry, spherematerial); sphere.position.set(object.localToWorld(vertex).x, object.localToWorld(vertex).y, object.localToWorld(vertex).z); sphere.name = 'VertexPoint'; if (scene.getObjectByName('VertexPoint')) { var selectedObject = scene.getObjectByName('VertexPoint'); scene.remove(selectedObject); scene.add(sphere); } else { scene.add(sphere); } document.getElementById('vertexposition').textContent = 'position: (x: ' + object.localToWorld(vertex).x + ', y: ' + object.localToWorld(vertex).y + ', z: ' + object.localToWorld(vertex).z + ')'; }

mi pregunta/problema es que blendshape (clave de forma) no actualiza sus vértices, ¿cómo puedo lograr una actualización dinámica en los vértices de blendshape (forma clave)?

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!