How to use the TorusGeometry function from three

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

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()
  
fork icon52
star icon242
watch icon10

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);
fork icon9
star icon26
watch icon5

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

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

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

+ 4 other calls in file

Other functions in three

Sorted by popularity

function icon

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