I'm developing a 2D game using Cocos2d-x.
Is possible to use CCBezierTo to parameterize a sine function?
Tell me more
×
Game Development Stack Exchange is a question and answer site for
professional and independent game developers. It's 100% free, no registration required.
|
Just use Bezier, giving 3 points in concave section, and another 3 in convex section, its easier than give all points to do a perfect sine, and the trajectory is the same. |
|||
|
|
|
You could create a Bézier curve that matches a sine (read this article for an example). Creating a Bézier curve from a sine, just to feed into I would skip |
|||
|
|
CCBezierTo. Is that right? – bummzack Jul 13 '12 at 7:41sinfunction in terms of polynomials (especially finite series) is mathematically impossible since the basis (be it Bernstein polynomials or your 1,x,,x^2,etc.. canonical one) is finite and cannot reproduce the taylor series of the sine function. You may find it faster to just use a truncated Taylor expansion of the sine. But if you aim to "draw" something, you can for sure mimic the images of some simple non-linear functions. (I wrote this comment just for the mathematical caveat.. no trolling intended :D). – teodron Jul 13 '12 at 8:28