Jump to content
  • Advertisement
Sign in to follow this  
MARS_999

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.

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
Advertisement
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
Quote:
Original post by MARS_999
Ah I see now. So the eyeVec *= tangentBasis would also be a row vector then...
Yes, that's right.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!