Example #1
0
File: main.c Project: AJ92/OpenGL
GLUSboolean update(GLUSfloat time)
{
	static GLfloat angle = 0.0f;

    GLfloat modelMatrix[16];
    GLfloat normalMatrix[9];

    // Calculate the model matrix ...
    glusMatrix4x4Identityf(modelMatrix);
    glusMatrix4x4RotateRzRyRxf(modelMatrix, 0.0f, angle, -90.0f);

    glUniformMatrix4fv(g_modelMatrixLocation, 1, GL_FALSE, modelMatrix);

    // Calculate the normal matrix ...
    glusMatrix4x4ExtractMatrix3x3f(normalMatrix, modelMatrix);
    glUniformMatrix3fv(g_normalMatrixLocation, 1, GL_FALSE, normalMatrix);

    //

	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	glDrawElements(GL_PATCHES, g_numberIndicesPlane, GL_UNSIGNED_INT, 0);

	//

	angle += time * 45.0f;

	return GLUS_TRUE;
}
Example #2
0
void Matrix4x4::rotateRzRyRx(float anglez, float angley, float anglex)
{
	glusMatrix4x4RotateRzRyRxf(m, anglez, angley, anglex);
}