# Tag Info

Accepted

### Why is the transposed inverse of the model view matrix used to transform the normal vectors?

Here's a simple proof that the inverse transpose is required. Suppose we have a plane, defined by a plane equation $n \cdot x + d = 0$, where $n$ is the normal. Now I want to transform this plane by ...
• 24.7k
Accepted

Image 1: A bad case of shadow acne. (Synthetic and a bit exaggerated) Shadow acne is caused by the discrete nature of the shadow map. A shadow map is composed of samples, a surface is continuous. ...
• 8,397
Accepted

### What is the correct order of transformations scale, rotate and translate and why?

Usually you scale first, then rotate and finally translate. The reason is because usually you want the scaling to happen along the axis of the object and rotation about the center of the object. In ...
• 3,616

### Why are Homogeneous Coordinates used in Computer Graphics?

They simplify and unify the mathematics used in graphics: They allow you to represent translations with matrices. They allow you to represent the division by depth in perspective projections. The ...
• 724

### Why is the transposed inverse of the model view matrix used to transform the normal vectors?

This is simply because normals are not really vectors! They are created by cross products, which results in bivectors, not vectors. Algebra works much different for these coordinates, and geometric ...
• 2,194
Accepted

Both methods end up doing the same calculations when you break it down. Rotating a vector $u$ with a matrix: $$\begin{bmatrix}\cos\theta & -\sin\theta \\ \sin\theta & \cos\theta\end{bmatrix} \... • 24.7k 11 votes Accepted ### Is it possible to turn a 3d rotation matrix (4x4) into its component parts (rotation, scale, etc.)? You can decompose the matrix \mathbf{M} = \mathbf{TRS} into basic transformations: translation, scaling, and rotation. Given this matrix:$$\mathbf{M} = \begin{bmatrix} a_{00} & a_{01} & a_{...
• 156

As an addition to the answer of joojaa: Using a bias to offset the shadow function does indeed solve the problem with shadow acne, but it can introduce an additional problem: Peter Panning As you see ...
• 1,810

### How to combine rotation in 2 axis into one matrix

(This answer is essentially the same as Stefan's but I wanted to add some detail about row and column vectors, and how to determine which you are using.) Yes, this is possible, but the details depend ...
• 2,720
Accepted

### Is there a way to script image creation?

ImageMagick is a set of command-line tools that can do the sort of things you describe. For example, this command line will overlay picture B with a centered copy of picture A, resized to 100 pixels ...
• 24.7k

### Why are Homogeneous Coordinates used in Computer Graphics?

It's in the name: Homogeneous coordinates are well ... homogeneous. Being homogeneous means a uniform representation of rotation, translation, scaling and other transformations. A uniform ...
• 71

• 8,397
Accepted

### Calculate aspect ratio from 2D shape in 3D space

The ratio is with a quick and dirty visual measurement $665:501$ which is approximately $5:4$. You can measure it by taking the ratio of the vanishing angles $\alpha/\beta$ (see picture 1) because we ...
• 8,397

### Transform a point into another point

The hint with the perspective division was already mentioned by ratchet freak, but I'd like to add some explanation of how to come up with the solution. First of all, remember that homogenous ...
• 1,310
Accepted

### 3D rotation matrix around vector

There is a direct formula for the rotation matrix for an arbitrary axis and angle. Given a unit vector $a = (a_x, a_y, a_z)$ and angle $\theta$, the matrix can be constructed as follows (derivation ...
• 24.7k