This operation, as I understand it, is supposed to give a vector pointing from camera to vertex:

`vec4 P = p3d_ModelViewMatrix * p3d_Vertex;`

Except it gives strange results. However this works:

`vec4 P = p3d_Vertex - p3d_ModelViewMatrixInverse * vec4(0.0, 0.0, 0.0, 1.0)`

I understand why the second works, but not why the first one doesn’t work.

As I understand it, the modelviewmatrix translates a model coordinate into an eye coordinate.

This is the same as giving the vector pointing from the eye to the vertex. Or am I wrong?

I saw someone commenting out p3d_ModelViewMatrix as broken in their code. gist.github.com/croxis/6627927