Technical Background Display pipeline Transformations and roundoff errors
Technical Background Display pipeline Transformations and round-off errors Orientation representation Quaternions Rick Parent - CIS 681
Viewing Pipeline Transformation between spaces transformations Map to eye space Perspective divide Object space World space Eye space transformations perspective Clipping space Image space Viewport mapping Screen space Rick Parent - CIS 681
Ray Tracing transformations Map to eye space Object space World space Eye space transformations Trace rays Screen space Rick Parent - CIS 681
Transformations d Px h i Py a b c e f j k l m Pz n o q 1 p Rick Parent - CIS 681
Transformations 1 0 0 Tx Sx 0 0 1 0 Ty 0 Sy 0 0 1 Tz 0 0 Sz 0 0 0 1 Rick Parent - CIS 681
Rotation We know how to rotate about the global axes cos(q) 0 sin(q) 0 1 0 -sin(q) 0 cos(q) 1 0 0 0 cos(q) -sin(q) 0 sin(q) cos(q) 0 0 0 1 Rick Parent - CIS 681
Transformation round-off errors Rotate 5 degrees every frame M = 5 degree Rotation matrix Apply M to data in world space Rick Parent - CIS 681
Transformation round-off errors Rotate 5 degrees every frame m = 5 degree c = 0 degrees c=c+m M = rotation matrix Of c degrees Apply M to data in world space Rick Parent - CIS 681
Transformation round-off errors Rotate 5 degrees every frame M = 5 degree Rotation matrix C = Identity matrix C=C*M Apply C to data Rick Parent - CIS 681
Transformation round-off errors Rotate 5 degrees every frame M = 5 degree Rotation matrix m = 5 degree Apply M to data in world space C = Identity matrix c=c+m C=C*M M = rotation matrix Of c degrees Apply C to data c = 0 degrees Apply M to data in world space Rick Parent - CIS 681
Orientation Rotation about principle axes - fixed angles Rotation about object’s axes - Euler angles Axis-angle rotation Quaternion Rick Parent - CIS 681
Orientation We know how to rotate about the global axes cos(q) 0 sin(q) 0 1 0 -sin(q) 0 cos(q) 1 0 0 0 cos(q) -sin(q) 0 sin(q) cos(q) 0 0 0 1 Rick Parent - CIS 681
Fixed angles Rotate about global axes in a fixed order Rotating about global axes is what the rotation matrices do y Can use most any triple of axes Rotate about x, then y, then z x (10, 90, -45) z Rick Parent - CIS 681
Gimbal lock From some orientations, can’t do some rotations y (0, 90, 0) x Can’t rotate around x-axis z Rick Parent - CIS 681
Euler angles Rotate about axes of object Can use most any triple of axes y Roll, Pitch, Yaw (10, 90, -45) x z Rick Parent - CIS 681
Equivalence of Fixed angles and Euler angles Ru(a) = Rx (a) Rv (b)Ru (a) = Rx(a)Ry (b)Rx (- a)Rx (a) = Rx (a)Ry (b) Rw (g) Rv (b)Ru (a) = Rx (a)Ry (b) Rz (g) Rick Parent - CIS 681
Quaternions Keep axis-angle orientation as 4 -tuple Q = (s, x, y, z) = (s, v) Q 1*Q 2 = (s 1, v 1)*(s 2, v 2) = (s 1*s 2+v 1*v 2 , s 1*v 2 + s 2*v 1 + v 1 xv 2) Q 1+Q 2 = (s 1, v 1)+(s 2, v 2) = (s 1+s 2, v 1+v 2) Rick Parent - CIS 681
Quaternions Keep axis-angle orientation as 4 -tuple (sin(t/2), cos(t/2)*(x, y, z)) Rick Parent - CIS 681
- Slides: 18