1樓:匿名使用者
重新給你找了個程式
#include
#include
#include
#define m_pi 3.14159265
static glfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
// 繪製齒輪的函式
// 輸入:inner_radius --- 齒輪孔的內徑
// outer_radius --- 齒輪的最大外徑
// width --- 齒輪的寬度
// teeth --- 齒輪中齒的個數
// tooth_depth --- 齒的深度
static void gear(glfloat inner_radius, glfloat outer_radius, glfloat width,
glint teeth, glfloat tooth_depth)
glend();
glbegin(gl_quads);
da = 2.0 * m_pi / teeth / 4.0;
for (i = 0; i < teeth; i++)
glend();
glbegin(gl_quad_strip);
for (i = 0; i < teeth; i++)
glvertex3f(r1 * cos(0), r1 * sin(0), width * 0.5);
glvertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5);
glend();
glbegin(gl_quad_strip);
for (i = 0; i <= teeth; i++)
glend();
}static void cricle(glfloat radius, glfloat hight,glint teeth)
glend();
glbegin(gl_********_fan);
for (i = 0; i <= teeth; i++)
glend();
glbegin(gl_quad_strip);
for (i = 0; i < teeth; i++)
glend();
/* glbegin(gl_quads);
da = 2.0 * m_pi / teeth / 4.0;
for (i = 0; i < teeth; i++)
glend();
glbegin(gl_quad_strip);
for (i = 0; i < teeth; i++)
glvertex3f(r1 * cos(0), r1 * sin(0), width * 0.5);
glvertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5);
glend();
glbegin(gl_quad_strip);
for (i = 0; i <= teeth; i++)
glend();*/
} static void draw(void)
static void reshape(int width, int height)
static void init(void)
;static glfloat red[4] = ;
static glfloat green[4] = ;
static glfloat blue[4] = ;
gllightfv(gl_light0, gl_position, pos);
glenable(gl_lighting);
glenable(gl_light0);
glenable(gl_depth_test);
glmaterialfv(gl_front, gl_ambient_and_diffuse, blue);
glenable(gl_normalize);
}main( )
2樓:匿名使用者
你沒有給出全部的函式,用空函式補上,除錯通過#include
#include
#include
void line(float a, float b, float c ,float d)
void detectgraph(int *a, int *b)void initgraph(int *a, int *b, char c)
void featurea(float x, float y, float d, float c1, float c2, float m, float z,float b ,float t)
void main()
誰能幫我解釋一下下面的C程式,C語言誰能幫我解釋一下這個程式裡for迴圈裡面每句的意思?
include define m sizeof unsigned int 8 定義常量來儲存sizeof unsigned int 8 其實為了輸入簡單點 int trans unsigned n,int d,char s buf i 0 dowhile n for j 0 s j buf i 0 ...
幫忙改一下這個c程式
你的明顯是有問題哈,下面就你的錯誤我改一下 注 沒有主函式,include class tdate void tdate setdate int y,int m,int d void tdate adddate case 2 case 4 case 6 case 9 case 11 default ...
求大神幫忙解決一下c語言程式的錯誤地方急急急
已經du改好,運zhi行結果dao會輸出專9 include int main void while x 1 printf d n i return 0 include int main void while x 1 printf d n i return 0 求c語言大神幫忙解決這道題。急急急!i...