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

293
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
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