How to use the Uint32BufferAttribute function from three
Find comprehensive JavaScript three.Uint32BufferAttribute code examples handpicked from public code repositorys.
GitHub: tentone/geo-three
1256 1257 1258 1259 1260 1261 1262 1263 1264 1265
const martini = new Martini(gridSize); const tile = martini.createTile(terrain); const { vertices, triangles } = tile.getMesh(typeof this.meshMaxError === 'function' ? this.meshMaxError(this.level) : this.meshMaxError); const attributes = MapMartiniHeightNode.getMeshAttributes(vertices, terrain, tileSize, [-0.5, -0.5, 0.5, 0.5], this.exageration); this.geometry = new three.BufferGeometry(); this.geometry.setIndex(new three.Uint32BufferAttribute(triangles, 1)); this.geometry.setAttribute('position', new three.Float32BufferAttribute(attributes.position.value, attributes.position.size)); this.geometry.setAttribute('uv', new three.Float32BufferAttribute(attributes.uv.value, attributes.uv.size)); this.geometry.rotateX(Math.PI); var texture = new three.Texture(image);
75
468
0
804 805 806 807 808 809 810 811 812 813
coneAttributes.indices.value.push(ix21); ix21 += 1; } }); coneGeom.setIndex( new THREE.Uint32BufferAttribute(coneAttributes.indices.value, 1) ); coneGeom.setAttribute( "position", new THREE.Float32BufferAttribute(coneAttributes.vertices.value, 3)
7
21
0
+ 3 other calls in file
210 211 212 213 214 215 216 217 218 219
case Uint32Array: attributeData = new dracoDecoder.DracoUInt32Array(); decoder.GetAttributeUInt32ForAllPoints( dracoGeometry, attribute, attributeData); geometryBuffer[ attributeName ] = new Uint32Array( numValues ); TypedBufferAttribute = THREE.Uint32BufferAttribute; break; default: var errorMsg = 'THREE.DRACOLoader: Unexpected attribute type.';
4
26
0
+ 5 other calls in file
433 434 435 436 437 438 439 440 441
geometry.drawMode = this.drawMode; if (geometryType == dracoDecoder.TRIANGULAR_MESH) { geometry.setIndex( new (geometryBuffer.indices.length > 65535 ? THREE.Uint32BufferAttribute : THREE.Uint16BufferAttribute)(geometryBuffer.indices, 1) ); }
3
7
8
+ 29 other calls in file
301 302 303 304 305 306 307 308 309 310
if (this.generateUVs) { this.uvs = new Float32Array(maxVerts * 2); } // Populate the mesh this.fillMesh(0); this.setIndex(new three_1.Uint32BufferAttribute(this.indices, 1)); this.positionAttribute = new three_1.Float32BufferAttribute(this.vertices, 3); this.setAttribute('position', this.positionAttribute); if (this.generateUVs) { this.uvsAttribute = new three_1.Float32BufferAttribute(new Float32Array(this.uvs), 2);
1
3
0
three.Vector3 is the most popular function in three (22341 examples)