-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
BufferGeometryUtils: Add mergeBufferGeometries() helper. #13241
Merged
mrdoob
merged 12 commits into
mrdoob:dev
from
donmccurdy:feat-gltfloader-buffergeometry-groups
Feb 27, 2018
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8aeac93
BufferGeometryUtils: Add .mergeBufferAttributes().
donmccurdy bf4968b
BufferGeometryUtils: Fix whitespace.
donmccurdy cfdaf90
GLTFLoader: Merge primitives when possible.
donmccurdy 5c825e3
BufferGeometryUtils: Add .mergeBufferGeometries().
donmccurdy 0566ee8
BufferGeometryUtils: More tests.
donmccurdy eb1ff2c
BufferGeometryUtils: Fix groups on indexed geometry.
donmccurdy 7e7ecde
GLTFLoader: Fix primitive merging with draw modes and/or skinned meshes.
donmccurdy 0173530
BufferGeometry: Add warning on .merge().
donmccurdy ff3911c
BufferGeometryUtils: Remove creation of groups in mergeBufferGeometri…
donmccurdy 788c7ee
GLTFLoader: Revert merging primitives.
donmccurdy fbbda22
BufferGeometryUtils: Add docs.
donmccurdy f006c62
BufferGeometryUtils: Update params in docs.
donmccurdy 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 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
This file contains 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<base href="../" /> | ||
<script src="list.js"></script> | ||
<script src="page.js"></script> | ||
<link type="text/css" rel="stylesheet" href="page.css" /> | ||
</head> | ||
<body> | ||
<h1>[name]</h1> | ||
|
||
<div class="desc"> | ||
A class containing utility functions for [page:BufferGeometry BufferGeometry] instances.<br /><br /> | ||
</div> | ||
|
||
|
||
<h2>Methods</h2> | ||
|
||
<h3>[method:null computeTangents]( [param:BufferGeometry geometry] )</h3> | ||
<div> | ||
geometry -- A [page:BufferGeometry BufferGeometry] instance, which must have index, position, normal, and uv attributes.<br /><br /> | ||
|
||
Calculates and adds tangent attribute to a geometry.<br /><br /> | ||
|
||
</div> | ||
|
||
<h3>[method:BufferGeometry mergeBufferGeometries]( [param:Array geometries] )</h3> | ||
<div> | ||
geometries -- Array of [page:BufferGeometry BufferGeometry] instances.<br /><br /> | ||
|
||
Merges a set of geometries into a single instance. All geometries must have compatible attributes. | ||
If merge does not succeed, the method returns null.<br /><br /> | ||
|
||
</div> | ||
|
||
<h3>[method:BufferAttribute mergeBufferAttributes]( [param:Array attributes] )</h3> | ||
<div> | ||
attributes -- Array of [page:BufferAttribute BufferAttribute] instances.<br /><br /> | ||
|
||
Merges a set of attributes into a single instance. All attributes must have compatible properties | ||
and types, and [page:InterleavedBufferAttribute InterleavedBufferAttributes] are not supported. If merge does not succeed, the method | ||
returns null. | ||
|
||
</div> | ||
|
||
<h2>Source</h2> | ||
|
||
[link:https://github.com/mrdoob/three.js/blob/master/examples/js/BufferGeometryUtils.js examples/js/BufferGeometryUtils.js] | ||
</body> | ||
</html> |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
BufferGeometry
doesn't have.userData
property. Perhaps onlyGLTFLoader
can set from glTFprimitive.extras
. (Any other loaders/modules can also set?) So, is this merging forGLTFLoader
special?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.
Oh, good point. Yes apparently it is glTF-specific. Probably deserves a comment, or maybe we can revisit whether GLTFLoader should do this..
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 don't think it's a good idea to pollute
BufferGeometry
with Three.js unofficial property. For example, it can be lost in serialization. I prefer officially adding.userData
property toBufferGeometry
.@mrdoob What do you think of adding
.userData
property toBufferGeometry
?