-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
computeBoundingBox() on TextGeometry throws exception #3318
Comments
The geometry of text when used with A-Frame is usually a plane/box which is more appropriate to call the compute bbox on, and it won't match the precise bounds of the text anyways since it can be longer than the text. I use a formula The TextGeometry is probably created by the |
Cool. I'll go check out |
I think this may be related. Made a pr on threejs which should fix this issue. |
Related: n5ro/aframe-physics-system#74 |
@Adam4lexander Is this fixed after your PR? |
@dmarcos no I wasnt able to resolve it. The problem turned out to be specific to the |
It seems it was a bug on |
Is there a bug filed? Experience-Monks/three-bmfont-text#32? That's partly a design decision, that it uses x/y coordinates in the geometry rather than x/y/z, but it seems to have a bounding box method included to deal with it: https://github.com/Jam3/three-bmfont-text/blob/master/index.js#L111-L124 if there's no bug for this on the repo let's file one |
Is there a solution to this? This will occasionally pop up under console and the error is preventing the page to finish loading. I have to refresh the page to sometimes "get past this error", which is odd to me. I guess it's some type of "order of operation" issue or assets not loading in a timely fashion? Is there a way to not use three-bmfont-text? |
I got the same error. Is there a fix? |
@christianvari #4618 (comment) seemed to have fixed my issue. |
@NomisGnos thank you for your reply. The problem is that I havent a raycaster or a cursor. I need to compute the bounding box of an aframe entity that contains an a-text. |
@christianvari did you find any way around ? |
hi, is there a fix for this issue yet? I've been jumping across several Github issues and different repositories, and I can't seem to find a universal fix 😢. I found a few issues pertaining to raycasters and I'm experiencing the issue with: const text = this.el.components.text;
text.geometry.computeBoundingBox();
const textWidth =
((text.geometry.boundingBox.max.x - text.geometry.boundingBox.min.x) /
text.currentFont.widthFactor) *
0.025;
this.indicatorImage.object3D.position.setX(-(textWidth / 2 + 0.02)); I'm on Aframe VR version 1.2.0 and had the same issue with older versions. The error occurs on different browsers (Edge/Chrome on macOS and Windows). |
Calling
computeBoundingBox()
on aTextGeometry
generated by<a-text>
throws the following exceptionThe text was updated successfully, but these errors were encountered: