Bài giải bài tập Đồ họa máy tính - Pdf 10

Faculty of Computer Science and Engineering
Department of Computer Science

Bài tập 1
1/ Độ phân giải là 1280x1024
I) b = 20 , không LUT
Dung lượng bộ nhớ = 1280 x 1024 x 20 = 26 214 400 bit = 3 276 800 byte

II) b = 20, w = 24;
Dung lượng bộ nhớ = 1280 x 1024 x 20 + 2^20 * 24 = 51 380 224 bit = 6 422 528 byte

III)b = 8, w = 24;
Dung lượng bộ nhớ = 1280 x 1024 x 8 + 2^8 * 24 = 10 491 904 bit = 1 311 488 byte

IV)b = 10, không có LUT
Dung lượng bộ nhớ = 1280 x 1024 x 10 = 13 107 200 bit = 1 638 400 byte

2/
a) Thời gian đọc 1 pixel: T = 1/(72×800×600) (s) = 28.935 ns
b) Thời gian đọc 1 pixel: T = 1/((60/2)×1280×960) (s) = 27.127 ns

3/
GLfloat v0[2] = {1,1};
GLfloat v1[2] = {2,3};
GLfloat v2[2] = {4,1};
GLfloat v3[2] = {6,2};
GLfloat v4[2] = {9,3};
GLfloat v5[2] = {7,5};
a)
glBegin(GL_TRIANGLES);
Faculty of Computer Science and Engineering

Faculty of Computer Science and Engineering
Department of Computer Science d)
glBegin(GL_TRIANGLE_STRIP);
glVertex2fv(v0);
glVertex2fv(v2);
glVertex2fv(v1);
glVertex2fv(v3);
glVertex2fv(v5);
glVertex2fv(v4);
glEnd( );

e)
glBegin(GL_QUAD_STRIP);
glVertex2fv(v0);
glVertex2fv(v2);
glVertex2fv(v1);
glVertex2fv(v3);
glVertex2fv(v5);
glVertex2fv(v4);
glEnd( );

Câu 4:
GLfloat v0[2] = {400, 550};
GLfloat v1[2] = {530, 475};
GLfloat v2[2] = {530, 325};
GLfloat v3[2] = {400, 250};
GLfloat v4[2] = {270, 325};

glEnd( );
glBegin(GL_LINES);
Faculty of Computer Science and Engineering
Department of Computer Science

glVertex2fv(v0);
glVertex2fv(v6);
glVertex2fv(v2);
glVertex2fv(v9);
glVertex2fv(v4);
glVertex2fv(v12);
glEnd( );
}

5/
Vẽ bằng lệnh:
glutWireCube(1);

Vẽ bằng các Polygon:
GLfloat v0[3] = {0.5,0.5,-0.5};
GLfloat v1[3] = {0.5,-0.5,-0.5};
GLfloat v2[3] = {0.5,-0.5,0.5};
GLfloat v3[3] = {0.5,0.5,0.5};
GLfloat v4[3] = {-0.5,0.5,0.5};
GLfloat v5[3] = {-0.5,-0.5,0.5};
GLfloat v6[3] = {-0.5,-0.5,-0.5};
GLfloat v7[3] = {-0.5,0.5,-0.5};

glBegin(GL_QUAD_STRIP);
glVertex3fv(v0);


Nhờ tải bản gốc

Tài liệu, ebook tham khảo khác

Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status