Jump to content
  • Advertisement
Sign in to follow this  
srky982

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.

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

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


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


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


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