2021電腦圖學 Computer Graphics 授課教師: 葉正聖 銘傳大學資訊傳播工程系 每週主題: 程式環境、點線面顏色、移動/旋轉/縮放與矩陣(Matrix)、階層性關節轉動(T-R-T)、做出機器人、打光、貼圖、glu/glut函式、鍵盤、滑鼠、計時器(timer)、讀入3D模型、粒子系統、聲音、特效、投影矩陣、攝影機與運鏡、機器人2.0、期末作品
2021年6月2日 星期三
2021年5月26日 星期三
08160581 薑餅 圖學筆記 week14
2021年5月19日 星期三
2021年5月12日 星期三
08160581 薑餅 圖學筆記 week12
2021年5月5日 星期三
08160581薑餅 圖學筆記 week11
2021年4月28日 星期三
08160581薑餅 圖學筆記 week06
08160581 薑餅 圖學筆記 week05
#include <GL/glut.h>
int N=0,vx[3000],vy[3000];
float angle=0;
void display()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(angle,0,0,1);
glBegin(GL_LINE_LOOP);
for (int i=0;i<N;i++)
{
glVertex2f((vx[i]-150)/150.0,-(vy[i]-150)/150.0);
}
glEnd();
glPopMatrix();
glutSwapBuffers();
}
void keyboard(unsigned char key,int x,int y)
{
angle++;
display();
}
void motion(int x,int y)
{
vx[N]=x; vy[N]=y;
N++;
display();
}
int main(int argc, char *argv[]){
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("08160121 good!");
glutDisplayFunc ( display );
glutKeyboardFunc (keyboard);
glutMotionFunc(motion);
glutMainLoop();
距地表面160 Week11
#include "glm.h" GLMmodel* pmodel = NULL; void drawmodel(void) { if (!pmodel) { pmodel = glmReadOBJ("data/porsche.obj...
-
先用上一周的開始加新的東西 ///把 Week15_file 的 main.cpp 拿來用 #include <stdio.h> #include <GL/glut.h> float angle[20]={}, diff=2;///Step05 本來只有...
-
加背 景 上程式碼 #include <opencv/highgui.h> ///使用 OpenCV 2.1 比較簡單, 只要用 High GUI 即可 #include <opencv/cv.h> #include <GL/glut.h>...
-
下載 OpenCV-2.1.0-win32-vs2008.exe 下載選第2個 Add OpenCV to PATH(執行的目錄之一) 位置用預設的 C:\OpenCV2.1 安裝完重開codeblocks cv210 cxcore210 highgui210 ---...








































