CatmullRomSpline not working

Can someone tell me what I am doing wrong, I am not able to get the CatmullRomSpline working its giving me and error.

I tried to insert the following code to the Polyline example:-

var spline = new Cesium.CatmullRomSpline(controlPoints);

//catmulrom spline.

var controlPoints = [

{point: new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0), time: 0.0},

{point: new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0), time: 1.5},

{point: new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0), time: 3.0},

{point: new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0), time: 4.5},

{point: new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0), time: 6.0}


But its giving me the following error:-

Uncaught DeveloperError: controlPoints is required and must be an array of objects with point and time properties, with a length of at least 3.
at new DeveloperError (http://localhost/cesium/Source/Core/DeveloperError.js:44:22 )
at new CatmullRomSpline (http://localhost/cesium/Source/Core/CatmullRomSpline.js:51:19 )
at createPrimitives (http://localhost/cesium/Apps/Sandcastle/gallery/Polylines.html:44:16 )
at <error: illegal access>
at runFactory (http://localhost/cesium/ThirdParty/dojo-release-1.8.3-src/dojo/dojo.js:1094:43 )
at execModule (http://localhost/cesium/ThirdParty/dojo-release-1.8.3-src/dojo/dojo.js:1223:5 )
at http://localhost/cesium/ThirdParty/dojo-release-1.8.3-src/dojo/dojo.js:1258:6
at guardCheckComplete (http://localhost/cesium/ThirdParty/dojo-release-1.8.3-src/dojo/dojo.js:1238:5 )
at checkComplete (http://localhost/cesium/ThirdParty/dojo-release-1.8.3-src/dojo/dojo.js:1253:4 )
at onLoadCallback (http://localhost/cesium/ThirdParty/dojo-release-1.8.3-src/dojo/dojo.js:1415:7)

It would be really helpful if someone could help me and tell me what i am doing wrong

Now it is not showing any errors when i bring :-var spline = new Cesium.CatmullRomSpline(controlPoints);

below the control points but nothing is being shown on the map. Why isn’t it plotting anything?

Yea i got it working :slight_smile: idid not use any visualizers then. But i need one help. I tried plotting using hermitespline, it looks like this

is there any way i can make the plotted curve look better? Something like below:

In the cesium plotted one the curve looks a bit awkward compared to this one, is there any way i can make it good like this?