How to use the ShapeBufferGeometry function from three

Find comprehensive JavaScript three.ShapeBufferGeometry code examples handpicked from public code repositorys.

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
fork icon4
star icon7
watch icon1

+ 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),
fork icon1
star icon11
watch icon1

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) } ) );
fork icon0
star icon4
watch icon1

+ 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)
fork icon2
star icon3
watch icon1

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';
}
fork icon0
star icon1
watch icon2

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';
}
fork icon0
star icon0
watch icon2

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
fork icon0
star icon0
watch icon2

+ 3 other calls in file

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)