r/opengl•
Nazoz

Whats the name of combined view and projection matrix?

Solved

Weirdly enough i cant find the name for this.

Posted May 26, 2019, 3:41 PM UTC

611
jtsiomb•

Why would it have a name? In classic OpenGL modelview and projection matrices where separate, while model and view were combined and set as one. There is a shader built-in uniform for the combination of the modelview and projection matrices called gl_ModelViewProjection if that counts.

3
NazozOP•

Hmm, makes sense i guess.

I guess i'll just refer to it as ViewProjectionMatrix in my code.

5
specialpatrol•

Typically your view matrix is going to change all the time as your camera moves about, the projection is more fixed to the properties of the camera (the "intrinsics" and screen size).

3
NazozOP•

Yeah, thats what im programming around when it comes to the camera.

I have a camera component that contains the view and projection matrix separated, along with Fov, aspect ratio, near, far, lookAt position and lookFrom position.

Then before i render, i update the viewmatrix, create a combined projectionViewMatrix, all on the CPU before i send indices, vertices of renderables and the projectionViewMatrix to the GPU.

​

Does that sound about right?

1
specialpatrol•

Yeah sure. But the useful thing about the view matrix (separately), is that you multiply the world positions by it to put things in camera space. You might not want that though.

2
Dead_Man_01•

I guess you could call it the camera matrix.

1
jtsiomb•

No, that's very confusing. Camera matrix is another commonly used name for the view matrix.

7
[deleted]•

[deleted]

1
AntiProtonBoy•

In OpenGL parlance, it is generally known as the Model-View-Projection matrix, or MVP for short.

SVG and some other document formats calls it the Current Transformation Matrix (CTM).

Either way, you're dealing with a matrix that embodies a cumulative set of transforms, and it is your responsibility to give your matrices meaning and establish context.

1