2017年5月23日 星期二

Week 14_04160373 梁家豪_洞伍倆叁_上課筆記

Week14
HW1_開啟上週作業
(1).cpb專案檔,用Noteped++開啟
include目錄、lib目錄設定對Working目錄設"。"(句點)


(2)Build&Run
(3)Week14_01timer.cpp加入上週回家作業
HW2_Timer計時器

1.在Main函式裡
glutDisplayFunc(display);
    glutTimerFunc(2000等多久,2000毫秒,timer呼叫函式,0參數)
    
2.
#include <stdio.h>
void timer(int t)
{
    glutTimerFunc(100,timer,t+1);
    angle++;
    glutPostRedisplay();
}
HW3_使用Mouse轉動角度

  • Mouse函式來旋轉角度

void mouse(int button,int state, int x,int y)
{
    oldX=x;oldY=y;
    glutPostRedisplay();

}

  • KeyBoard函式選擇要移動部位

void keyboard(unsigned char key,int x, int y)
{
    if(key=='0') now=0;
    if(key=='1') now=1;
    if(key=='2') now=2;
    if(key=='3') now=3;
    if(key=='4') now=4;


}
  • 角度陣列
float angle = 0 ; → float angle[20= { } ;///歸零

沒有留言:

張貼留言