Working on model loading and added poker table
This commit is contained in:
@ -131,13 +131,41 @@ void shaderUsePosition(shader_t *shader,
|
||||
//Rotation, we do each axis individually
|
||||
axis[0] = 1, axis[1] = 0, axis[2] = 0;
|
||||
glm_rotate(MATRIX_POSITION, pitch, axis);
|
||||
|
||||
axis[0] = 0, axis[1] = 1;
|
||||
glm_rotate(MATRIX_POSITION, yaw, axis);
|
||||
|
||||
axis[1] = 0, axis[2] = 1;
|
||||
glm_rotate(MATRIX_POSITION, roll, axis);
|
||||
|
||||
//Send to the shader.
|
||||
glUniformMatrix4fv(shader->uniModl, 1, GL_FALSE, MATRIX_POSITION[0]);
|
||||
}
|
||||
|
||||
void shaderUsePositionAndScale(shader_t *shader,
|
||||
float x, float y, float z,
|
||||
float pitch, float yaw, float roll,
|
||||
float scaleX, float scaleY, float scaleZ
|
||||
) {
|
||||
mat4 MATRIX_POSITION;
|
||||
vec3 axis;
|
||||
|
||||
// Identify mat.
|
||||
glm_mat4_identity(MATRIX_POSITION);
|
||||
|
||||
// Position
|
||||
axis[0] = x, axis[1] = y, axis[2] = z;
|
||||
glm_translate(MATRIX_POSITION, axis);
|
||||
|
||||
// Rotation
|
||||
axis[0] = 1, axis[1] = 0, axis[2] = 0;
|
||||
glm_rotate(MATRIX_POSITION, pitch, axis);
|
||||
axis[0] = 0, axis[1] = 1;
|
||||
glm_rotate(MATRIX_POSITION, yaw, axis);
|
||||
axis[1] = 0, axis[2] = 1;
|
||||
glm_rotate(MATRIX_POSITION, roll, axis);
|
||||
|
||||
// Scale
|
||||
axis[0] = scaleX, axis[1] = scaleY, axis[2] = scaleZ;
|
||||
glm_scale(MATRIX_POSITION, axis);
|
||||
|
||||
glUniformMatrix4fv(shader->uniModl, 1, GL_FALSE, MATRIX_POSITION[0]);
|
||||
}
|
Reference in New Issue
Block a user