question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect bounding box, collada model

See original GitHub issue
Description of the problem

In the latest version (r92) the stormtrooper collada model has an incorrect boundingBox. I tried the BoxHelper:

const box = new THREE.BoxHelper(object, 0xff0000);
scene.add(box);

or a manual approach:

const boundingBox = new THREE.Box3().setFromObject(trooper);
const size = boundingBox.getSize();
const center = boundingBox.getCenter();
const geometry = new THREE.BoxGeometry(size.x, size.y, size.z);
const material = new THREE.MeshBasicMaterial({ wireframe: true, color: 0x0000ff });
const box2 = new THREE.Mesh(geometry, material);
box2.position.set(center.x, center.y, center.z);
scene.add(box2);

Both approaches result in the model not being in the boundingbox: screen shot 2018-05-04 at 10 31 38

I already figured out that this started with r87, r86 didn’t have this issue: screen shot 2018-05-04 at 10 31 25

example code: r86: https://github.com/mrdoob/three.js/compare/r86...stijndeschuymer:bounding-box-test r87: https://github.com/mrdoob/three.js/compare/r87...stijndeschuymer:bounding-box-test-r87

I’m currently trying to figure out what causes this, but I’m quite new to three.js, so I’d highly appreciate it if someone pointed me in the right direction!

Three.js version
  • r92
  • r87
  • r86

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
stijndeschuymercommented, May 4, 2018

Thanks! I checked #11991 but I still have issues trying to draw a boundingbox, I’ll move this to stackoverflow https://jsfiddle.net/66sor15y/4/

1reaction
Mugen87commented, May 4, 2018

From my point of view, it’s not a bug. It works as designed.

Is there a way to get around this?

Read https://github.com/mrdoob/three.js/issues/11991 for more information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does THREE.BoundingBoxHelper not display?
It seems you are using a very old release of three.js . Besides, your collada() function is not synchronous. After executing collada("14",pobj); ...
Read more >
Bounding Box Collisions - General Help - jMonkeyEngine Hub
The problem is that when our boat model turns, the bounding box expands - causing incorrect collisions. Ignore the bigger bounding sphere, ...
Read more >
Bounding box messed up for .fbx models
I am trying to make bounding boxes for my models. My code works fine if the model is imported as a COLLADA (.dae)...
Read more >
Problem importing collada model - Gazebo: Q&A Forum
I exported it to a Collada file but when i load the model into gazebo some parts of the model disappeared. image description...
Read more >
ModelSceneSymbol in lat lon space - Esri Community
The collada are already projected to a specific lat lon. ... The offset appears to be the center of the models bounding box....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found