0
我想在three.js中创建一个“U”形磁体。那么我可以使用TubeGeometry吗?three.js中的U形磁体几何形状
因此,如果这是用于创建3D罪曲线的代码。我怎样才能使它成为“U”形磁铁?
var CustomSinCurve = THREE.Curve.create(
function (scale) { //custom curve constructor
this.scale = (scale === undefined) ? 1 : scale;
},
function (t) { //getPoint: t is between 0-1
var tx = t * 3 - 1.5;
var ty = Math.sin(2 * Math.PI * t);
var tz = 0;
return new THREE.Vector3(tx, ty, tz).multiplyScalar(this.scale);
}
);
var path = new CustomSinCurve(10);
var geometry = new THREE.TubeGeometry(path, 20, 2, 8, false);
var material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });
var mesh = new THREE.Mesh(geometry, material);
scene.add(mesh);
这听起来像请求自由职业者的工作...... – dash2
我不明白你在说什么? – Naren
我的意思是这个问题没有简单的答案。唯一的答案是有人为你做所有的工作。 – dash2