
>图形学<
文章平均质量分 54
DT2131
Rage, rage against the dying of the light.Do not go gentle into that good night.
展开
-
直线与椭圆画法
画法的原理参考教科书就行,这里给出自己写的代码(可能有BUG)包含BHLine(BH直线)mpline(中点直线)DDAline(DDA直线,可能有问题,线条不太顺)MDcircle(中点画圆)BHcircle(BH画圆)MDellipse(中点画椭)除算法本身外的必要函数使用了EasyX库,在此感谢 EasyX 团队。//#include #include #include #includ原创 2018-01-01 22:52:09 · 662 阅读 · 0 评论 -
图形的填充
搜索可能是最笨的图形填充方法了,简单写了一遍。DFS为了防止爆栈手动扩了一下栈应该够用了,或者改 BFS 弄,其实都一样。使用了EasyX图形库,对 EasyX 团队表示感谢#include #include #include #pragma comment(linker, "/STACK:102400000,102400000")using namespace std;i原创 2018-01-01 23:03:52 · 659 阅读 · 0 评论 -
图形的伸缩,错切等变化
在此以二维图形为例,扩展到更高维思路都是一样的,明白变化矩阵就都明白了。使用了 EasyX 图形库,对 EasyX 团队表示感谢#include #include #include typedef struct Node { int x, y, z;}Node;typedef struct Matrix { int a, b, p, c, d, q, k, m, s;原创 2018-01-01 23:08:32 · 1262 阅读 · 0 评论 -
二次插值样条曲线
二次插值样条曲线补首尾的画法N 为点数+2,虚拟首尾DIV 代表曲线细分的程度使用了 EasyX 图形库,感谢 EasyX 团队#include #include #include using namespace std;typedef struct Node { int x, y;}Node;const int N = 8 + 2;const int DIV原创 2018-01-01 23:14:58 · 2868 阅读 · 0 评论 -
基础Bezier曲线
N 为点数DIV 为曲线细分程度使用了 EasyX 图形库,感谢 EasyX 团队#include #include #include using namespace std;typedef struct Node { int x, y;}Node;const int MAXN = 1007;const int N = 8;const int W = N - 1;c原创 2018-01-01 23:19:28 · 611 阅读 · 0 评论