//prepare scene
m_ModelMatrix = IDENTITY_MATRIX;
m_ProjectionMatrix = IDENTITY_MATRIX;
m_ViewMatrix = IDENTITY_MATRIX;
RotateAboutX(&m_ModelMatrix,90); //have also tried using this after Translate
ScaleMatrix(&m_ViewMatrix, m_ScaleX, m_ScaleY, m_ScaleZ); //scales cords x,y,z
TranslateMatrix(&m_ViewMatrix, 0, 0, m_TranslateZ); //
//resizing
glViewport(0, 0, (GLsizei)cx, (GLsizei)cy);
//fovy is 60. Have tried others.
m_ProjectionMatrix = CreateProjectionMatrix(m_fovy,(float)CurrentWidth / CurrentHeight,1.0f,100.0f);
//drawing.
//have also tried rotating here.
glUniformMatrix4fv(m_ModelMatrixUniformLocation, 1, GL_FALSE, m_ModelMatrix.m);
glUniformMatrix4fv(m_ViewMatrixUniformLocation, 1, GL_FALSE, m_ViewMatrix.m);
glBindVertexArray(m_vVaoID.at(i));
glDrawArrays(DRAW_TYPE, 0, m_vGLSizeCount.at(i));
//shader
const GLchar* VertexShader =
{
"#version 330\n"\
"layout(location=0) in vec4 in_Position;\n"\
"layout(location=1) in vec4 in_Color;\n"\
"out vec4 ex_Color;\n"\
"uniform mat4 vsModelMatrix;\n"\
"uniform mat4 vsViewMatrix;\n"\
"uniform mat4 vsProjectionMatrix;\n"\
"void main(void)\n"\
"{\n"\
"gl_Position = (vsProjectionMatrix * vsViewMatrix * vsModelMatrix) * in_Position;\n"\
"ex_Color = in_Color;\n"\
"}\n"
};