Hi All,
This is my first post here so please forgive any noobiness. I just started learning openGL couple days ago. I tried to creat a simple program but it seems to not be working. It compiles properly but other then that when I run it, I don’t get any output. I am basically trying to compute a projection matrix (i tried both gluPerspective and glFrustum) and then using glGetDoublev to retreive the data.
It all seems to compile but when I run it, glGetDoublev does nothing. The data buffer is completely empty. I did the calulcations by hand so I know the numbers that should be in the matrix.
Any help will be appreciated. Here’s the code I am using (visual studio 2005).
int _tmain(int argc, _TCHAR* argv[])
{
GLdouble temp[16];
glBegin(GL_TRIANGLES);
glVertex3d(100.0,0.0,0.0);
glVertex3d(0.0,200.0,0.0);
glVertex3d(-300.0,-400.0,0.0);
glEnd();
glMatrixMode(GL_PROJECTION);
//GLdouble *temp = (GLdouble *) calloc(16,sizeof(GLdouble));
glLoadIdentity();
gluPerspective(12.959025,2.3658537,361.0,2696.0);
//glFrustum(-97.0,97.0,-41.0,41.0,361.0,2696.0);
glGetDoublev(GL_PROJECTION_MATRIX ,temp);
temp[0] = 10;
return 0;
}