This code works fine:
circlesGeometry = new THREE.CircleBufferGeometry(10, 32);
var material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
var mesh = new THREE.Mesh(circlesGeometry, material);
scene.add(mesh);
Then I trying add position:
circlesGeometry = new THREE.CircleBufferGeometry(10, 32);
circlesGeometry.addAttribute('position', new THREE.BufferAttribute(new Float32Array([0, 0, 0]), 3));
var material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
var mesh = new THREE.Mesh(circlesGeometry, material);
scene.add(mesh);
I have an error:
[.Offscreen-For-WebGL-0x7f9abda5ea00]GL ERROR :GL_INVALID_OPERATION : glDrawElements: attempt to access out of range vertices in attribute 0
What is wrong?