# Math Operations GLSL

This topic is 4649 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have just stumbled across a math issue that makes no sense to me why but it does make a difference when I compile it in RM and see the effect change.
mat3 tangentBasis;
vec3 eyeVec;

eyeVec *= tangentBasis;//works fine
eyeVec = eyeVec * tangentBasis;//same

eyeVec = tangentBasis * eyeVec;//different outcome


To me multiplying the matrix by a the vec3 shouldn't make a difference... Thanks

##### Share on other sites
I don't know anything about GLSL, but these two operations:
eyeVec = eyeVec * tangentBasis;eyeVec = tangentBasis * eyeVec;
Are different operations, and you should expect them to have different results. (Specifically, the first treats 'eyeVec' as a row vector, while the second treats it as a column vector.)

##### Share on other sites
Quote:
 Original post by jykI don't know anything about GLSL, but these two operations:eyeVec = eyeVec * tangentBasis;eyeVec = tangentBasis * eyeVec;Are different operations, and you should expect them to have different results. (Specifically, the first treats 'eyeVec' as a row vector, while the second treats it as a column vector.)

Ah I see now. So the eyeVec *= tangentBasis would also be a row vector then...

##### Share on other sites
Quote:
 Original post by MARS_999Ah I see now. So the eyeVec *= tangentBasis would also be a row vector then...
Yes, that's right.

1. 1
Rutin
31
2. 2
3. 3
4. 4
5. 5

• 13
• 49
• 11
• 10
• 14
• ### Forum Statistics

• Total Topics
632965
• Total Posts
3009546
• ### Who's Online (See full list)

There are no registered users currently online

×