i am using this method for mouse movement
void CameraMovement(void)
{
float x = 0;
float y = 0;
float z = 0;
if (dbMouseX() < 20)
{
x = -4;
}
else if (dbMouseX() > dbScreenWidth() - 20)
{
x = +4;
}
if (dbMouseY() < 20)
{
z = +4;
}
else if (dbMouseY() > dbScreenHeight() - 20)
{
z = -4;
}
if (dbMouseZ() > 0 )
{
y = -4;
}
else if (dbMouseZ() < 0)
{
y = +4;
}
if (x != 0 || z != 0 || y !=0)
{
dbPositionCamera(dbCameraPositionX()+x,dbCameraPositionY() + y,dbCameraPositionZ()+z);
}
}
the problem here is with mouse Z, mouse Z is used to zoom in and out in 3d Space , and i want it to reset each loop cause if i wont reset it it will continue to move on the Y axis up or down depending on dbMouseZ earlier action.
the dbMouseZ() will keep its action even if not touched after the loop cycle , so it will move in the last direction over and over again and i want it to move just once , cause the number is increasing or decreasing which makes the camera to Keep going up or down on the Y Axis.
can someone help ?
ty for your time.