Upcoming SlideShare
×

# testpang

953

Published on

0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total Views
953
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
0
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Transcript of "testpang"

1. 1. Computer GraphicsQuestions & Answers
2. 2. Question• 1.Consider a 3D triangle with vertices (0,0,0), (5,0,10), (0,20,0). What is the z value of the point in the triangle with x=3, y=1?• The question is, what linear combo of the 3 vertices matches the x and y components of (3,1,z)? (3,1) = .6 (5,0) + .05 (0,20). So the answer is z= .6x10+.5x0 = 6.• 2.Why can the following not possibly be a 3D Cartesian rotation matrix?• column 2 doesnt have length =1. Various other reasons are also ok.• 3.If a=(4,3,5) then write (a⋅p)a as a matrix M, depending only on a, times p.• 4.What is the 4x4 homogeneous matrix for a 3D rotation by 90 degrees about the X axis, followed by this translation: x=x-1, y=y+1, z=z+2.• 5.Write the vector formula for the 3D rotation by 60 degrees about the Y axis.• 6.Write the quaternion for the 3D rotation by 60 degrees about the Y axis.• 7.What is one problem with interpolating a spline through the control points instead of approximating a spline near the points?• The curve will swing outside the convex hull of the control points, by an amount that is not intuitive. If the control points are almost collinear, the curve might not be. IOW, its harder to predict the curve from the control points.• 8.What advantage do cubic splines have over quadratic splines?• You can match the curve sections with their first two derivatives and the joint, making the joint generally invisible.• 9.What technique computes the surroundings visible as a reflected image in a shiny object?• environment mapping• 10.When projected objects are less than one pixel large, there is a lot of fictitious high frequency clutter in the image. Name the technique used to fix this.• anti-aliasing• 11.In the graphics pipeline, does the rasterizer send its output to the vertex or fragment shader? (Pick one, or pick both.)• fragment shader.• 12.In the graphics pipeline, when a triangle is processed, the (x,y,z) coordinates of the vertices are interpolated across the whole triangle to give the coordinates of each fragment. Name two other things that may commonly be specified at the vertices and then interpolated across the triangle to give a value for each fragment.• colors, normals.
3. 3. Question continue• 13.Where in the graphics pipeline does texture mapping take place?• fragment shader.• 14.When clipping in 3D, how many independent clippers are required in the pipeline?• 6.• 15.Do a view normalization of this square A(3,3), B(3,4), C(4,4), D(4,3) that is being viewed from (0,0) and projected into the plane x=1. The transformed square, when seen with a parallel projection from x= -infinity should look the same as the original square when seen in perspective from (0,0). That is, write the transformed coordinates for ABCD. Also, draw a figure showing the projection.• 16.Are vertices assembled into objects in the vertex shader, in the fragment shader, or in the rasterizer?• rasterizer.• 17.Draw an example where clipping a polygon causes it to split into two pieces (connected by edges running along the edge of the clip window).• 18.Draw 1/8 of a circle of radius R=12 using the Bresenham method. Show your work.• 19.Following the principle that less is more, the OpenGL designers decided not to include some functionality that a program that processes images would probably need. Name it.• Reading and writing image files.• 20.When compositing several images, the limited precision of the color (frame) buffers may hurt the image quality. Therefore, OpenGL also has another buffer to composit into. Name it.• Accumulation buffer.• 21.Is the following code a vertex shader or a fragment shader? void main(void) { gl_FragColor = gl_FrontColor;}• Fragment shader.• 22.Do you set a texture coordinate thus glTexCoord2f(s0, t0); before or after the vertex it applies to?• Before.• 23.Can the standard OpenGL pipeline easily handle light scattering from object to object? Why (not)?• No, because it processes vertices independently, often in separate graphics cores, and they cannot easily interact with each other.• // diffuse.fs: per-pixel diffuse lighting varying vec3 N, L;• void main(void)• { // output the diffuse color• float intensity = max(0.0, dot(normalize(N), normalize(L)));• gl_FragColor = gl_Color;• gl_FragColor.rgb *= intensity; }• 24.Where do the variables N and L get their values from?• Computed by the rasterizer (from per-vertex values supplied by the vertex shader).• 25.What uses the value of the variable gl_FragColor?• It becomes the color of the pixel, if this fragment passes other tests like the depth buffer.
4. 4. Question• You have learned about parametric and geometric continuity. For each 2D curve, answer the continuity query as correctly as possible, and provide a brief explanation:• (a) Is a circle C0 continuous?• The answer is:• Parametric “C” continuity refers to the continuity of the parameterization used. However, since no parameterization has been specified, the question is ambiguous—circle parameterizations may or may not be C0.• (b) Is a circle G0 continuous?• The answer is:• Geometric “G” continuity refers to the continuity of the geometric shape. Yes the circle is G0 continuous because the curve is connected (unbroken) everywhere.• (c) Is a circle C∞ continuous?• The answer is:• Again it is unclear, since no parameterization has been specified. Circle parameterizations may or may not be C0.• (d) Is a circle G ∞ continuous?• The answer is:• Yes, because the circle is infinitely smooth. It can also be parameterized by (x(t); y(t)) = (sin(t); cos(t)) which is infinitely differentiable.• (e) Is a square C0 continuous?• The answer is:• Unclear, since no parameterization has been specified. Parameterizations of the square may or may not be C0.• (f) Is a square G0 continuous?• The answer is:• Yes, because the curve is continuous/unbroken everywhere.• (g) Is a square C1 continuous?• The answer is:• Unclear, since no parameterization has been specified. Parameterizations may or may not be C1, even though there are corners.• (h) Is a square G1 continuous?• The answer is:• No, because tangents to the geometric curve have direction discontinuities at the corners.