summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/cube.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c
index e17dcb752a..0beee59777 100644
--- a/apps/plugins/cube.c
+++ b/apps/plugins/cube.c
@@ -75,8 +75,8 @@ static long matrice[3][3];
75 75
76static int nb_points = 8; 76static int nb_points = 8;
77 77
78static int x_off = 56; 78static int x_off = LCD_WIDTH/2;
79static int y_off = 31; 79static int y_off = LCD_HEIGHT/2;
80static int z_off = 600; 80static int z_off = 600;
81 81
82/* Precalculated sine and cosine * 10000 (four digit fixed point math) */ 82/* Precalculated sine and cosine * 10000 (four digit fixed point math) */
@@ -224,17 +224,23 @@ static void cube_viewport(void)
224 } 224 }
225} 225}
226 226
227#if LCD_HEIGHT > 100
228#define DIST 80
229#else
230#define DIST 40
231#endif
232
227static void cube_init(void) 233static void cube_init(void)
228{ 234{
229 /* Original 3D-position of cube's corners */ 235 /* Original 3D-position of cube's corners */
230 sommet[0].x = -40; sommet[0].y = -40; sommet[0].z = -40; 236 sommet[0].x = -DIST; sommet[0].y = -DIST; sommet[0].z = -DIST;
231 sommet[1].x = 40; sommet[1].y = -40; sommet[1].z = -40; 237 sommet[1].x = DIST; sommet[1].y = -DIST; sommet[1].z = -DIST;
232 sommet[2].x = 40; sommet[2].y = 40; sommet[2].z = -40; 238 sommet[2].x = DIST; sommet[2].y = DIST; sommet[2].z = -DIST;
233 sommet[3].x = -40; sommet[3].y = 40; sommet[3].z = -40; 239 sommet[3].x = -DIST; sommet[3].y = DIST; sommet[3].z = -DIST;
234 sommet[4].x = 40; sommet[4].y = -40; sommet[4].z = 40; 240 sommet[4].x = DIST; sommet[4].y = -DIST; sommet[4].z = DIST;
235 sommet[5].x = -40; sommet[5].y = -40; sommet[5].z = 40; 241 sommet[5].x = -DIST; sommet[5].y = -DIST; sommet[5].z = DIST;
236 sommet[6].x = -40; sommet[6].y = 40; sommet[6].z = 40; 242 sommet[6].x = -DIST; sommet[6].y = DIST; sommet[6].z = DIST;
237 sommet[7].x = 40; sommet[7].y = 40; sommet[7].z = 40; 243 sommet[7].x = DIST; sommet[7].y = DIST; sommet[7].z = DIST;
238} 244}
239 245
240static void line(int a, int b) 246static void line(int a, int b)