How to use the RingBufferGeometry function from three

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

10
11
12
13
14
15
16
17
18
19
  t.ok(Pathfinding, 'module loads');
  t.end();
});

test('create zone', (t) => {
  const geometry = new THREE.RingBufferGeometry(5, 10);
  const zone = Pathfinding.createZone(geometry);
  t.ok(zone, 'creates zone');
  t.equal(zone.groups.length, 1, 'zone contains one group');
  t.end();
fork icon110
star icon3
watch icon8

+ 5 other calls in file

12
13
14
15
16
17
18
19
20
21
  this.objWire = null;
  this.objPoints = null;
}
createObj() {
  // Define Geometry
  const geometry = new THREE.RingBufferGeometry(1550, 1600, 36, 2, MathEx.radians(135), MathEx.radians(270));

  // Define Material
  const material = new THREE.RawShaderMaterial({
    uniforms: this.uniforms,
fork icon260
star icon0
watch icon2

21
22
23
24
25
26
27
28
29
30
  const max = Math.max.apply(null, times);
  const avg = times.reduce(((t, acc) => t + acc), 0) / iterations;
  console.log(`${name}: min=${formatElapsed(min)} max=${formatElapsed(max)} avg=${formatElapsed(avg)}`);
}

const geometry = new THREE.RingBufferGeometry(5, 20, 50, 20);

run('Build navmesh', () => {
  const zone = Pathfinding.createZone(geometry);
}, 100);
fork icon110
star icon0
watch icon0

19
20
21
22
23
24
25
26
27
28
  t.end();
});

test('simple path', (t) => {
  const pathfinding = new Pathfinding();
  const geometry = new THREE.RingBufferGeometry(5, 10).applyMatrix4(ROTATE);
  const zone = Pathfinding.createZone(geometry);
  pathfinding.setZoneData(ZONE, zone);
  const a = new THREE.Vector3(7.5, 0, 0);
  const b = new THREE.Vector3(-7.5, 0, 0);
fork icon110
star icon0
watch icon0

+ 5 other calls in file

121
122
123
124
125
126
127
128
129
130

if (this.ringBufferMesh) {
    this.scene.remove(this.ringBufferMesh);
    this.ringBufferMesh = null;
}
var ringBufferGeometry = new THREE.RingBufferGeometry(
    8 * (1 - percent), 10 * (1 + percent), 20, 10, Math.PI, Math.PI * (1 + percent));
var ringBufferMaterial = new THREE.MeshBasicMaterial({
    color: 0xffff00,
    side: THREE.DoubleSide
fork icon3
star icon20
watch icon5

78
79
80
81
82
83
84
85
86
87
}

initCoinRing() {
  const scene = this.scene;

  const ringGeometry = new THREE.RingBufferGeometry(
    RADIUS,
    RADIUS + (THICKNESS / 2),
    SEGMENTS,
    1,
fork icon2
star icon3
watch icon2

+ 5 other calls in file

Other functions in three

Sorted by popularity

function icon

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