camera y position control by arrows UP/DOWN

This commit is contained in:
Volodymyr Patuta 2020-12-22 16:04:12 +01:00
parent 1197e69fa4
commit 549d59e873
1 changed files with 5 additions and 3 deletions

View File

@ -46,7 +46,7 @@ struct cam_t {
float theta; float theta;
}; };
static cam_t _cam = {0, 1.0f, 50, 0}; static cam_t _cam = {0, 1.0f, 10, 0};
static float _v = 0.1f; static float _v = 0.1f;
@ -251,8 +251,10 @@ void key(int keycode) {
double dtheta = M_PI, step = 5.0; double dtheta = M_PI, step = 5.0;
switch(keycode) { switch(keycode) {
case GL4DK_UP: case GL4DK_UP:
_cam.y += 5 * dtheta;
break; break;
case GL4DK_DOWN: case GL4DK_DOWN:
_cam.y -= 5 * dtheta;
break; break;
case GL4DK_RIGHT: case GL4DK_RIGHT:
_s += 30.0f; _s += 30.0f;