# Tag Info

25

An Affine Transform is a Linear Transform + a Translation Vector. $$\begin{bmatrix}x'& y'\end{bmatrix} = \begin{bmatrix}x& y\end{bmatrix} \cdot \begin{bmatrix}a& b \\ c&d\end{bmatrix} + \begin{bmatrix}e& f\end{bmatrix}$$ It can be applied to individual points or to lines or even Bezier curves. For lines, it preserves the property that ...

7

I found a solution to my specific problem. Instead of computing the determinant and hitting the precision wall, I use the Gauss-Jordan method step by step. In my specific case of affine transformation matrices and the range of values I use, I don't hit any precision problem this way.

6

Note: I have answered before the edit from trichoplax and I thought you were searching for other transformations other than the one you mentioned. The informations below are still useful so I will keep the answer here, but it does not directly answer your question. Affine transformations (surprise!) map affine spaces to affine spaces. An affine space is ...

6

An affine transformation doesn't have enough freedom to do what you want. Affine transforms can be constructed to map any triangle to any other triangle, but they can't map any quadrilateral to any other quadrilateral. One way to see this is that the matrix for a 2D affine transform has only 6 free coefficients. That's enough to specify what it does to 3 ...

5

If you have a 3x3 matrix representing some transformation, you will actually have the X,Y,Z vectors of that transformation in the rows or columns (depending on if it's a row major or column major matrix). In other words, if you have a 3x3, you can look at it and immediately get the up, right(*), forward vectors (asterisk due to handedness, it could be the ...

4

In a linear transformation system, your origin is always a fixed point, since 0*anything = 0. So imagine you have a cinema screen, and the origin is at the centre of the screen. Using linear transformations, you can rotate, scale or shear the image, what you can't do is move it, since you have a fixed point in the middle. Now add a dimension, and move your ...

4

It is not necessarily affine. An affine matrix in homogeneous coordinates has a form like: $$\begin{bmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ 0 & 0 & 1 \end{bmatrix}$$ (assuming you use a column vector convention). Here, the upper-left 2×2 submatrix is the linear part, and $(a_{13}, a_{23})$ is the ...

3

A matrix can be used to transform a coordinate system into a new one. More specifically, it can be used to transform the basis vectors of a coordinate system. That's how it defines a new coordinate system. It is of course always in relation to another coordinate system but that is often implicit. local coordinate system usually means a coordinate system ...

3

Because all matrices are column-major, the translation matrix $\mathbf{T}$ should be $$\mathbf{T}=\begin{bmatrix} 1 & 0 & 0 & e_x \\ 0 & 1 & 0 & e_y \\ 0 & 0 & 1 & e_z \\ 0 & 0 & 0 & 1 \end{bmatrix}$$ I thought you mistakenly treat the eye as a row vector just because they were written as a single line in ...

3

In computer graphics the projection plane is most commonly defined as a plane perpendicular to the camera at a specific distance from the camera (the distance is often labeled $g$). It is the plane that an image will be projected onto and is usually shown between the near and far planes of a projection matrix. In the attached image (from the fged website) it ...

3

To understand the $w$ component, it'll be easier to understand how homogeneous coordinates come about in the first place. The following example will be in 2D for the sake of simplicity, but the same can be extended to 3D. Let's try to "invent" homogeneous coordinates for the first time. We start with the high school line equation, $ax + by + c = 0$....

2

Your understanding of the matrix structure in Q3 is correct. This code just does not construct a matrix explicitly and the matrix multiplication is applied implicitly. I think this part might cause your confusion. Instead of deciphering the code, I would rather derive the transform and compare it with the code. The affine (6 degrees of freedom) and ...

2

The relationship between standard coordinates $(x,y)$ and homogeneous coordinates $(X,Y,Z)$ is $x = X / Z, y = Y/Z$. Homogeneous coordinates are a type of projective coordinates. All points on the line $(Z x, Z y, Z)$ are equivalent to the point $(x,y)$ in 2D (the same thing can be applied for 3D). So technically 2D points are represented as 3D lines passing ...

2

For others who might have this question, here a perhaps more straight forward numeric answer (I'm now working myself on this book as well). Consider that: We are given object space coordinates that need to be transformed into upright and subsequently world space coordinates. We know that a vector $\vec{v}$ can be represented as a linear transformation of ...

1

A shear can be thought of as an affine transformation that turns a square into a parallelogram: Note that the spacing of points at the same x-position are unchanged by the transformation; the distance between $a$ and $b$ is the same as between $a'$ and $b'$, and the distance $cd$ is the same as the distance $c'd'$. What has changed is that each x-layer has ...

1

Let me try to translate the problem statement in a mathematical way so that it can be understood more easily. Assume that the robot is at the position (1, 10, 3) Assume there are a set of basis $\mathbf{e}_i$ and origin $\mathbf{O}$, then the robot position $\mathbf{P}$ expressed in this basis is the origin plus a linear combination of the basis and the ...

1

Let's talk about linear geometric transformations in homogeneous coordinates. In your question there are mainly two kind of geometric transformations involved: planar rotation and planar scaling, the computation-friendly analytical re-definitions of which are found hereUnified frameworks of elementary geometric transformations. The 2D homogenous rotation ...

1

If I understand correctly, you want to draw 2 objects mirrored with respect to an arbitrary line. Then when you move 1 object you want the other (reflection) to move with respect to that reflected line. A more sophisticated way of doing this would be using transformation matrices. That way you wouldn't have to worry about moving the mirrored triangle. You ...

1

To mirror an object in relation to an arbitrary line, you first have to find the coordinates of that object in the frame of reference of that line. For convenience, we will define a frame of reference where the $X$ axis is colinear with the line itself and the $Y$ axis will be perpendicular to the line. Then, we can flip the Y coordinate in that frame of ...

1

A rotation around the x-axis is achieved by this matrix $$\mathtt{T}_\mathrm{rot X} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0& \cos \alpha & -\sin \alpha& 0 \\ 0 & \sin \alpha & \cos \alpha & 0 \\ 0 & 0 & 0 &1 \\ \end{bmatrix}$$ In order to rotate around the x-axis in the viewing space, one needs to ...

1

You can put the translation first, and then the rotation, but have the translation happen in the direction of the cow's head. To do that, you need a vector from the center of the cow to its head. Then you need the length of the translation. You can then do the translation in that direction. Like this: float direction_x; float direction_y; float direction_z; ...

Only top voted, non community-wiki answers of a minimum length are eligible