Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

The glsl uniform modelViewProjectionMatrix is different from ofCamera::getModelViewProjectionMatrix()

$
0
0

@roelkok wrote:

In a vertex shader OF passes the modelViewProjectionMatrix uniform by default which typically is used for gl_Position = modelViewProjectionMatrix * position;. I expected to get this same matrix from ofCamera::getModelViewProjectionMatrix().
However the following doesn't give the result I expect.

ofApp.cpp

myShader.setUniformMatrix4f("mvp", myCamera.getModelViewProjectionMatrix());

myShader.vert

gl_Position = mvp * position;

How do I get the mvp matrix of a camera that's passed by default to modelViewProjectionMatrix but when that camera is not active?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929