How to use the ShapeBufferGeometry function from three
Find comprehensive JavaScript three.ShapeBufferGeometry code examples handpicked from public code repositorys.
GitHub: zeesaas/Three-MapGL
58 59 60 61 62 63 64 65 66 67
} // 创建网格 createMesh(shape, options, name, isScience) { let geo = this.createGeometry() let geoPlane = new THREE.ShapeBufferGeometry(shape) let extrudeGeo = this.createExtrudeGeometry(shape) geo.fromBufferGeometry(extrudeGeo) geo.translate(-290, -214, 0) let mat
4
7
1
+ 3 other calls in file
110 111 112 113 114 115 116 117 118 119
this.meteoriteShape = new THREE.Shape(); this.meteoriteShape.moveTo(0, 0); this.meteoriteShape.absarc(0, 0, radius * 2, 0, Math.PI, false); this.meteoriteShape.lineTo(0, -this.chromeoriteTail * radius); this.meteoriteShape.lineTo(radius * 2, 0); this.meteoriteGeometry = new THREE.ShapeBufferGeometry( this.meteoriteShape ); const defaultMaterial = { color: new THREE.Color(0x000000),
1
11
1
124 125 126 127 128 129 130 131 132 133
let group = new THREE.Group(); group.position.z = i; // Setup shape, geometry, material and mesh let shape = new THREE.Shape( state.vertices ); let geometry = new THREE.ShapeBufferGeometry( shape ); geometry.computeBoundingBox(); let mesh = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { color: this._getColor(i, states.length), side: THREE.DoubleSide, transparent: true, opacity: this._getOpacity(i, states.length) } ) );
0
4
1
+ 3 other calls in file
53 54 55 56 57 58 59 60 61 62
color: new THREE.Color().setStyle("#FBDD11"), }) const shapes = path.toShapes(true) for (let j = 0; j < shapes.length; j++) { let shape = shapes[j] let geometry = new THREE.ShapeBufferGeometry(shape) let mesh = new THREE.Mesh(geometry, material) mesh.translateX(-87.5 / 2) mesh.translateY(-46 / 2) pathsGroup.add(mesh)
2
3
1
GitHub: mdbarr/terrain
34 35 36 37 38 39 40 41 42
return new Three.Geometry(); } const shapes = font.generateShapes(text, parameters.size); Three.ShapeBufferGeometry.call(this, shapes); this.type = 'TextShapeBufferGeometry'; }
0
1
2
GitHub: mdbarr/gum47
38 39 40 41 42 43 44 45 46
return new THREE.Geometry(); } const shapes = font.generateShapes(text, parameters.size); THREE.ShapeBufferGeometry.call(this, shapes); this.type = 'TextShapeBufferGeometry'; }
0
0
2
GitHub: dunkelstern/3dmap
87 88 89 90 91 92 93 94 95 96
return mesh; } // create a flat polygon from a shape without extruding it osmRenderer.prototype.flat = function (shape, material) { const geometry = new THREE.ShapeBufferGeometry(shape); const mesh = new THREE.Mesh(geometry, material); // as we create the mesh in X-Y direction we have to rotate it // to lay it in the X-Y plane to fly over it
0
0
2
+ 3 other calls in file
three.Vector3 is the most popular function in three (22341 examples)