2018年3月12日 星期一

week3筆記

1.複習點線面顏色



2.使用滑鼠點擊 teapot 出現座標















3.使用滑鼠移動 teapot
   加入 motion 滑動












float teapotX=0, teapotY=0; // teapot 的位置,一開始在0 , 0
void motion(int x,int y)
{
    teapotX=(x-150)/150.0;  teapotY=-(y-150)/150.0;// 把你的 mouse 位置,設成 teapot 的位置
    printf("%d %d\n", x, y); // 印出移動的數字
    glutPostOverlayRedisplay();
}

沒有留言:

張貼留言