基於OpenGL畫五角星

首先需要配置好OpenGL環境 邏輯其實很簡單,計算好五個角的座標然後連起來就OK了 #include <GL/glut.h> #include <math.h> float PI = 3.1415926f; float R = 1.0f; void Show() { glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_LINE_LOOP);
相關文章
相關標籤/搜索