KSM
KSM

Reputation: 262

Graphics PipelineView Transform

Trying to get a better Understand on View Transform, using Right Handed Rule. If anyone can help clarify the given slide. For example what is C standing and why is it negative also why is an inverse applied to the matrix, and finally what is the simplest form of these matrices concatenated. Thank you for your time and help! enter image description here

Upvotes: 0

Views: 60

Answers (1)

Barak Itkin
Barak Itkin

Reputation: 4877

  • Assume we have a 3D point P = (Px,Py,Pz) in real world coordinates
  • Let u be the vector pointing "left" (as seen by the camera)
  • Let v be the vector pointing "up" (as seen by the camera)
  • Let w be the vector pointing "forward" (as seen by the camera)
  • u, v and w are orthogonal, and I assume that we already normalized them (so now we have an orthonormal base)
  • Let C = (Cx, Cy, Cz) be the location of the 'eye' of the camera

If we were to manually translate P to camera coordinates, it would have been done like this:

  • Find the location relative to the camera Pc = P - C
  • We can find the u (/v/w) component of the point by computing the dot product of u (/v/w) and Pc
  • So the coordinates of P as seen by the camera are (<Pc,u>,<Pc,v>,<Pc,w>), where <x,y> denotes the dot product of x and y

And this matches exactly to the given matrices:

| ux  uy  uz  0 |   | 1  0  0 -Cx |   | Px |
| vx  vy  vz  0 | X | 0  1  0 -Cy | X | Py |
| wx  wy  wz  0 |   | 0  0  1 -Cz |   | Pz |
|  0   0   0  1 |   | 0  0  0   1 |   |  1 |

  | ux  uy  uz  0 |   | Px - Cx |
= | vx  vy  vz  0 | X | Py - Cy |
  | wx  wy  wz  0 |   | Pz - Cz |
  |  0   0   0  1 |   |  1      |

  | <Pc,u> |
= | <Pc,v> |
  | <Pc,w> |
  |      1 |

So basically, the big matrix you have there is indeed the one that converts points from absolute coordinates to camera coordinates

Upvotes: 1

Related Questions