What structure do I have to use to get the modelview matrix by glGetDoublev. I have tried this one:
mat = new GLdouble;
but it didn’t work, then I also tried this:
What do I have to do?
could u poast some more code you are using around the glGetDoublev
I hope this helps with your program. I am working with the same call on my program right now. This is what I am using, so maybe if would work for you also.
for (int i = 0; i < 16; i++)
modelMatrix[i] = 0;
A couple of things: before you get the matrix you need to push it, because getting it takes the top matrix off the stack (not just copies it), also, I think you need to initialize the variable that you are passing it into. Good luck, I hope this helps.
I found out what it was. You have to call the glutCreateWindow() first. What is this function does that makes it work?
Besides, you don’t need to initialize your variable, nor do need to push the matrix.
[This message has been edited by martinjy (edited 05-29-2001).]
Before any openGL function can be used, the pixelformat of the window has to be setup to use OpenGL. glutCreateWindow does that for you, thus, you have to do that before any of your gl* calls will be valid.