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