How to use the TorusGeometry function from three
Find comprehensive JavaScript three.TorusGeometry code examples handpicked from public code repositorys.
GitHub: mattdesl/codevember
37 38 39 40 41 42 43 44 45 46
var play = document.querySelector('.play') let audio = new Audio() audio.crossOrigin = 'Anonymous' audio.src = src || defaultSrc const geometry = new THREE.TorusGeometry(0.95, 0.15, 65, 200) const freqLow = newArray(geometry.vertices.length, 0.0) const freqMid = freqLow.slice() const freqHigh = freqLow.slice()
52
242
10
GitHub: Holograf/Holograf
4 5 6 7 8 9 10 11 12
var geometries = {}; var PI = Math.PI; //--TorusGeometry(radius, tube, radialSegments, tubularSegments, arc) geometries.hexagon = new THREE.TorusGeometry(50, 10, 3, 3); //--OctahedronGeometry(radius, detail) geometries.functionDeclaration = new THREE.OctahedronGeometry(50);
9
26
5
+ 3 other calls in file
31 32 33 34 35 36 37 38 39 40
bevelThickness: bevelThickness, bevelSegments: 2, }; // create the base coin geometry let ringGeometry = new THREE.TorusGeometry( this.coinRadius, (0.1 * this.coinRadius), 8, 64 ); let cylGeometry = new THREE.CylinderGeometry( this.coinRadius, this.coinRadius, coinThickness, 16
2
7
1
50 51 52 53 54 55 56 57 58 59
/** SCENE ROOM SETUP * */ // add something glow // var neonPos = new THREE.Vector3(0,0,0) // const glowTorusGeo = new THREE.TorusGeometry(10, 0.5, 20, 60); // const glowMat = new THREE.ShaderMaterial({ // uniforms: {}, // vertexShader: GlowShader.vertexShader, // fragmentShader: GlowShader.fragmentShader,
0
3
3
45 46 47 48 49 50 51 52 53 54
renderer.setPixelRatio(window.devicePixelRatio); renderer.setSize(window.innerWidth, window.innerHeight); camera.position.setZ(30); renderer.render(scene, camera); // Torus const geometry = new THREE.TorusGeometry(15, 10, 16, 100); const material = new THREE.MeshStandardMaterial({ color: 0xFF6347 }); const torus = new THREE.Mesh(geometry, material); scene.add(torus); // Box
0
0
0
+ 4 other calls in file
three.Vector3 is the most popular function in three (22341 examples)