卡特莫尔-ROM样条为Android莫尔、卡特、Android、ROM

2023-09-09 21:12:28 作者:十里红妆桃花飘

我试图找到一种方式来实现,通过N点平滑画线的目的,在Android平台上的Catmull-ROM样条。理想情况下,我将能够通过路径及其cubicTo方法,在这个线程提到适应立方米贝济耶:How我在Android中画出一条曲线通过植树点?

I'm trying to find a way to implement catmull-rom splines on the android platform for the purpose of smoothly drawing a line through n points. Ideally I would be able to adapt cubic beziers via the Path and its cubicTo method as alluded to in this thread: How do I draw a curve through tree points in Android?

不幸的是,我不是能够遵照执行有,所以我希望有人在那里已经做到了这一点,并可以共享的样本code的几行。

Unfortunately, I wasnt able to follow the implementation there so I'm hoping somebody out there has already done this and can share a few lines of sample code.

谢谢!

推荐答案

为Android这个游戏的开发库似乎有卡特莫尔-ROM样条 实施:的http:// code。 google.com/p/libgdx/ 。

This game development library for Android seems to have Catmull-Rom splines implemented: http://code.google.com/p/libgdx/.

PS,你标记贝塞尔,这是不正确 - 这是一个使用控制点具有外部影响:)

p.s., you tagged Bezier, that's incorrect -- that's the type of curve that uses control points outside the curve which have external influences :)