TAILIEUCHUNG - Lecture Computer graphics: Lecture 26 - Fasih ur Rehman

In this chapter, you learn what is input and output devices. The keyboard is presented and different keyboard types are described. You are introduced to various pointing devices, such as the mouse, trackball, touchpad, pointing stick, joystick, touchscreen, and pen input. Scanners and reading devices, including optical scanners, optical readers, magnetic ink character recognition readers, and data collection devices are explained,. | Computer Graphics Lecture 26 Fasih ur Rehman Last Class Shading Phong Reflection Model Today’s Agenda Examples Matrix Multiplication void matrixMul(float P[1][3],float T[3][3]) { int i,j,k; //Initialize Matrix P1 with Zero for(i=0;i<3;i++) P1[0][i]=0; /*Mutiply T with P and store the result in P1 */ for(k=0;k<1;k++) for(i=0;i<3;i++) for(j=0;j<3;j++) P1[k][i]+=P[k][j]*T[j][i]; } Matrix Identity void matrixIdentity(float T[3][3]) { int i,j; /* Make matrix T as Identity Matrix by Storing 1 in the left diagonal positions of Matrix T and store 0 in other positions */ for(i=0;i<3;i++) { for(j=0;j<3;j++) { if(i==j) T[i][j]=1; else T[i][j]=0; } } } Translation void translate_point(int x,int y,int tx,int ty) //Translate a point by translation factors tx,ty { float T[3][3]; matrixIdentity(T); T[2][0]=tx; T[2][1]=ty; P[0][0]=x; P[0][1]=y; P[0][2]=1; matrixMul(P,T); } Rotation void rotate_point(int x,int y,float angle) // Rotate a point by given angle { float R[3][3]; float radian; .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.