ドゥーブ氏は、サークルを作るための彼のフォーラム/サイトにこれを追加しました
var resolution = 100;
var amplitude = 100;
var size = 360 / resolution;
var geometry = new THREE.Geometry();
var material = new THREE.LineBasicMaterial( { color: 0xFFFFFF, opacity: 1.0} );
for(var i = 0; i <= resolution; i++) {
var segment = ( i * size ) * Math.PI / 180;
geometry.vertices.push( new THREE.Vertex( new THREE.Vector3( Math.cos( segment ) * amplitude, 0, Math.sin( segment ) * amplitude ) ) );
}
var line = new THREE.Line( geometry, material );
scene.add(line);
作成したいくつかの円を削除したいのですが、「 scene.remove(line) 」を使用してもうまくいきません...
PS
これは私のコードの一部で、1秒間円を作成した後、再びそれを取り除きたい.
var feetcircle;
var resolution = 100;
var amplitude = 140;
var size = 360 / resolution;
var geometry = new THREE.Geometry();
var material = new THREE.LineBasicMaterial({
color: 0x00FF00,
opacity: 1.0
});
for (var i = 0; i <= resolution; i++) {
var segment = (i * size) * Math.PI / 180;
geometry.vertices.push(new THREE.Vertex(new THREE.Vector3((Math.cos(segment) * amplitude) + (moves[move][move + '_mrfoot0'][0][0] * scale)-30, 0, (Math.sin(segment) * amplitude) + 375)));
}
for (var i = 0; i <= resolution; i++) {
var segment = (i * size) * Math.PI / 180;
geometry.vertices.push(new THREE.Vertex(new THREE.Vector3((Math.cos(segment) * amplitude) + (moves[move][move + '_mrfoot0'][0][0] * scale)-30, 410, (Math.sin(segment) * amplitude) + 375)));
}
for (var i = 0; i <= resolution; i++) {
var segment = (i * size) * Math.PI / 180;
geometry.vertices.push(new THREE.Vertex(new THREE.Vector3((Math.cos(segment) * amplitude) + (moves[move][move + '_mrfoot0'][0][0] * scale)-30, 285, (Math.sin(segment) * amplitude) + 375)));
}
feetcircle = new THREE.Line(geometry, new THREE.LineBasicMaterial({
color: 0x00ff00, opacity: 1.0
}));
feetcircle.geometry.dynamic = true;
scene.add(feetcircle);