Hi guys,

Im having trouble getting my head around NDC. Assuming we are using OpenGL 3, and doing the perspective projection ourselves, do we have to worry about normalized device coordinates?

In perspective projection, a 3D point in a truncated pyramid frustum (eye coordinates) is mapped to a cube (NDC); the x-coordinate from [l, r] to [-1, 1], the y-coordinate from [b, t] to [-1, 1] and the z-coordinate from [n, f] to [-1, 1].

I am doing the perspective transform via a tutorial like this:

```
void perspective(GLfloat *matrix, GLfloat fov, GLfloat aspect, GLfloat nearz, GLfloat farz)
{
GLfloat range;
range = tan(fov * 0.00872664625) * nearz; /* 0.00872664625 = PI/360 */
memset(matrix, 0, sizeof(GLfloat) * 16);
matrix[0] = (2 * nearz) / ((range * aspect) - (-range * aspect));
matrix[5] = (2 * nearz) / (2 * range);
matrix[10] = -(farz + nearz) / (farz - nearz);
matrix[11] = -1;
matrix[14] = -(2 * farz * nearz) / (farz - nearz);
}
```

Kind regards,

Fugi