函数结构及参数:
void DrawCircle(GLfloat R)
int load_texture(char* file_name, int width, int height, int depth, GLenum
colour_type, GLenum filter_type)
void LoadTextures(GLuint texture_id, int MaxNrOfTextures)
void timerFunc(int nTimerID)
void display(void)
void reshape(int w, int h)
void init(void)
int main(int argc, char** argv)
主要函数功能:
void DrawCircle(GLfloat R)
绘制圆形曲线,以便能够清晰地看出行星运行的轨道,并且在转换观察角度时能够
更加明显的看到变化。
int load_texture(char* file_name, int width, int height, int depth, GLenum
colour_type, GLenum filter_type)
将纹理与纹理的名称绑定,在不同的行星上使用不同的纹理,以不同的图片文件名
作为参数,调用 LoadTextures(GLuint texture_id, int MaxNrOfTextures)函数,对图
片文件进行处理。
void LoadTextures(GLuint texture_id, int MaxNrOfTextures)
使用 fopen_s()函数,打开图片文件,对文件进行处理,设置过滤类型与纹理环境。
void timerFunc(int nTimerID)
设置定时器,使行星可以按照设定好的固定速度自动旋转,规定行星的运行方式。
void display(void)
绘制所有的行星与曲线,并对其图案、位置与旋转中心进行设定。
void reshape(int w, int h)
定义观察方式,使用 gluLookAt(0.0, -12.0, 7.0, 0.0, 0.0, 0.0, 0.0, 1.0,
0.0);函数,控制观察角度。
评论0