# Matrix problem

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

## Recommended Posts

Hi,if someone can tell me where i am wrong: 1) If i have a code like this: ------------------------------------------------ GLfloat *a[16]; float c; float d; c=1.0f; d=0.0f; a[0]=&c;a[4]=&d;a[8]=&d;a[12]=&d; a[1]=&d;a[5]=&c;a[9]=&d;a[13]=&d; a[2]=&d;a[6]=&d;a[10]=&c;a[14]=&d; a[3]=&d;a[7]=&d;a[11]=&d;a[15]=&c; ------------------------------------------------ I did some rotations in my program and after them i call: glLoadMatrixf(a); But some wierd things happened,shouldnt that be equal like calling: glLoadIdentity(); 2) Where are data of Matrix stored if i dont load a new Matrix? Lets say i run a third NeHe tutorial and want to get Matrix? Thanks a lot for helping a noob:)

##### Share on other sites
1: glMulsMatrix want's a pointer to 16 GLfloat, you're passing a pointer to 16 pointers to GLfloat. Not anywhere near what glMultMatrix wants.

2: What matrix are you talking about?

##### Share on other sites
1)I see now the declaration was completely wrong.Thanks!
2)I was talking about the matrix that was loaded by default in openGL
There must be one if I do all the transforms but how to get data from it?

##### Share on other sites
You can get the matrix with glGetFloatv. Pass the matrix you want, like GL_MODELVIEW_MATRIX, and a pointer to where you want the values stored.

##### Share on other sites
Thanks a lot!You told me everything i wanted to know,for now:)

1. 1
Rutin
45
2. 2
3. 3
4. 4
5. 5
JoeJ
19

• 11
• 15
• 9
• 10
• 13
• ### Forum Statistics

• Total Topics
633004
• Total Posts
3009840
• ### Who's Online (See full list)

There are no registered users currently online

×