How to use the SphereBufferGeometry function from three

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

173
174
175
176
177
178
179
180
181

// var directionalLight = new THREE.DirectionalLight( 0xffeedd );
// directionalLight.position.set( 0, 0, 1 ).normalize();
// scene.add( directionalLight );

// var sphereBufferGeometry = new THREE.SphereBufferGeometry( 5, 10, 10 );
// var material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
// // var material = new THREE.MeshNormalMaterial( {shading: THREE.FlatShading} );
// var sphere = new THREE.Mesh( sphereBufferGeometry, material );
fork icon5
star icon23
watch icon3

+ 2 other calls in file

123
124
125
126
127
128
129
130
131
132

Graphics.makeArtPiece = async ({ core, tasks, scene, camera, web }) => {
  const id = Graphics.getID()
  web.notify('loading texture....')
  let glsl = v => v[0]
  let geo = new THREE.SphereBufferGeometry(150, 128, 128)
  let mat = new THREE.ShaderMaterial({
    transparent: true,
    uniforms: {
      time: { value: 0 },
fork icon1
star icon9
watch icon3

164
165
166
167
168
169
170
171
172

// var dis = pos.length();
// pos.normalize();


// var vertexShapeGeometry = new THREE.SphereBufferGeometry(0.25, 8, 6);
// var vertexMesh = new THREE.Mesh( vertexShapeGeometry );
// vertexMesh.translateOnAxis(pos, dis);

fork icon4
star icon6
watch icon3

+ 3 other calls in file

47
48
49
50
51
52
53
54
55
56
    this._group.add(object);
}

drawSphere (penAttributes, radius, position) {
    this._addObjectFromGeometry(
        new three.SphereBufferGeometry(radius / 2),
        position,
        [0, 0, 0],
        penAttributes.color4f
    );
fork icon304
star icon0
watch icon10

+ 3 other calls in file

126
127
128
129
130
131
132
133
134
135
//geometry.attributes.normal.needsUpdate = true;
//geometry.attributes.color.needsUpdate = true;



//let baseGeometry = new THREE.SphereBufferGeometry(1.0, 20, 10);
//let material = new THREE.MeshStandardMaterial( );
//let material = new THREE.MeshStandardMaterial({ color: 0x2B2B2B });
//material.roughness = 0.2;
//material.metalness = 0.2;
fork icon3
star icon7
watch icon0

+ 2 other calls in file

372
373
374
375
376
377
378
379
380
381





let baseGeometry = new THREE.SphereBufferGeometry(1.0, 30, 20);

let material = new THREE.MeshStandardMaterial( );

material.roughness = 0.2;
fork icon3
star icon7
watch icon0

+ 2 other calls in file

383
384
385
386
387
388
389
390
391
392
         // aCurve.push(this.pos[i][0], this.pos[i][1], this.pos[i][2]);
         //aColor.push(.3 + .001*this.colors[i][0], .3+ .001*this.colors[i][1], .3+ .001*this.colors[i][2]);
         //aColor.push(this.colors[i][0], this.colors[i][1], this.colors[i][2]);
         
         //let mcolor = new THREE.Color(this.colors[i][0],  this.colors[i][1],  this.colors[i][2]);
         let baseGeometry = new THREE.SphereBufferGeometry(this.radius[i], 30, 20);
baseGeometry.attributes.position.needsUpdate = true;
         let material = new THREE.MeshStandardMaterial( );
         material.color = new THREE.Color(this.colors[i][0],  this.colors[i][1],  this.colors[i][2]);
         material.roughness = 0.2;
fork icon3
star icon7
watch icon0

3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
// aCurve.push(this.pos[i][0], this.pos[i][1], this.pos[i][2]);
//aColor.push(.3 + .001*this.colors[i][0], .3+ .001*this.colors[i][1], .3+ .001*this.colors[i][2]);
//aColor.push(this.colors[i][0], this.colors[i][1], this.colors[i][2]);

//let mcolor = new THREE.Color(this.colors[i][0],  this.colors[i][1],  this.colors[i][2]);
let baseGeometry = new THREE.SphereBufferGeometry(this.radius[i], 20, 10);
let material = new THREE.MeshStandardMaterial( );
material.color = new THREE.Color(this.colors[i][0],  this.colors[i][1],  this.colors[i][2]);
material.roughness = 0.2;
material.metalness = 0.2;
fork icon3
star icon7
watch icon1

+ 17 other calls in file

115
116
117
118
119
120
121
122
123
124
if(this.box.length>2){
    this.camera.position.z = 2*Math.abs(this.box[2]);
    
}

let baseGeometry = new THREE.SphereBufferGeometry(.3);
//let baseGeometry = new THREE.BoxBufferGeometry(1.0,1.0,1.0);
let instancedGeometry = new THREE.InstancedBufferGeometry().copy(baseGeometry);
let instanceCount = this.state.length;
instancedGeometry.maxInstancedCount = instanceCount;
fork icon3
star icon7
watch icon0

214
215
216
217
218
219
220
221
222
223

let testObject = new THREE.Object3D()
let testObjectOffset = new THREE.Vector3(x, y, z)
testObject.position.add(testObjectOffset)
let testSphere = (() => {
  let geometry = new THREE.SphereBufferGeometry(3)
  let material = new THREE.MeshBasicMaterial({ color: 0xffff00 })
  let mesh_ = new THREE.Mesh(geometry, material)
  return mesh_
})()
fork icon0
star icon0
watch icon1

+ 37 other calls in file

47
48
49
50
51
52
53
54
55
56
}
/**
 * @private
 */
Skybox.prototype.init = function () {
    var geometry = new THREE.SphereBufferGeometry(1e10, 32, 32);
    var fullTextureUrl = (0, util_1.getFullTextureUrl)(this.options.textureUrl, this.context.options.basePath);
    var texture = new THREE.TextureLoader().load(fullTextureUrl);
    var material = new THREE.MeshBasicMaterial({
        map: texture,
fork icon0
star icon0
watch icon1

+ 8 other calls in file

295
296
297
298
299
300
301
302
303
304
Simulation.prototype.initPasses = function () {
    //const smaaEffect = new SMAAEffect(assets.get("smaa-search"), assets.get("smaa-area"));
    //smaaEffect.colorEdgesMaterial.setEdgeDetectionThreshold(0.065);
    var camera = this.camera.get3jsCamera();
    /*
    const sunGeometry = new THREE.SphereBufferGeometry(
      rescaleNumber(0.004),
      16,
    );
    const sunMaterial = new THREE.MeshBasicMaterial({
fork icon0
star icon0
watch icon1

+ 8 other calls in file

638
639
640
641
642
643
644
645
646
647
    return this.changeProjection_(autoProjection);
  }

  return this.changeProjection_('NONE');
} else if (projection === '360') {
  this.movieGeometry = new THREE.SphereBufferGeometry(256, 32, 32);
  this.movieMaterial = new THREE.MeshBasicMaterial({
    map: this.videoTexture,
    overdraw: true,
    side: THREE.BackSide
fork icon0
star icon0
watch icon1

+ 20 other calls in file

175
176
177
178
179
180
181
182
183
184
space.rotation.z = Math.PI * 0.58;

scene.add(space);

// Sun
//const sunShaderGeometry = new THREE.SphereBufferGeometry(4.638, 64 / k, 64 / k);
//const sunShaderMaterial = new THREE.ShaderMaterial({ fragmentShader: sunFragmentShader });

//sun = new THREE.Mesh(sunShaderGeometry, sunShaderMaterial);
//scene.add(sun);
fork icon0
star icon0
watch icon0

+ 2 other calls in file

328
329
330
331
332
333
334
335
336
337
if (type[0] === 'C')
    geometry = new THREE.SphereBufferGeometry(scale*1.7, detail, detail);
else if (type[0] === 'N')
    geometry = new THREE.SphereBufferGeometry(scale*1.55, detail, detail);
else if (type[0] === 'O')
    geometry = new THREE.SphereBufferGeometry(scale*1.52, detail, detail);
geometry.translate(pos[0], pos[1], pos[2]);
var material = new THREE.MeshPhongMaterial({color: atomColors[type.toString()], shininess: 25});
var mesh = new THREE.Mesh(geometry, material);
mesh.name = type;
fork icon0
star icon0
watch icon1

+ 8 other calls in file

1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
    return this.changeProjection_(autoProjection);
  }

  return this.changeProjection_('NONE');
} else if (projection === '360') {
  this.movieGeometry = new THREE.SphereBufferGeometry(256, this.options_.sphereDetail, this.options_.sphereDetail);
  this.movieMaterial = new THREE.MeshBasicMaterial({
    map: this.videoTexture,
    overdraw: true,
    side: THREE.BackSide
fork icon0
star icon0
watch icon0

+ 6 other calls in file

25
26
27
28
29
30
31
32
33

        return new THREE.Line( geometryPoints, new THREE.LineBasicMaterial( { color: 0xFF0000, linewidth: 3 } ) );
}

export const createSphere = () => {
        let geometry = new THREE.SphereBufferGeometry( 4, 20, 20 );
        let material = new THREE.MeshNormalMaterial();
        return new THREE.Mesh(geometry, material);
}
fork icon0
star icon0
watch icon1

58
59
60
61
62
63
64
65
66
67
/**
 * 创建指定材质球
 * @return {[type]} [description]
 */
const createSphere = (material) => {
        let geometry = new THREE.SphereBufferGeometry( 5, 50, 50 );
        return new THREE.Mesh(geometry, material);
}
/**
 * 创建指定材质立方体
fork icon0
star icon0
watch icon1

Other functions in three

Sorted by popularity

function icon

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