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

290
Visualizações
How to calculate the center position of the .dae file and reposition it?

I'm currently dealing with a lot of 3d models and I find that many of the models are centered off the center of the model. Is there a way to get the length (x), width (z), height (y) of the model, and divide it by two to calculate the confidence position of the model?

let loaderDae = new ColladaLoader();
loaderDae.load(`model.dae`, (dae: any) => {
      this.buildingModel = dae.scene;
      // Is there a way to get the length, width and height of the model and calculate the center point?
      this.buildingModel.position.set(x_length/2, y_length/2, z_length/2);
      this.sceneS.add(this.buildingModel);
});

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Create a bounding box then get the size of the bounding box with getSize()

let bbox = new THREE.Box3().setFromObject(this.buildingModel);
let dimensions = new THREE.Vector3();
dimensions = bbox.getSize(dimensions);
this.buildingModel.position.set(dimensions.x/2, dimensions.y/2, dimensions.z/2);

For the avoidance of doubt, this code should work with all supported 3D model file types.

about 4 years ago · Juan Pablo Isaza Relatório
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