-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
[DOCS] Add computeBoundingSphere Information #14283
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
Closed
Closed
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7c1fc71
Add computeBoundingSphere information
XanderLuciano 385fad5
Improved description
XanderLuciano fbc908f
Removed extra words
XanderLuciano d5e3a59
reworded to clarify usage
XanderLuciano e474d79
Removed misleading recommendation
XanderLuciano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,6 +113,20 @@ <h3>[page:BufferGeometry]</h3> | |
| <code> | ||
| line.geometry.attributes.position.needsUpdate = true; // required after the first render | ||
| </code> | ||
|
|
||
| <p> | ||
| If you change the position data values after the initial render, you should also call | ||
| `.computeBoundingSphere()` on the object to recalculate it's bounding sphere. | ||
| The bounding sphere is used in calculations such as raycasting and frustrum culling. | ||
| If this method id not called after vertices are changed, you are likely to run into | ||
| strange side effects due to Three.js failing to properly identify the correct boundary | ||
| of your object. This may cause bugs succh as an object that doesn't properly | ||
| recieve raycasts on the entire object, or is frustrum culled too | ||
| early (such as when close to the edge of the screen). | ||
| </p> | ||
| <code> | ||
| line.geometry.computeBoundingSphere(); // recommended after the first render | ||
|
||
| </code> | ||
|
|
||
| <p> | ||
| [link:http://jsfiddle.net/w67tzfhx/ Here is a fiddle] showing an animated line which you can adapt to your use case. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a tutorial, so just the first sentence is all that is necessary.
@Mugen87 Maybe there are better places to mention this...
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Um, I thought the pages in the manual section (not the API reference) have actually tutorial/guide character. Seems to be the right place for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think we need to emphasize bugs that can result from logic errors on the part of the user.
The most accurate statement is something like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestions! Updated accordingly.