CS 318: Homework #2 - Splines, Transformations, and Polygon Testing, Assignments of Computer Graphics

Cs 318 homework assignment #2 from march 2, 2004. The assignment includes problems on defining a new spline type, transforming shapes using translations, scaling, and rotations, testing if a point is within a polygon, and interpolating particle system motion. Intended to help students prepare for the midterm exam.

Typology: Assignments

Pre 2010

Uploaded on 03/16/2009

koofers-user-r86
koofers-user-r86 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 318: Homework #2
Assigned: Tuesday March 2, 2004
Due: Tuesday March 9, 2004
This homework is intended to help you prepare for the midterm exam. The majority of the questions on
here are from past exams. You should hand in this assignment at the end of class on Tuesday, March 9.
Please be organized when writing your answers to these questions. Make sure that all solutions are
clearly indicated and labelled with the question they are answering. Remember to write clearly and legibly.
Unreadable answers will receive 0 credit.
1. We want to define a new spline type with control points p0,p3,r1,r2. The curve should interpolate its
endpoints p0,p3and should have tangents r1,r2at u=1
/
2and u=3
/
4, respectively. Given that our
standard matrix-form for this cubic splines will be
p(u) = 1u u2u3M
p0
p3
r1
r2
derive the 4×4 basis matrix Mfor this class of splines.
2. Suppose that you are given the following shape:
(−1, −1)
(1, 1)
For each of the following figures, describe how to transform the initial shape above into the given result.
You may only use combinations of the following three transformations:
T: translate by [1 1] S: scale by [2 1] R: rotate (counter-clockwise) by 45
NOTE: Your answers should consist of products of these 3 fundamental matrices. Make sure to put
them in the correct order.
pf2

Partial preview of the text

Download CS 318: Homework #2 - Splines, Transformations, and Polygon Testing and more Assignments Computer Graphics in PDF only on Docsity!

CS 318: Homework

Assigned: Tuesday March 2, 2004

Due: Tuesday March 9, 2004

This homework is intended to help you prepare for the midterm exam. The majority of the questions on here are from past exams. You should hand in this assignment at the end of class on Tuesday, March 9. Please be organized when writing your answers to these questions. Make sure that all solutions are clearly indicated and labelled with the question they are answering. Remember to write clearly and legibly. Unreadable answers will receive 0 credit.

  1. We want to define a new spline type with control points p 0 , p 3 , r 1 , r 2. The curve should interpolate its endpoints p 0 , p 3 and should have tangents r 1 , r 2 at u = 1 / 2 and u = 3 / 4 , respectively. Given that our standard matrix-form for this cubic splines will be

p(u) =

[

1 u u^2 u^3

]

M

p 0 p 3 r 1 r 2

derive the 4×4 basis matrix M for this class of splines.

  1. Suppose that you are given the following shape:

(−1, −1)

(1, 1)

For each of the following figures, describe how to transform the initial shape above into the given result. You may only use combinations of the following three transformations:

T : translate by [1 1] S : scale by [2 1] R : rotate (counter-clockwise) by 45◦

NOTE: Your answers should consist of products of these 3 fundamental matrices. Make sure to put them in the correct order.

(a) (b) (c) (d)

  1. You are given a convex planar polygon P with k sides. Side i of the polygon lies on the line aix+biy+di = 0, where [ai bi] is the outward-pointing normal of that edge. Describe precisely how to test whether a point (x, y) lies within this polygon.
  2. Our standard viewing model is parameterized by two points (lookFrom, lookAt) and a vector (vUp). For each of the following, describe what happens on the screen when applying the described transformations to the camera parameters. (a) Translate lookFrom and lookAt by lookAt − lookFrom. (b) Rotate lookFrom and lookAt counter-clockwise about vUp. (c) Translate lookFrom and lookAt by vUp × (lookAt − lookFrom).
  3. Suppose you are asked to implement a system for key-framing the motion of a particle system. Consider a single particle in this system. You are given two key-frames: 1. At time t 1 the particle is at position p 1 with velocity v 1 2. At time t 2 the particle is at position p 2 with velocity v 2

Give an equation for a function p(u) that linearly interpolates between these two key frames for values of u in the range [0, 1].

Page 2