Sign in to follow this  

Math Operations GLSL

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by jyk
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.)



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

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this