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

198
Views
Cómo animar la cámara para enfocar el objeto dentro de GLTF y deshabilitar los controles de mapa hasta que se desactive

Estoy tratando de emular el comportamiento en este sitio web, cuando el usuario hace clic en un objeto, la cámara se acerca y gira ligeramente para enfocar el objeto y todos los controles se desactivan hasta que el usuario vuelve a hacer clic en cualquier lugar y la animación se invierte y los controles están habilitados.

Actualmente lo tengo funcionando hasta el punto en que haces clic y la cámara se anima para enfocar el objeto 'Tree006', pero no funciona muy bien.

 var mesh=[]; const raycaster = new THREE.Raycaster(); const mouse = new THREE.Vector2() function onClick(event) { event.preventDefault(); mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1; mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1; raycaster.setFromCamera( mouse, camera ); var intersects = raycaster.intersectObjects( scene.children, true ); if ( intersects.length > 0 && intersects[0].object.name==="Tree006") { var object = intersects[0].object; gsap.to( camera.position, { duration: 1, x: mesh["Tree006"].position.x, y: mesh["Tree006"].position.y, z: mesh["Tree006"].position.z, onUpdate: function() { camera.lookAt(0,0,0); } } ); console.log( 'Intersection:', intersects[ 0 ] ); } }

about 4 years ago · Santiago Gelvez
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!