1
我沒有找到正確的語法來從數組中動態生成一個BezierCurve,我試圖做一個推動,但它不工作。Three.js |動態生成一個BezierCurve
var x = [0,10,100,220,100, etc,...];
var y = [10,0,100,200,200, etc,...];
var z = [100,220,10,0,100, etc,...];
var points = [];
for(i=0; i < x.length; i++){
points.push(new THREE.Vector3(x[i], y[i], z[i]));
}
var curve = new THREE.CubicBezierCurve3(points);
var geometry = new THREE.Geometry();
var curveObject = new THREE.Line(geometry, material);
scene.add(curveObject);
一個想法?
['THREE.CubicBezierCurve3'](http://threejs.org/docs/#Reference /Extras.Curves/CubicBezierCurve3)不需要數組,它需要四(4)['THREE.Vector3'](http://threejs.org/docs/#Reference/Math/Vector3)。 –
RightAndré,THREE.CubicBezierCurve3採取4 Three.Vector3 MAXIMUM。 –