Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

254
Vistas
minDistance and maxDistance issued with threejs and OrbitControl

I am trying to use orbit control to zoom in and out my object, I included the orbit control file from GitHub in my file but when I input those commented-out lines the entire page went blank.

 //scene
    const scene = new THREE.Scene();
 //camera
    const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );

    //renderer
    const renderer = new THREE.WebGLRenderer();
    renderer.setSize( window.innerWidth, window.innerHeight );
    document.body.appendChild( renderer.domElement );
    

    const geometry = new THREE.SphereGeometry(10,10,10)
    const material = new THREE.MeshNormalMaterial({wireframe:true})
    const sphere = new THREE.Mesh(geometry,material)
    scene.add(sphere)

    const geometry2 = new THREE.SphereGeometry(10,10,10)
    const material2 = new THREE.MeshNormalMaterial({wireframe:true})
    const sphere2 = new THREE.Mesh(geometry2,material2)
    sphere2.position.x = 40
    scene.add(sphere2)

    const geometry3 = new THREE.SphereGeometry(10,10,10)
    const material3 = new THREE.MeshNormalMaterial({wireframe:true})
    const sphere3 = new THREE.Mesh(geometry3,material3)
    sphere3.position.x = -40
    scene.add(sphere3)

    camera.position.z = 70        

    //controls = new THREE.OrbitControls(camera,renderer.domElement)
   //controls.minDistance =1
    //controls.maxDistance =1000


    const animate = () => {
        requestAnimationFrame(animate)
        
        sphere.rotation.x += 0.02
        sphere.rotation.y += 0.02

        sphere2.rotation.x += 0.02
        sphere2.rotation.y += 0.02

        sphere3.rotation.x += 0.02
        sphere3.rotation.y += 0.02
        //controls.update()

        renderer.render(scene,camera)

    }

    animate()      
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda