Adrian3D

[Solved] 3D spline through its control points (e.g. BABYLON.Curve3.CreateCatmullRom)

8 posts in this topic

Hello Babylon.js Community,

I am trying to create a smooth 3D spline that goes through its control points.

I was reading through the Curve3 tutorial and started a playground attempt: http://www.babylonjs-playground.com/#1GXSPK#1

My guess is that I have to create the spline step-by-step somehow with the BABYLON.Curve3.continue() function!?!
Maybe I also miss a very simple approach to reach my goal?

Wishfull thinking:
Three.js offers exactly the spline I am looking for:

Would something like this be of interest for the Curve3 class in general, e.g.
var oMyNoBrainerCurve3 = new BABYLON.Curve3.CreateCatmullRom( Vector3[] );

Anyone can give me a hand? Any help is appreciated.

 

Share this post


Link to post
Share on other sites

you're right, this spline is not implemented for now in the Curve3 helpers. I could do it for you the next weeks, when I get some free time.

Meanwhile, you can always build your own with the integrated math function : 

http://doc.babylonjs.com/classes/2.5/vector3#static-catmullrom-value1-value2-value3-value4-amount-rarr-vector3-classes-2-5-vector3-

 code : https://github.com/BabylonJS/Babylon.js/blob/master/src/Math/babylon.math.ts#L1507

Share this post


Link to post
Share on other sites

@BitOfGold: This is awesome and exactly what I was looking for. Thank you so much.

 @jerome: I am not very familiar with pull and push requests nor TypeScript. But if you plan to add BABYLON.Curve3.CreateCatmullRom to the Curve3 class in future I will be happy to update the tutorial accordingly including the playground examples.

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.