Let's say I have the following vertex shader code below:
attribute vec4 vPos;
uniform mat4 MVP;
uniform mat4 LookAt;
void main{
gl_Position = MVP * vPos;
}
How do I use the LookAt
matrix in this shader to position the eye of the camera? I have tried LookAt * MVP * vPos
but that didn't seem to work as my triangle just disappeared off screen!