2021年3月10日 星期三

Week03 graphics💥💥💥

 

1.註冊GitHub帳號

2.認證EMAIL然後換大頭貼

3. ADD FILE然後上傳照片裡的檔案



1.Code Blocks, File-New-Project , Glut

. Moodle 下載 freeglut 安裝在桌面
\


把下載好的檔案移進桌面 然後再移到桌面裡面的檔案裡
2.Name Desktop
C:\Users\......\desktop\freeglut.....
3.....下一步....下一步
看到下面的圖片就完成了

4.持續上傳檔案 OPEN GL GLUT💬💬💬


進行一個圓的程式

#include <GL/glut.h>

void display()

{

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    glColor3d(1,0,0);

    glutSolidSphere(0.5,30,30);

    glutSwapBuffers();

}

int main(int argc, char**argv)

{

    glutInit( &argc, argv);

    glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);

    glutCreateWindow("Week03-circle");

    glutDisplayFunc( display);


    glutMainLoop();

}


#include <GL/glut.h>

#include <math.h>

void display()

{

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    glColor3d(1,0,0);

    glBegin(GL_POLYGON);

    for( int i=0; i<30; i++){

        float a = 3.1415926 * 2 / 30 *i;

        glVertex2f( 0.5+0.1*cos(a) ,0.2*sin(a) );

    }

    glEnd();

    glutSwapBuffers();

}

int main(int argc, char**argv)

{

    glutInit( &argc, argv);

    glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);

    glutCreateWindow("Week03-circle");

    glutDisplayFunc( display);


    glutMainLoop();

}


沒有留言:

張貼留言

距地表面160 Week11

 #include "glm.h" GLMmodel* pmodel = NULL; void drawmodel(void) {     if (!pmodel) { pmodel = glmReadOBJ("data/porsche.obj...