Posted By: Steempipe
Question about mat_effect - 01/18/16 02:35
Hi,
If I use this code, I get the anticipated results, a texture tiled 2x:
But if I use this code I don't. Am I misinterpreting the usage from the manual?
And even if I do this I get the results like the second image:
I'm wondering why, but its not clear in the manual.
Thanks for any clarification.
If I use this code, I get the anticipated results, a texture tiled 2x:
Code:
function mtlEffect_init() { float rotation_matrix[16] = { 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 }; float temp_matrix[16] = { 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 }; // scale the texture rotation_matrix[0] = 2; rotation_matrix[5] = 2; mat_set(temp_matrix, rotation_matrix); mat_effect1 = temp_matrix; }
But if I use this code I don't. Am I misinterpreting the usage from the manual?
Code:
function mtlEffect_init() { float rotation_matrix[16] = { 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 }; float temp_matrix[16]; // scale the texture rotation_matrix[0] = 2; rotation_matrix[5] = 2; mat_set(temp_matrix, rotation_matrix); mat_effect1 = temp_matrix; }
And even if I do this I get the results like the second image:
Code:
function mtlEffect_init() { float rotation_matrix[16]; mat_identity(rotation_matrix); // scale the texture rotation_matrix[0] = 2; rotation_matrix[5] = 2; mat_effect1 = rotation_matrix; }
I'm wondering why, but its not clear in the manual.
Thanks for any clarification.