How to use a file as a path

Hello

I exported a curve from blender to use it as a path. I want to create a mesh that follows this path.
The json file : curve_data.zip (835 Bytes) .
How to do it ?
Thank’s
Jean-Michel

Hello. I’m not super familiar with the topic but I found what I think to be a related? Hope this helps :slight_smile:

thank you @msDestiny14
But that’s not what I’m looking for; I have exported a curve according to this topic : Trying to load a Bezier Curve in the BabylonJS viewer from a glTF file (from Blender) - Questions - Babylon.js, but I don’t know how to use the data to create a path with babylonjs.

@Cedric might be able to help with this ?

Hello,

I have made progress in solving my problem.
I did not use the exported file but I noted all the points necessary to create my curve in blender. I created this curve in the playground https://www.babylonjs-playground.com/#1AU0M4#124
Now I would like to know how to make a mesh follow this path
Thank’s

The .json contains control points and handles. It doesn’t contain sample points so you will have to do the interpolation yourself ( by using this class for example : Babylon.js/math.path.ts at a29f41f79cd2c6d1c1e4374e04819c78db420375 · BabylonJS/Babylon.js · GitHub)

Or you can use the Curve3 class : Draw Curves - Babylon.js Documentation

Then, you can use the points as keyframe position to animate your mesh

I think the right_handle and left_handle are coordinates, so you can feed them in the curve3 interpolators.

You can check this doc page on animation : Animations - Babylon.js Documentation
And create an animation on mesh position.

1 Like