swat0284 Posted September 27, 2016 Share Posted September 27, 2016 Hello, i try to move mesh along 2 points using: BezierCurveEase(.6,.11,1,.53) and animationBezierTorus.setEasingFunction(bezierEase); but my app work like this:http://www.babylonjs-playground.com/#F9Z7K#0 i try to make that mesh move along this curve: http://cubic-bezier.com/#.6,.11,1,.53 Quote Link to comment Share on other sites More sharing options...
Temechon Posted September 27, 2016 Share Posted September 27, 2016 Hello, If you comment and uncomment the line #29, you can see the animation is correctly updated according to the beziers curve. Easing function won't change your animation, but its speed only. swat0284 1 Quote Link to comment Share on other sites More sharing options...
MasterK Posted September 28, 2016 Share Posted September 28, 2016 @Temechon he said his bezierCurve not behavior as normal. @swat0284 Maybe BABYLON.BezierCurveEase is not same as cubic-bezier? Quote Link to comment Share on other sites More sharing options...
fenomas Posted September 28, 2016 Share Posted September 28, 2016 @MasterK There isn't any (spatial) bezier curve here. ANIMATIONTYPE_VECTOR3 animates along a straight line from one point to another. Adding an easing function doesn't change the shape, just the timing. For a bezier-like path, I'd do something like: // in render loop var amt = // float value that animates from 0 .. 1 var dest = BABYLON.Vector3.lerp(controlPoint1, controlPoint2, amt) myMesh.position = BABYLON.Vector3.lerp(startPoint, dest, amt) Quote Link to comment Share on other sites More sharing options...
MasterK Posted September 28, 2016 Share Posted September 28, 2016 @fenomas I know that. ok. i won't look into this. but he can use self ease function to achieve his purpose. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.