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

288
Views
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 answers
Answer question

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 Report
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!