Week 5 - Friday What did we talk about last time? Euler angles - - PowerPoint PPT Presentation

week 5 friday what did we talk about last time euler
SMART_READER_LITE
LIVE PREVIEW

Week 5 - Friday What did we talk about last time? Euler angles - - PowerPoint PPT Presentation

Week 5 - Friday What did we talk about last time? Euler angles Quaternions Started vertex blending and morphing If we animate by moving rigid bodies around each other, joints won't look natural To do so, we define bones and


slide-1
SLIDE 1

Week 5 - Friday

slide-2
SLIDE 2

 What did we talk about last time?  Euler angles  Quaternions  Started vertex blending and morphing

slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5
slide-6
SLIDE 6
slide-7
SLIDE 7
slide-8
SLIDE 8

 If we animate by moving rigid bodies around each other, joints

won't look natural

 To do so, we define bones and skin and have the rigid bone

changes dictate blended changes in the skin

slide-9
SLIDE 9

 The following equation shows the effect that each bone i (and

its corresponding animation transform matrix Bi(t) and bone to world transform matrix Mi ) have on the p, the original location of a vertex

 Vertex blending is popular in part because it can be computed

in hardware with the vertex shader

∑ ∑

− = − = −

= =

1 1 1

1 where ) ( ) (

n i i n i i i i

w t w t p M B u

slide-10
SLIDE 10

 Morphing is the technique for interpolating between two

complete 3D models

 It has two problems:

  • Vertex correspondence

▪ What if there is not a 1 to 1 correspondence between vertices?

  • Interpolation

▪ How do we combine the two models?

slide-11
SLIDE 11

 We're going to ignore the correspondence problem (because

it's really hard)

 If there's a 1 to 1 correspondence, we use parameter s∈[0,1]

to indicate where we are between the models and then find the new location m based on the two locations p0 and p1

 Morph targets is another technique that adds in weighted

poses to a neutral model

1

) 1 ( p p m s s + − =

slide-12
SLIDE 12

 Finally, we deal with the issue of projecting the points into

view space

 Since we only have a 2D screen, we need to map everything to

x and y coordinates

 Like other transforms, we can accomplish projection with a 4 x

4 matrix

 Unlike affine transforms, projection transforms can affect the

w components in homogeneous notation

slide-13
SLIDE 13

 An orthographic projection maintains

the property that parallel lines are still parallel after projection

 The most basic orthographic projection

matrix simply removes all the z values

 This projection is not ideal because z

values are lost

  • Things behind the camera are in front
  • z-buffer algorithms don't work

            = 1 1 1 P

slide-14
SLIDE 14

 To maintain relative depths and allow for

clipping, we usually set up a canonical view volume based on (l,r,b,t,n,f)

 These letters simply refer to the six

bounding planes of the cube

  • Left
  • Right
  • Bottom
  • Top
  • Near
  • Far

 Here is the (OpenGL) matrix that translates

all points and scales them into the canonical view volume

                  − + − − − + − − − + − − = 1 2 2 2 n f n f n f b t b t b t l r l r l r P

slide-15
SLIDE 15

 OpenGL normalizes to a

canonical view volume from [-1,1] in x, [-1,1] in y, and [- 1,1] in z

 Just to be silly, MonoGame

normalizes to a canonical view volume of [-1,1] in x, [- 1,1] in y, and [0,1] in z

 Thus, its projection matrix is:                   − − − − + − − − + − − = 1 1 2 2 n f n n f b t b t b t l r l r l r P

slide-16
SLIDE 16

 A perspective projection does not preserve parallel lines  Lines that are farther from the camera will appear smaller  Thus, a view frustum must be normalized to a canonical view

volume

 Because points actually move (in x and y) based on their z

distance, there is a distorting term in the w row of the projection matrix

slide-17
SLIDE 17

 Here is the MonoGame projection matrix  It is different from the OpenGL again because it only uses [0,1]

for z

                  − − − − − − + − − + − = 1 2 2 n f fn n f f b t b t b t n l r l r l r n P

slide-18
SLIDE 18
slide-19
SLIDE 19
slide-20
SLIDE 20
slide-21
SLIDE 21

 Light  Materials  Sensors

slide-22
SLIDE 22

 Read Chapter 5 for Monday  Finish Project 1

  • Due tonight by 11:59 p.m.!

 Keep working on Assignment 2

  • Due next Friday