iv'e used code from many different tutorials, but still can't get it to work.
---
my experimentations are as follows:
variables:
Code:
float PositionX = 0.0;
float PositionY = 0.8;
float PositionZ = 5.0;
float ViewX = 0.0;
float ViewY = 0.8;
float ViewZ = 0.0;
float UpX = 0.0;
float UpY = 1.0;
float UpZ = 0.0;
float CamSpeed = 0.1;
float FarClipDist = 25.0;
int SCREEN_WIDTH = 600;
int SCREEN_HEIGHT = 518;
POINT mousePos;
int middleX = SCREEN_WIDTH >> 1;
int middleY = SCREEN_HEIGHT >> 1;
in the VK_UP event:
Code:
PositionZ = PositionZ + -CamSpeed;
ViewZ = ViewZ + -CamSpeed;
if (PositionZ < 0.2)
{
PositionZ = 0.2;
}
void RenderScene();
in the VK_DOWN event:
Code:
PositionZ = PositionZ + CamSpeed;
void RenderScene();
in the VK_RIGHT event:
Code:
PositionX = PositionX + CamSpeed;
ViewX = ViewX + CamSpeed;
void RenderScene();
in the VK_LEFT event:
Code:
PositionX = PositionX + -CamSpeed;
ViewX = ViewX + -CamSpeed;
void RenderScene();
for mouse movement:
Code:
GetCursorPos(&mousePos);
ViewX = mousePos.x / 50.0;
ViewY = -mousePos.y / 50.0;
the only problem with my method, is i can't figure out how to get the camera to move in the direction the camera is looking
i will also try the code you posted vNvNation
-psychopath