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

Docs: Better explain bounding volumes. #27744

Merged
merged 3 commits into from
Feb 15, 2024
Merged

Docs: Better explain bounding volumes. #27744

merged 3 commits into from
Feb 15, 2024

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Feb 14, 2024

Related issue: #27735

Description

This is a new attempt to better explain the bounding volumes in BufferGeometry, InstancedMesh and SkinnedMesh.

@Mugen87 Mugen87 added this to the r162 milestone Feb 14, 2024
@WestLangley
Copy link
Collaborator

@Mugen87 Thanks for having a go at this. Here is my proposal based on your initial version. Feel free to edit this post if you feel it is warranted, and I will have a second look.

I think it should be clear how difficult it is to make precise statements in these descriptions, and why a more-lengthy tutorial is more appropriate for this kind of information.

I'm thinking I'd prefer to simply describe what each method does and add something like: See "How To Update Things" for important info on when to call this method. "How To Update Things" could then be fully-detailed.

But either approach is fine with me, if you feel strongly about one or the other.

//

BufferGeometry

.computeBoundingBox()

Computes the bounding box of the geometry, and updates the .boundingBox attribute.

The bounding box is not computed by the engine; it must be computed by your app.

You may need to recompute the bounding box if the geometry vertices are modified.

.computeBoundingSphere()

Computes the bounding sphere of the geometry, and updates the .boundingSphere attribute.

The engine automatically computes the bounding sphere when it is needed, e.g., for ray casting or view frustum culling.

You may need to recompute the bounding sphere if the geometry vertices are modified.

InstancedMesh

.computeBoundingBox()

Computes the bounding box of the geometry, and updates the .boundingBox attribute.

The bounding box is not computed by the engine; it must be computed by your app.

You may need to recompute the bounding box if an instance is transformed via .setMatrixAt().

.computeBoundingSphere()

Computes the bounding sphere of the geometry, and updates the .boundingSphere attribute.

The engine automatically computes the bounding sphere when it is needed, e.g., for ray casting or view frustum culling.

You may need to recompute the bounding sphere if an instance is transformed via .setMatrixAt().

SkinnedMesh

.computeBoundingBox()

Computes the bounding box of the geometry, and updates the .boundingBox attribute.

The bounding box is not computed by the engine; it must be computed by your app.

If the skinned mesh is animated, the bounding box should be recomputed per frame.

.computeBoundingSphere()

Computes the bounding sphere of the geometry, and updates the .boundingSphere attribute.

The bounding sphere is automatically computed by the engine when it is needed, e.g., for ray casting and view frustum culling.

If the skinned mesh is animated, the bounding sphere should be recomputed per frame.

How-to-update-things

TODO

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Feb 15, 2024

I like the new wording very much so I've replaced the previous descriptions with the new ones.

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