Jump to content
  • Advertisement
Sign in to follow this  
Gumgo

cg: cgSetMatrixParameterf_

This topic is 3222 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

Hello, I'm having some trouble understanding which cgSetMatrixParameter function to use in order to pass matrices to a cg shader. I have a 4x4 matrix
11 12 13 14
21 22 23 24
31 32 33 34
41 42 43 44
stored in row-major order:
11 12 13 14 | 21 22 23 24 | 31 32 33 34 | 41 42 43 44
and I need to send it to the shader in the format of a 4x3 matrix. So (correct me if I'm wrong), the entries of this matrix should be (from the previous one):
11 21 31
12 22 32
13 23 33
14 24 34
I've read that cg stores matrices in row-major order as well, so if the 4x3 matrix looks like this:
11 21 31 | 12 22 32 | 13 23 33 | 14 24 34
How does cgSetMatrixParameterfc/r actually work? If I'm setting a 4x3 matrix from a 4x4 one, which entries are mapped to which from the 4x4 one to the 4x3 one? Without knowing this it's hard to figure out what to do.

Share this post


Link to post
Share on other sites
Advertisement
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!