Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

box3.intersectsPlane bug #14834

Closed
5 tasks done
shyf1301 opened this issue Sep 3, 2018 · 3 comments
Closed
5 tasks done

box3.intersectsPlane bug #14834

shyf1301 opened this issue Sep 3, 2018 · 3 comments
Labels

Comments

@shyf1301
Copy link

shyf1301 commented Sep 3, 2018

In the following example, the plane obviously intersects with the box, but the function intersectsPlane returns false.
example
I find that adding two negative sign before both of the plane.constant can fix the bug.

return ( min <= plane.constant && max >= plane.constant );

Also, I think the definition of the constant of the plane is not distinct, which cause the bug.

Three.js version
  • Dev
  • r96
  • ...
Browser
  • All of them
OS
  • All of them
@Mugen87
Copy link
Collaborator

Mugen87 commented Sep 3, 2018

Good find! Would you like to do a PR with the fix? It would be great if you also adjust the wrong unit test.

Also, I think the definition of the constant of the plane is not distinct, which cause the bug

three.js uses Hessian Normal Form, a common way to specify planes. I think okay to stick with that.

@Mugen87 Mugen87 added the Bug label Sep 3, 2018
@WestLangley
Copy link
Collaborator

@Mugen87 Something is wrong, then. Can you please figure out why your unit test did not catch this. #7445

@Mugen87
Copy link
Collaborator

Mugen87 commented Sep 3, 2018

The test was wrong, too. Fixed in #14836

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants