2024年4月18日 星期四

week09

#week09-1_smaple
0.安裝freeglut 再把lib\libfreeglut複製成libglut32.a
1.File-New-Project,GLUT專案 week09-0_sampel










#複習上週week08-3
要把環境設好OpenCv
1.桌面有葉正聖老師上課用軟體OpenCV-2.1.0
2.小心:Add PATH
3.小心:目錄不要開
4.要重開Codeblocks


codblocks:setting-compiler
compilier的include要加入C:\OpenCV2.1\lib
-linker的lib要加入C:\OpenCV2.1\lib
-linker設定要加入cv210 cxcore210 highgui210

把上週的GitHub倉庫複製下來
0.安裝Git,開啟Git Bash小黑
1. cd desktop
2.git clone https://github.com/jsyeh/2024graphicsa
3.cd 2024graphicsa
4.start


把上週week08-3 glm_gundam_opencv_texture_lighting 開起來
1.File-open 到那個目錄,點開.cbp(codeblocks project檔)
2.build&run就可以

#把剛剛的專案,變成week09-1gundam_opencv_texture_lighting
把目錄,檔名,title改成week09-1














#week09-2
1.File-New-Project
2.貼上GLUT程式11行
#include <GL/glut.h>
void display()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glutPushMatrix();
glTranslatef(-0.5,+0.3,0);
glutSolidTeapot(0.3);
glPopMatrix();

glutPushMatrix();
glTranslatef(+0.0,+0.3,0);
glutSolidTeapot(0.3);
glPopMatrix();

    glutPushMatrix();
glTranslatef(+0.5,+0.3,0);
glutSolidTeapot(0.3,30,30);
glPopMatrix();
glutSwapBuffers();
}
int main(int argc, char*argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("week09 Microsoft Visual Studio");
glutDisplayFunc(display);
glutMainLoop();
}

week09-3
#include <GL/glut.h>
void display()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glutPushMatrix();
glTranslatef(-0.5,+0.3,0);
glutSolidTeapot(0.3);
glPopMatrix();

glutPushMatrix();
glTranslatef(+0.0,+0.3,0);
glutSolidTeapot(0.3);
glPopMatrix();

    glutPushMatrix();
glTranslatef(+0.5,+0.3,0);
glutSolidTeapot(0.3,30,30);
glPopMatrix();

glutPushMatrix();
glTranslatef(-0.5,-0.3,0);
glutWireTeapot(0.3);
glPopMatrix();

glutPushMatrix();
glTranslatef(+0.0,-0.3,0);
glutWireTeapot(0.3);
glPopMatrix();

    glutPushMatrix();
glTranslatef(+0.5,-0.3,0);
glutWireTeapot(0.3,30,30);
glPopMatrix();
glutSwapBuffers();
glutSwapBuffers();
}
int main(int argc, char*argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("week09 Microsoft Visual Studio");
glutDisplayFunc(display);
glutMainLoop();
}




















沒有留言:

張貼留言