How to use the OctahedronBufferGeometry function from three
Find comprehensive JavaScript three.OctahedronBufferGeometry code examples handpicked from public code repositorys.
14 15 16 17 18 19 20 21 22 23
}; this.obj; } createObj() { // Define Geometry const geometry = new THREE.OctahedronBufferGeometry(50, 5); // Define Material const material = new THREE.RawShaderMaterial({ uniforms: this.uniforms,
260
0
2
24 25 26 27 28 29 30 31 32 33
}, }; this.obj = this.createObj(); } createObj() { const geometry = new THREE.OctahedronBufferGeometry(90, 4); const positions = geometry.attributes.position.array; const faceNormalsBase = []; const centersBase = []; const delaysBase = [];
260
0
2
11 12 13 14 15 16 17 18 19 20
}; this.obj = null; } createObj() { // Define Geometry const geometry = new THREE.OctahedronBufferGeometry(450, 3); // Define Material const material = new THREE.RawShaderMaterial({ uniforms: this.uniforms,
260
0
2
GitHub: shaungt1/sketch-threejs
22 23 24 25 26 27 28 29 30 31
} createObj() { const geometry = new THREE.InstancedBufferGeometry(); // Setting BufferAttribute const baseGeometry = new THREE.OctahedronBufferGeometry(30, 4); geometry.copy(baseGeometry); // Setting InstancedBufferAttribute const radian = new THREE.InstancedBufferAttribute(new Float32Array(this.instances), 1);
260
0
0
10 11 12 13 14 15 16 17 18 19
}, }; this.obj = this.createObj(); } createObj() { const geometry = new THREE.OctahedronBufferGeometry(150, 4); return new THREE.Mesh( geometry, new THREE.RawShaderMaterial({ uniforms: this.uniforms,
260
0
2
GitHub: jacaryr/sillyphysics
79 80 81 82 83 84 85 86 87 88 89 90
let sw = false; animate(); function makeSphere() { const sphere = new THREE.Line( new THREE.OctahedronBufferGeometry(1, 4), new THREE.MeshPhongMaterial({ color: 0x8d7619,
0
0
0
GitHub: AlexRogalskiy/threejs
25 26 27 28 29 30 31 32 33 34
init(renderer) { this.obj = this.createObj(renderer); } createObj(renderer) { const detail = (window.innerWidth > 768) ? 8 : 6; const geometry = new THREE.OctahedronBufferGeometry(100, detail); const verticesBase = geometry.attributes.position.array; const vertices = []; for (var i = 0; i < verticesBase.length; i+= 3) { vertices[i + 0] = verticesBase[i + 0] + (Math.random() * 2 - 1) * 10;
0
0
1
three.Vector3 is the most popular function in three (22341 examples)