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 ...
• 23.6k
Accepted

• 156

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,580

When should quaternions be used to represent rotation and scaling in 3D?

I want to start with misconceptions: Modern GPUs (NVIDIA for quite a while, and AMD since Southern Islands) do not meaningfully support vector/matrix operations natively in hardware. They are vector ...
• 3,842
Accepted

When is it better to upload partial model matrices to the vertex shader?

Doing math with uniforms is a shader won't usually get you any performance over doing it on the CPU. A CPU isn't slower than a GPU at doing matrix math, it just isn't structured so as to do large ...
• 3,842
Accepted

• 276

How to combine rotation in 2 axis into one matrix

Yes, just multiply them in reverse order: Matrix myrotation = Matrix.CreateRotationX(xrot) * Matrix.CreateRotationZ(zrot); EDIT. My answer only applies if you ...
Accepted

Graphics Pipeline: Viewspace & Back face culling incorrectly

I (believe) I've solved this (even if it has taken 2 days). My problem was essentially I wanted to take the dot product of the face normal, and line-of-sight vector like below And determine the angle ...
• 203

Rotate line around center

Trick is, to move the entire object so that the point about which you want to rotate is at the center. Then rotate and after that counter move it so that the point is were it was. In fact this is not ...
• 8,169
Accepted

Animating a smooth linear transformation

As a general rule, you cannot interpolate transformation matrices. In stead, you decompose them into their individual values, then interpolate those and recompose. The Möbius transformation as ...
• 266
Accepted

Zoom in orthographic vs perspective projection

Perspective projection changes the size of an object as it's distance changes, while orthographic projection does not. That is part of the definition of those projection types. To simplify things a ...
• 7,341
Accepted

Minimum requirements to uniquely represent a 3D object in space

A rigid body has 6 degrees of freedom, in 3D- space. So that means you need 6 values to represent the object. The common way to do this is to store a position vector for position and 3 rotations. But ...
• 8,169