two questions:
- I just downloaded new drivers for my video card and openGL is working much faster now. Sandra (from SiSoft) tells me that my video BIOS is old. Would this increase performance even more?
2). I have successfully been able to creat a camera structure and move around in a scene with textured polygons and lighting enabled. Movement is constricted to the xz plane. The up and down keys move back and forth, the right and left keys strafe, and the mouse looks around the scene. Movement with the arrow keys is smooth. However, when I use the mouse to look around it is jerky. I think this is because I use WM_MOUSEMOVE in win proc to mouselook. The following is the code that sets the camera position:
void setCamera()
{
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRotatef(cameraData.orientation[0], 1,0,0);
glRotatef(cameraData.orientation[1], 0,1,0);
glRotatef(cameraData.orientation[2], 0,0,1);
glTranslatef(-cameraData.position[0],-cameraData.position[1],
cameraData.position[2]);
}
This is WM_MOUSEMOVE:
case WM_MOUSEMOVE:
if (LOWORD(lParam) > 400) cameraData.orientation[1] += angularSpeed;
if (LOWORD(lParam) < 400) cameraData.orientation[1] -= angularSpeed;
if (HIWORD(lParam) > 300) cameraData.orientation[0] += angularSpeed;
if (HIWORD(lParam) < 300) cameraData.orientation[0] -= angularSpeed;
SetCursorPos(400,300);
if (cameraData.orientation[0] > 90) cameraData.orientation[0] = 90;
if (cameraData.orientation[0] < -90) cameraData.orientation[0] =-90;
RenderScene();
SwapBuffers(hDC);
ValidateRect(hWnd,NULL);
break;