将对象与画布对齐到曲线 [英] Align objects to curve with canvas

查看:93
本文介绍了将对象与画布对齐到曲线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有可能吗?我现在正在学习画布,虽然以编程方式定位对象很有趣,但最有趣的是想出一种将它们与曲线对齐的方法。

Is it possible? I'm learning canvas at the moment, and while it's fun to position objects programmatically, it would be most interesting to come up with a way to align them to a curve.

例如

推荐答案

这是可能的,但是没有内置的API

It's possible but there's no built-in API to do it, afaik.

这意味着您需要使用第三方库(不确定是否可以这样做,但有很多例如Raphael,Processing.js等,你可以检出),或者建立自己的函数,这将是一个有点数学密集。

Which means you'd need to either use a third-party library (not sure of one that could do this, but there are plenty of libraries e.g. Raphael, Processing.js, etc. you could check out), or build your own functions, which would be a bit math-intensive.

这篇关于将对象与画布对齐到曲线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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