Commit 4f7e4e1f188345e3ec2e0ed994f0cc8c0373796d

Thomas de Grivel 2024-01-15T13:48:05

deg -> rad

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/libc3/window/sdl2/demo/earth.c b/libc3/window/sdl2/demo/earth.c
index 4b87c68..d665427 100644
--- a/libc3/window/sdl2/demo/earth.c
+++ b/libc3/window/sdl2/demo/earth.c
@@ -80,11 +80,11 @@ bool earth_render (s_sequence *seq)
   sphere             =  map->value[2].data.struct_.data;
   gl_camera_set_aspect_ratio(camera, window->w, window->h);
   camera->rotation.x += seq->dt * (*camera_rot_x_speed) *
-    360.0;
+    M_PI * 2.0f;
   if (camera->rotation.x > 180 || camera->rotation.x < 0)
     *camera_rot_x_speed *= -1.0;
   camera->rotation.z += seq->dt * EARTH_CAMERA_ROTATION_Z_SPEED *
-    360.0;
+    M_PI * 2.0f;
   assert(glGetError() == GL_NO_ERROR);
   gl_camera_render(camera);
   assert(glGetError() == GL_NO_ERROR);