2024年4月18日 星期四

 week09-0_sample

安裝freeglut

建立GLUT專案 week09-0_sample

------------------------------------------------

#複習上週 week08-3_glm_gundam_opencv_texture_lighting

OPENCV安裝

setting-compiler

1.C:\OpenCV2.1\include

2.C:\OpenCV2,1\lib

3,cv210  cxcore210  highgui210


----------------------------------------------------

git下載Week08-3



專案改名Week09-1_glm_gundam_opencv_texture_lighting.cbp

專案title改為 week09-1_glm_gundam_opencv_texture_lighting


---------------------------------------------------------------------------------
week09-2

GLUT-> week09-2_glutSolidTeapot_glutSolidSphere
貼上GLUT 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 Microsoft Visual Studio");
glutDisplayFunc(display);
glutMainLoop();
}
另外畫三個,左上 中上 右上,使用期中考交的程式碼



------------------------------------------------------------------------------------------
week09-3

GLUT專案-->week09-3_glutWireTeapot_glutWireCube_glutSphere
貼上week09-2程式碼
複製*2 y軸變成-

void display()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//glutSolidTeapot(0.3);
//========================================================
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();
    ///|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
glPushMatrix();
        glTranslatef(-0.5, -0.3, 0);
        glutWireTeapot(0.3);
    glPopMatrix();

    //========================================================
    glPushMatrix();
        glTranslatef(-0.0, -0.3, 0);
        glutWireCube(0.3);
    glPopMatrix();

    //========================================================
    glPushMatrix();
        glTranslatef(+0.5, -0.3, 0);
        glutWireSphere(0.3,30,30);
    glPopMatrix();

    //========================================================

glutSwapBuffers();
}




沒有留言:

張貼留言