0
我正在处理三个js.因为我在拖动多个对象时遇到了问题。基本上我想在此创建一个电子。我已经创建了一个使用球体几何和然后我将文本添加到球体中。但是当我移动该对象时,文本与球体分离。这是密码关于三个js中的分组
// Creating electron
var electron = new THREE.Mesh(
new THREE.SphereGeometry(0.5,1000),
new THREE.MeshPhongMaterial({color:'red',transparent: true, opacity: 0.7})
);
var loader1 = new THREE.FontLoader();
loader1.load('helvetiker_regular.typeface.json', function (font)
{
// Creating text
southGeometry = new THREE.TextGeometry('+', { font: font, size: 0.5, height:0.02, curveSegments: 7});
southMaterial = new THREE.MeshBasicMaterial({ color:'black' });
on = new THREE.Mesh(southGeometry ,southMaterial);
on.position.set(-0.2,-0.2, 1) ;
electron.add(on);
})
scene.add(electron);
objects.push(electron);