How to use the IcosahedronBufferGeometry function from three

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

27
28
29
30
31
32
33
34
35
36
    && config.point_sizes.data.length === positions.length / 3) ? config.point_sizes.data : null;
const {colorsToFloat32Array} = buffer;
const phongShader = THREE.ShaderLib.phong;
let i;
const boundingBoxGeometry = new THREE.BufferGeometry();
const geometry = new THREE.IcosahedronBufferGeometry(config.point_size * 0.5, meshDetail);
const colorMap = (config.color_map && config.color_map.data) || null;
let opacityFunction = (config.opacity_function && config.opacity_function.data) || null;
const colorRange = config.color_range;
const attribute = (config.attribute && config.attribute.data) || null;
fork icon115
star icon803
watch icon0

37
38
39
40
41
42
43
44
45
46
  geometry = new THREE.BoxBufferGeometry( parms[0], parms[1], parms[2] );
  material = new THREE.MeshPhongMaterial( {color: someColors[color], shading: THREE.FlatShading} );
  shape = new CANNON.Box(new CANNON.Vec3(parms[0] / 2, parms[1] / 2, parms[2] / 2));
  break;
case 'moon':
  geometry = new THREE.IcosahedronBufferGeometry( parms[0], 1 );
  material = new THREE.MeshPhongMaterial( {color: "#F8B195", shading: THREE.FlatShading} );
  shape = new CANNON.Sphere(parms[0]);
  break;
case 'sphere':
fork icon15
star icon47
watch icon10

32
33
34
35
36
37
38
39
40

const mesh = new THREE.Mesh(geometry, material);
scene.add(mesh);

const particle = new THREE.Mesh(
  new THREE.IcosahedronBufferGeometry(6),
  new THREE.MeshStandardMaterial({ color: 'pink' }),
);
scene.add(particle);
fork icon0
star icon0
watch icon0

Other functions in three

Sorted by popularity

function icon

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