如何在C ++中实现Bézier曲线? [英] How do I implement a Bézier curve in C++?

查看:145
本文介绍了如何在C ++中实现Bézier曲线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实施Bézier曲线。我以前在C#这样做,但我完全不熟悉C ++库。

I'd like to implement a Bézier curve. I've done this in C# before, but I'm totally unfamiliar with the C++ libraries. How should I go about creating a quadratic curve?

void printQuadCurve(float delta, Vector2f p0, Vector2f p1, Vector2f p2);

显然,我们需要使用线性插值,但是这是否存在于标准数学库中?如果没有,我在哪里可以找到它?

Clearly we'd need to use linear interpolation, but does this exist in the standard math library? If not, where can I find it?

推荐答案

你之前使用过C#库吗?

Did you use a C# library earlier?

在C ++中,没有用于Bezier曲线的标准库函数。您可以自己滚动(CodeProject 示例)或查找数学库。

In C++, no standard library function for Bezier curves is available (yet). You can of course roll your own (CodeProject sample) or look for a math library.

这个博客帖子解释了这个想法很好,但在Actionscript。翻译不应该有什么问题。

This blogpost explains the idea nicely but in Actionscript. Translation should not be much of a problem.

这篇关于如何在C ++中实现Bézier曲线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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