THREE.BufferGeometryUtils.mergeBufferGeometries
See original GitHub issueI tried to merge a lot of cylinders, but the result was not expected. I didn’t know where the problem came out. Maybe it was a bug, but when I lowered the number of creation to 600 times code, who could help me, thank you very much!
var geos = [];
for (var i = 0; i < 1000; i++) {
var geo = new THREE.CylinderBufferGeometry(1, 1, 20, 16);
var pos = new THREE.Vector3();
pos.x = Math.random() * 800 - 400;
pos.z = Math.random() * 800 - 400;
geo.translate(pos.x, pos.y, pos.z);
geos.push(geo);
}
var bf_geo = THREE.BufferGeometryUtils.mergeBufferGeometries(geos);
var mergeMesh = new THREE.Mesh(bf_geo, new THREE.MeshLambertMaterial({ color: 0xff0000 }));
scene.add(mergeMesh);
Issue Analytics
- State:
- Created 5 years ago
- Comments:15
Top Results From Across the Web
BufferGeometryUtils#mergeBufferGeometries – three.js docs
A class containing utility functions for BufferGeometry instances. Methods. # .computeMikkTSpaceTangents ( geometry : BufferGeometry, MikkTSpace : Object, ...
Read more >How to use the "BufferGeometryUtils.js" for three.js?
THREE.BufferGeometryUtils is no part of the core but you can easily ... mergeBufferGeometries([geometry1, geometry2]); console.log(merged);
Read more >14b How to merge BufferGeometries three.js - YouTube
Learn how to merge different buffer geometries into a single buffer geometry to increase performance and treat different buffer geometries ...
Read more >MergeBufferGometry - CodePen
console.error( 'THREE.BufferGeometryUtils: .computeTangents() failed. Missing required attributes (index, position, normal or uv)' );.
Read more >Improve your Threejs performances with BufferGeometryUtils
MergeBufferGeometries put every Buffergeometries with the sames attributes together. Basically, if we use the same material twice in our scene ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
And I think you can remove
if ( indexOffset > 0 ) {
I think you can remove