CS考试辅导 COSC363-19S1

COSC363-19S1
Comments in italics are not part of the answer.
It may be possible to define the same transformation using several different sequences. Only two possible solutions for (a) and (c) are shown below. All valid answers will receive full marks.
glRotatef(30, 0, 0, 1);

Copyright By PowCoder代写 加微信 powcoder

glTranslatef(3, 0, 0);
glRotatef(90, 1, 0, 0);
glutSolidTeapot(1)
glTranslatef(4, -2, 0);
glRotatef(30, 0, 0, 1);
glTranslatef(-4, 2, 0);
glScalef(2, 1, 1);
drawArrow()
glRotatef(30, 0, 0, 1);
glRotatef(90, 1, 0, 0);
glTranslatef(3, 0, 0);
glutSolidTeapot(1)
glRotatef(30, 0, 0, 1);
glPushMatrix();
glTranslatef(3, 0, 0)
glScalef(-1, 1, 1);
drawArrow();
glPopMatrix();
glPushMatrix();
glTranslatef(-3, 0, 0);
drawArrow();
glPopMatrix();
glRotatef(30, 0, 0, 1);
glPushMatrix();
glTranslatef(3, 0, 0)
glRotatef(180, 0,0,1);
drawArrow();
glPopMatrix();
glPushMatrix();
glTranslatef(-3, 0, 0);
drawArrow();
glPopMatrix();
The point is first rotated by 90 deg about the x axis, then its coordinates are scaled by factors (4, 3, 2), and then the point is translated by distances (1, 2, 1) along x, y, z axes.
(e) (0, 0, 0, 1) represents the origin. A rotation or scale transformation will not change this point. The translation operation will move this point to (1, 2, 1, 1).

(a) (b) (c)
LaMa = (0, 0.2, 0.2)
(b) LdMd max(n.l, 0) = (1,1,1)(0, 1, 1)cos45 = (1/2)(0, 1,1) = (0, 0.707, 0.707) (c) LsMs(r.v)f = (1,1,1) (cos 30)10 = (1,1,1)(0.866)10 = (0.237, 0.237, 0.237)
a = (0, 0, 5), b = (1, -3, 0) a  b = (53, 5, 0) = (8.66, 5, 0) Magnitue of n = |n| = 10. Normalized vector: (3/2, 1/2, 0) = (0.866, 0.5, 0)
n.x = 3/2.  = cos-1(3/2) = 30 degs.
(a) The point Q is in shadow. The colour of Q is given by the ambient component of reflection,
(d) h = (l + v) normalized (important!)
B2 5/3 0.5
C2 10/3 0.5
P 0.251 B2 0.25 0.5 C2 0.75 0.5 Q 0.751
LsMs(h.n)f
You may assume that the three segments on the edge A1B1C1D1 have equal lengths.
(b) Mipmapping is the process of using a set of prefiltered images at multiple scales for texture mapping. Mipmapping is useful for preserving relevant information in a texture mapped polygon when the polygon is viewed in different sizes. Mipmapping is particularly useful in a minification filter to retain essential features in an image at lower resolutions.

(0, 30, 0,
(0, 30, 0,
World coordinates: T = (40, 0, 0), C = (0, 30, 0). Eye coordinates: T = (0, 0, -50), C = (0, 0, 0)
(b) Aspect ratio = w/h = 100/60 = 1.66.
h = 60, N = 50, fov = 2tan-1(h/2N) = 2tan-1(0.6)  62

g = refract(d, n, 1/2)
h = refract(g, -m, 2/1)
PQ < PL t> 0
s = (-8, -6, 0) d = (0.8, 0.6, 0). s.d = -6.4 -3.6+0 = -10, (s.d)2 = 100. t = 10 +/- 4 = 6, 14
Closest point = (2,1,2) + 6. (0.8, 0.6, 0) = (6.8, 4.6, 2)
t = distance from the source (P) of the ray to any point on the ray (in this case, to the point of intersection)
s = Vector CP (from centre (C) of the sphere to the source (P) of the ray
(a) The main computations performed in a vertex shader are transformation and lighting. The coordinates of an input vertex is transformed from world space to clip space by using the model-view-projection matrix. Ligting calcualtions are usually performed in the eye- coordinate space, by transforming the point and the normal vector using the model-view matrix and the normal matrix respectively.
Tessellation control shader: Specifying inner and outer tessellation levels, modifying patch vertices
Outer tessellation levels = (4, 4, 4, 4), Inner tessellation levels = (3, 3) A = (0, 1), B = (0.33, 0.66), C = (0.5, 0), D = (1, 0.75)
The built-in variable gl_TessCoord stores the tessellation coordinates of the current vertex generated by the primitive generator.
The patch’s coordinates are passed to the evaluation shader in the built-in array gl_in[].gl_Position. The third statement in the shader (which computes posn) combines the patch vertices using a set of (bi-linear) blending functions in u, v to compute the three dimensional position of the current vertex.
The last statement converts the above position to clip coordinates by multiplying it by the model-view-projection matrix. gl_Position is the built-in output variable of the evaluation shader that is used to output three-dimensional position information in clip space.

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com