2 registered members (Ayumi, 1 invisible),
584
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Question about mat_effect
#457424
01/18/16 02:35
01/18/16 02:35
|
Joined: Dec 2003
Posts: 1,097 Maryland, USA
Steempipe
OP
Serious User
|
OP
Serious User
Joined: Dec 2003
Posts: 1,097
Maryland, USA
|
Hi, If I use this code, I get the anticipated results, a texture tiled 2x:
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?
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:
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.
|
|
|
|