2024年4月18日 星期四

啵咕咕的筆記week09

 #week09_0

老樣子freeglut 開新專案

#複習上周的最後

把opencv以及codeblock相關設定弄好裝好

把上週github倉庫抓下來

安裝git 開git bash

cd desktop

git clone 網址

cd 2024graphicsa

start .

資料夾複製桌面,改08-3變09-1

用notepad++改,記得存檔再用codeblocks開啟

#week09-2

新專案貼11行

#include <GL/glut.h>

void display()

{

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

glutSolidTeapot(0.3);

glutSwapBuffers();

}

int main(int argc, char*argv[])

{

glutInit(&argc, argv);

glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);

glutCreateWindow("week09-2");

glutDisplayFunc(display);

glutMainLoop();

}

畫另外三個

///glutSolidTeapot(0.3);

glutSolidCube(0.3);

///glutSolidTeapot(0.3);

///glutSolidCube(0.3);
glutSolidSphere(0.3, 30, 30);

同時出現

glPushMatrix();

        glTranslatef(-0.5,+0.3,0);

        glutSolidTeapot(0.3);

    glPopMatrix();

    glPushMatrix();

        glTranslatef(+0.0,+0.3,0);

        glutSolidCube(0.3);

    glPopMatrix();

glPushMatrix();

        glTranslatef(+0.5,+0.3,0);

        glutSolidSphere(0.3, 30, 30);

    glPopMatrix();

#week09-3

新專案貼week09-2

三段再複製貼上,y座標改負的,solid改wire






沒有留言:

張貼留言