仅供个人学习记录使用,如有错误,感谢指正!!!!!!!!!!
#define _CRT_SECURE_NO_WARNINGS
#include<stdlib.h>
#include<math.h>
#include<Windows.h>
#include<stdio.h> //86
#include<GL/glut.h>
void Init() {
glClearColor(0.7f, 0.8f, 1.0f, 0.0f); //浅蓝//rgb透明度 背景色
}
void Reshape(int w,int h) {
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0, (double)w,0,(double)h);
}
void myDisplay() { //金刚石 400 400 100//由团扇变化而来
int x0, y0, r;
scanf("%d %d %d", &x0, &y0, &r);
int i, n = 20;
float st;
glClear(GL_COLOR_BUFFER_BIT);
st = (360.0 / n) * (3.14 / 180);//角度转换为弧度

这篇文章展示了如何使用C++和OpenGL库在Windows环境中创建一个简单的图形程序,通过输入参数绘制金刚石形状的线条。
最低0.47元/天 解锁文章
3338

被折叠的 条评论
为什么被折叠?



