通过随机点绘制好看的贝塞尔曲线 [英] Draw good-looking Bezier Curve through random points

查看:177
本文介绍了通过随机点绘制好看的贝塞尔曲线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用JavaScript与RaphaelJS通过随机点绘制流畅的线条,并将其输出到SVG。
该行严格水平,不返回轴X.
目前,我使用三次Bezier曲线来绘制一条线到另一条线。

I'm using javascript with RaphaelJS to draw a smooth line through random points with output to SVG. The line goes strictly horizontally, without returning back in axis X. Currently, I'm using cubic Bezier curves to draw the line from one point to another.

问题是,线路看起来不够好。两条曲线在一个点上有一个难看的连接,一条曲线结束,另一条曲线开始,关节中的角度非常随机。
如何让上一条曲线顺利转换为下一条曲线,同时仍然保持线条通过给定点?

Problem is, the line doesn't look good enough. Two curves have an unsightly join at a point, where one curve ends and another curve starts, with quite random angle in the joint. How do I get the previous curve to transform into next one smoothly, while still keeping the line passing through given point?

推荐答案

Catmull-Rom曲线适用于通过点。 http://schepers.cc/getting-to-the-point

Catmull-Rom curves work well for going through points. http://schepers.cc/getting-to-the-point

这篇关于通过随机点绘制好看的贝塞尔曲线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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