Hi,
Very new to opengl and am stuck, big time… I have programmed a game and am looking at it at an overview… I want to be able to flip from overview to looking at the game from the sidelines… Can’t seem to get it though
void newAngle()
{
gluLookAt(cx, cy, cz, cx + nx,cy + ny,cz + nz,0.0f,1.0f,0.0f);
}
void moveCamera(int direction)
{
cz = cz + direction*(nz)*0.4;
glLoadIdentity();
newAngle();
}
void inputKey(int key, int x, int y)
{
switch(key)
{
case GLUT_KEY_UP:
moveCamera(1);
break;
case GLUT_KEY_DOWN:
moveCamera(-1);
break;
}
glutPostRedisplay();
}
This moves the cmaera back and forth, I have tried messing with the x, y co-ordinates but I just can’t get it.
Cheers,
Walbert