I'm struggling to dynamically generate a BezierCurve from arrays in JavaScript. I tried using push method, but it's not working as expected.
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);
Any suggestions on how to tackle this issue?