# 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.

## 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.

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632991
• Total Posts
3009753
• ### Who's Online (See full list)

There are no registered users currently online

×