521493S Computer Graphics Exercise 2 Question 2.1 Given two - - PowerPoint PPT Presentation

521493s computer graphics
SMART_READER_LITE
LIVE PREVIEW

521493S Computer Graphics Exercise 2 Question 2.1 Given two - - PowerPoint PPT Presentation

521493S Computer Graphics Exercise 2 Question 2.1 Given two nonparallel, three-dimensional vectors and , how can we form an orthogonal coordinate system in which is one of the basis vectors? Create basis vectors using


slide-1
SLIDE 1

521493S Computer Graphics

Exercise 2

slide-2
SLIDE 2

Question 2.1

Given two nonparallel, three-dimensional vectors and , how can we form an

  • rthogonal coordinate system in which is one
  • f the basis vectors?

Create basis vectors using and .

slide-3
SLIDE 3

Solution 2.1 (1/9)

  • We can create orthogonal coordinates easily

by using cross product:

– Vector is now orthogonal to both and . – However, and are not necessarily orthogonal. We need third vector that is orthogonal to both and . – Now , and form an orthogonal coordinate system.

slide-4
SLIDE 4

Solution 2.1 (2/9)

  • Calculating cross product using two 3D vectors
slide-5
SLIDE 5

Solution 2.1 (3/9)

  • Calculating cross product using two 3D vectors
slide-6
SLIDE 6

Solution 2.1 (4/9)

  • Calculating cross product using two 3D vectors
slide-7
SLIDE 7

Solution 2.1 (5/9)

  • Calculating cross product using two 3D vectors
slide-8
SLIDE 8

Solution 2.1 (6/9)

  • Calculating cross product using two 3D vectors
slide-9
SLIDE 9

Solution 2.1 (7/9)

  • Calculating cross product using two 3D vectors
slide-10
SLIDE 10

Solution 2.1 (8/9)

  • With and
slide-11
SLIDE 11

Solution 2.1 (9/9)

  • We can also check the results by verifying that

dot product between each result pair is zero:

slide-12
SLIDE 12

Question 2.2

We can specify an affine transformation by considering the location of a small number of points both before and after these points have been transformed. In three dimensions, how many points must we consider to specify the transformation uniquely? How does the required number of points change when we work in two dimensions?

slide-13
SLIDE 13

Solution 2.2 (1/3)

  • There are 12 degrees of freedom in the three-

dimensional affine transformation.

  • Suppose a point that we are

transforming to point by the matrix using relationship .

slide-14
SLIDE 14

Solution 2.2 (2/3)

  • We have 12 unknown coefficients in and we

get 3 equations for each pair of and

  • We need at least 12 / 3 = 4 pairs of matching

points to solve the 12 unknown variables.

slide-15
SLIDE 15

Solution 2.2 (3/3)

  • In two dimensions, there are 6 unknown

variables

  • In two dimensions we get only two equations

per point (x and y coordinates)

  • Therefore we need 6 / 2 = 3 matching points.
slide-16
SLIDE 16

Question 2.3

Start with a cube centered at the origin and aligned with the coordinate axes. Find a rotation matrix that will rotate the cube first 45° around y-axis and then 45° around z-axis.

slide-17
SLIDE 17

Solution 2.3 (1/3)

  • Transformation order is from right to left. So

rotation around y-axis is on the right side of the rotation matrix.

slide-18
SLIDE 18

Solution 2.3 (2/3)

  • Rotation matrices for y and z axes
slide-19
SLIDE 19

Solution 2.3 (3/3)

  • We are using 45° angles to rotate. That makes

calculations a bit easier

slide-20
SLIDE 20

Question 2.4

Not all projections are planar geometric

  • projections. Give an example of a projection in

which the projection surface is not a plane, and another in which the projections are not lines.

slide-21
SLIDE 21

Solution 2.4 (1/2)

Eclipses (both solar and lunar) are good examples of the projection of an object (the moon or the earth) onto a nonplanar surface.

Moon eclipses, derived from Phases_of_the_Moon.png in Wikimedia Commons by Miljoshi (Creative Commons Attribution 2.5 Generic)

slide-22
SLIDE 22

Solution 2.4 (2/2)

All the maps in an atlas are examples of the use

  • f curved projectors. If the projectors were not

curved we could not project the entire surface of a spherical object onto a rectangle.

slide-23
SLIDE 23

Question 2.5

If we were to use orthogonal projections to draw the coordinate axes, the x and y axes would be like in the plane of the paper, but the z axis would point out of the page. Instead, we can draw the x and y axes as meeting at a 90-degree angle, which the z axis going off at -135 degrees from the x axis. Find the matrix that projects the original

  • rthogonal-coordinate axes to this view.
slide-24
SLIDE 24

Solution 2.5 (1/3)

slide-25
SLIDE 25

Solution 2.5 (2/3)

  • We need to project where

and .

  • Z-axis is projected to the same plane with x

and y axes with a -135 degree angle from positive x axis. α is the length of the vector.

slide-26
SLIDE 26

Solution 2.5 (3/3)

  • As α was not given, we can choose

to get a simple looking projection matrix

slide-27
SLIDE 27

Solution 2.5 (3/3)

  • As α was not given, we can choose

to get a simple looking projection matrix

For 3-D -> 2-D projection, erase this row

slide-28
SLIDE 28

Question 2.6

Find the projection of a point onto the plane from a light source located at infinity in the direction .

slide-29
SLIDE 29

Solution 2.6 (1/6)

slide-30
SLIDE 30

Solution 2.6 (2/6)

  • All the projected points of the point to

the direction of are of form . Thus, shadow of the point is found by determining for which the line intersects the plane

slide-31
SLIDE 31

Solution 2.6 (3/6)

  • After solving the equation, we find
  • However, what we want is a projection matrix.

We can use the above value to solve and the same for other dimensions.

slide-32
SLIDE 32

Solution 2.6 (4/6)

slide-33
SLIDE 33

Solution 2.6 (5/6)

  • And we can do the same for y and z
slide-34
SLIDE 34

Solution 2.6 (6/6)

  • These results can be computed by multiplying

the homogenous coordinate point by the projection matrix