Create a curve using given value

Hi i have some array value like
var points = [[7.05, 15.08, 4.23], [7.08, 14.78, 3.6], [7.14, 14.63, 3.47], [7.18, 14.96, 3.8], [7.23, 14.84, 3.61], [7.26, 14.7, 3.45], [7.30, 15.22, 4.20], [7.34, 15.30, 4.42], [7.38, 14.75, 3.32], [7.42, 15.82, 4.76]];

now i want to create a CreateCatmullRomSpline curve…

in my code
var catmullRoms = BABYLON.Curve3.CreateCatmullRomSpline(points,60,true);
var box = BABYLON.Mesh.CreateLines(“Box”, catmullRoms.getPoints(), scene);

this code not working please anyone guide me…how create a curve using above points…

Note: I dont need new BABYLOAN.Vector3([7.05, 15.08, 4.23)

my need is, instead of i giving another set of array points, that points too create a curve.

Or the set of array points is JSON file…any one can guide me how to create a curve using JSON file data…

Thankyou

points must be an array of Vector3s

You can change your points array of arrays using

points = points.map((el) => {
    return BABYLON.Vector3.fromArray(el)
}

1 Like

Thankyou so much @JohnK