Facade
04-24-2000, 01:24 PM
HI,
I am trying to get user input from the client and move around in 3D space. I thought it would be an easy task buy doing something like this
case 'f' :
{
veiwerPos.z += 1;
} break;
case 'r':
{
veiwerPos.z -=1;
} break;
case 'g':
{
veiwerPos.x += 1;
} break;
case 'h' :
{
veiwerPos.x -= 1;
} break;
vgvec2 pos(event->mouseDeltaX, event>mouseDeltaY);
angleX += pos.x;
angleY += pos.y;
if(angleY > 45.0f)
angleY = 45.0f;
if(angleY < -45.0f)
angleY = -45.0f;
axis = pos.Normalize();
glRotatef(angleX, 0, axis, 0);
glRotatef(angleY, axis, 0, 0);
glTranslatef(veiwerPos.x, veiwerPos.y, veiwerPos.z )
I am not saying this works but it is not how I want it to work. If any one that knows what I am doing wrong or can help me out please e-mail me or respond to this post
Thanks
David Gholami
I am trying to get user input from the client and move around in 3D space. I thought it would be an easy task buy doing something like this
case 'f' :
{
veiwerPos.z += 1;
} break;
case 'r':
{
veiwerPos.z -=1;
} break;
case 'g':
{
veiwerPos.x += 1;
} break;
case 'h' :
{
veiwerPos.x -= 1;
} break;
vgvec2 pos(event->mouseDeltaX, event>mouseDeltaY);
angleX += pos.x;
angleY += pos.y;
if(angleY > 45.0f)
angleY = 45.0f;
if(angleY < -45.0f)
angleY = -45.0f;
axis = pos.Normalize();
glRotatef(angleX, 0, axis, 0);
glRotatef(angleY, axis, 0, 0);
glTranslatef(veiwerPos.x, veiwerPos.y, veiwerPos.z )
I am not saying this works but it is not how I want it to work. If any one that knows what I am doing wrong or can help me out please e-mail me or respond to this post
Thanks
David Gholami