Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

192
Visualizações
Three.js How to make the camera rotate around the center of an object

I had to create an interior camera of my object and for that to work I had to offset my object from the center. Now the problem is that I want the camera to rotate from the center of the object and not around the center of my scene. Here are some images one two three that will explain the problem. As you can see, looking at the car from the back it appears closer than looking from the front.

// Camera
const fov = 75;
const near = 0.1;
const far = 1000;
const camera = new THREE.PerspectiveCamera(fov, window.innerWidth / window.innerHeight, near, far);
camera.position.set(0, 1, 4);

// Camera Controls
const controls = new THREE.OrbitControls(camera, renderer.domElement);
controls.maxPolarAngle = Math.PI / 2;
controls.minPolarAngle = Math.PI / 3;
controls.maxDistance = 5;
controls.minDistance = 3;
controls.autoRotate = true;
controls.autoRotateSpeed = 0.2;
controls.enableDamping = true;
controls.enablePan = false;
controls.addEventListener( "change", event => {
console.log( controls.object.position );
});
controls.update()
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda