本文介绍了平滑手绘自由形状的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个允许用户进行手绘的应用程序。问题是我在用户移动手指的点之间绘制线条,因此产生的形状有些锯齿状。

I am creating an app that allows the user to do some hand-drawing. The problem is I draw lines between the points where the user moved his finger so the resulting shape is somewhat jagged.

我的问题是如何平滑绘图?处理这种情况的最佳算法是什么?

My question is how can I smooth the drawing? What is the best algorithm for dealing with this kind of situation?

推荐答案

你可以使用某种(可能是它是如何工作的。我找不到它的源代码,但我认为这个的创建者使用了来自。你可以找到它的c代码和我在SO上也发现了。

There is also this very nice example of how it could work. I could not find source code for it but i think that creator of this one has used algorithm from Graphics Gems 1. You could find c code for it here and i have found on SO also this.

这篇关于平滑手绘自由形状的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 14:12