卡特莫尔-ROM样条为Android [英] catmull-rom splines for Android

查看:238
本文介绍了卡特莫尔-ROM样条为Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到一种方式来实现,通过N点平滑画线的目的,在Android平台上的Catmull-ROM样条。理想情况下,我将能够通过路径及其cubicTo方法,在这个线程提到适应立方米贝济耶:<一href="http://stackoverflow.com/questions/4712003/how-do-i-draw-a-curve-through-tree-points-in-android">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这个游戏的开发库似乎有<一个href="http://www.google.com/$c$csearch/p?hl=en#c5txscj0tnc/trunk/gdx/src/com/badlogic/gdx/math/CatmullRomSpline.java"相对=nofollow>卡特莫尔-ROM样条 <一href="http://www.google.com/$c$csearch/p?hl=en#c5txscj0tnc/trunk/tests/gdx-tests/src/com/badlogic/gdx/tests/SplineTest.java"相对=nofollow>实施:的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 :)

这篇关于卡特莫尔-ROM样条为Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆