How to find the basis vector for the x and y axis

743 Views Asked by At

I have come across the question below in a sample exam paper. The subject is Computer Graphics. I do not know how to "Draw the basis vector for the x and y axis", and I'm not so sure about deducing the 3 × 3 homogeneous coordinate matrix M either. I know what a basis vector is in Linear Algebra.. and I am thinking perhaps, that before the transformation(the first cup), the basis for x = (1,0) and y = (0, 1) (These should be column vectors), such that you just have a basis for R2, but I don't know how that could change after the transformation.. I also know what a homogeneous coordinate matrix is.. a matrix where the vectors have been augmented I believe. I can probably figure this part out if I am clear on the first part with the basis vectors. Could anyone help me to understand this? (The word 'Draw' has thrown me a bit too.. I guess I'm to draw these vectors?) Could anyone help me to understand this?

enter image description here

1

There are 1 best solutions below

0
On

When you’re working with homogeneous coordinates, you’re really working in a projective rather than a Euclidean space, but it’s convenient to pretend that you’re working in the next-higher dimension Euclidean space instead. You can identify lines through the origin in this space with points in the original projective space, creating an isomorphism between the two. More importantly for the present purpose, affine transformations of the real projective plane correspond to linear transformations of $\mathbb R^3$, which allows you to represent them as matrices. In particular, the affine transformation $A_{2\times2}\mathbf p+\mathbf t$ is represented by the matrix $$M = \left[\begin{array}{c|c}A_{2\times2}&\mathbf t\\ \hline \mathbf 0^T&1\end{array}\right].$$ (If the first two columns have non-zero elements at the bottom, this matrix represents a projective transformation of the plane instead.) This is a homogeneous matrix: it can be scaled by any non-zero amount without changing the transformation it represents because we can scale the homogeneous coordinates of a point in the same way.

Recall from linear algebra that the columns of a transformation matrix are the images of the basis vectors. Thus, the columns of $A_{2\times2}$ are the images of the standard basis vectors in the plane. You can determine these by comparing horizontal and vertical line segments in the original image with their counterparts in the transformed image. Once you have those, all you need is the translation $\mathbf t$. An easy way to find this is to apply $A_{2\times2}$ to some vertex in the original image and compare the result to the corresponding vertex in the final image. In this case, the original image includes the coordinate origin, so you can compute the translation directly, without applying the linear part of the transformation.

Alternatively, you can apply brute force to compute $M$: Pick three noncolinear points $\mathbf p_1$, $\mathbf p_2$ and $\mathbf p_3$ in the original image and find their counterparts $\mathbf q_1$, $\mathbf q_2$ and $\mathbf q_3$ in the transformed image. Using their homogeneous coordinates, $$M = \begin{bmatrix}\mathbf q_1 & \mathbf q_2 & \mathbf q_3\end{bmatrix}\begin{bmatrix}\mathbf p_1 & \mathbf p_2 & \mathbf p_3\end{bmatrix}^{-1}.$$ Since the $\mathbf p$’s are noncolinear, their homogeneous coordinate vectors will be linearly independent, so the matrix on the right is invertible.