fix typo + planet sizes more logical (in sun scale * 12)

This commit is contained in:
Volodymyr Patuta 2021-01-02 18:35:37 +01:00
parent 7a1097eecc
commit 82ad5010fd

View File

@ -255,12 +255,12 @@ static void goto_obj(float * mvMat) {
lookAt(mvMat, _cam.x, _cam.y, _cam.z, 50.4f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f);
move_to(50.4f, 1.0f, 5.0f);
break;
case 7: // NEPTUNE
case 7: // URANUS
_a = 0;
lookAt(mvMat, _cam.x, _cam.y, _cam.z, 65.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f);
move_to(65.0f, 1.0f, 5.0f);
break;
case 8: // URANUS
case 8: // NEPTUNE
_a = 0;
lookAt(mvMat, _cam.x, _cam.y, _cam.z, 75.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f);
move_to(75.0f, 1.0f, 4.0f);
@ -318,22 +318,22 @@ void draw(void) {
draw_object(nmv, projMat, _sun, _r/24.5f, 0, 1, 0, 1, 0, 2, 0, 0, 0);
// MERCURY
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
draw_object(nmv, projMat, _planet[0], _a/87.97f, 0, 1, 4.2f, 1, 0, (1/227.0f)*12, _r/59.0f, 0, 1);
draw_object(nmv, projMat, _planet[0], _a/87.97f, 0, 1, 4.2f, 1, 0, (2/227.0f)*10, _r/59.0f, 0, 1);
// VENUS
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
draw_object(nmv, projMat, _planet[1], _a/224.7f, 0, 1, 7.9f, 1, 0, (1/113.0f)*12, _r/243.75f, -0.1773f, -1);
draw_object(nmv, projMat, _planet[1], _a/224.7f, 0, 1, 7.9f, 1, 0, (2/113.0f)*10, _r/243.75f, -0.1773f, -1);
// EARTH
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
draw_object(nmv, projMat, _planet[2], _a/365.2425f, 0, 1, 10.0f, 1, 0, (1/108.0f)*12, _r, -0.234f, 1);
draw_object(nmv, projMat, _planet[2], _a/365.2425f, 0, 1, 10.0f, 1, 0, (2/108.0f)*10, _r, -0.234f, 1);
// Moon
draw_object(nmv, projMat, _moon[0], 1, 0, 0, 4.0f, 0, 0, (1/5.0f), 1, 0, 0);
// MARS
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
draw_object(nmv, projMat, _planet[3], _a/686.98f, 0, 1, 15.2f, 1, 0, (1/208.0f)*12, _r/1.0416f, -0.252f, 1);
draw_object(nmv, projMat, _planet[3], _a/686.98f, 0, 1, 15.2f, 1, 0, (2/208.0f)*10, _r/1.0416f, -0.252f, 1);
memcpy(cpy, nmv, sizeof cpy);
@ -345,53 +345,53 @@ void draw(void) {
// JUPITER
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
draw_object(nmv, projMat, _planet[4], _a/(12 * 365.2425f), 0, 1, 30.0f, 1, 0, (1/9.7f)*12, _r/0.416f, -0.031f, 1);
draw_object(nmv, projMat, _planet[4], _a/(12 * 365.2425f), 0, 1, 30.0f, 1, 0, (2/9.7f)*10, _r/0.416f, -0.031f, 1);
memcpy(cpy, nmv, sizeof cpy);
// Io
draw_object(nmv, projMat, _moon[3], _r*3.0f, 0, 0.1f, 3.0f, 0, 2, (1/11.2f), 0, 0, 0);
draw_object(nmv, projMat, _moon[3], _r*3.0f, 0, 0.1f, 1.0f, 0, 1, (1/11.2f), 0, 0, 0);
// Europa
memcpy(nmv, cpy, sizeof nmv);
draw_object(nmv, projMat, _moon[4], _r/2.0f, 0, 0.1f, -4.0f, 0, -1, (1/13.2f), 0, 0, 0);
draw_object(nmv, projMat, _moon[4], _r/2.0f, 0, 0.1f, -2.0f, 0, -1, (1/13.2f), 0, 0, 0);
// Ganymede
memcpy(nmv, cpy, sizeof nmv);
draw_object(nmv, projMat, _moon[5], _r/3.0f, 0, 0.1f, -5.0f, 0, -1.5f, (1/9.0f), 0, 0, 0);
draw_object(nmv, projMat, _moon[5], _r/3.0f, 0, 0.1f, -3.0f, 0, -1.5f, (1/9.0f), 0, 0, 0);
// Callisto
memcpy(nmv, cpy, sizeof nmv);
draw_object(nmv, projMat, _moon[6], _r/5.0f, 0, 0.1f, 6.0f, 0, -2.5f, (1/10.0f), 0, 0, 0);
draw_object(nmv, projMat, _moon[6], _r/5.0f, 0, 0.1f, 4.0f, 0, 0, (1/10.0f), 0, 0, 0);
// SATURN
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
draw_object(nmv, projMat, _planet[5], _a/(30 * 365.2425f), 0, 1, 50.4f, 1, 0, (1/11.4f)*12, _r/0.4583f, -0.267f, 1);
draw_object(nmv, projMat, _planet[5], _a/(30 * 365.2425f), 0, 1, 50.4f, 1, 0, (2/11.4f)*10, _r/0.4583f, -0.267f, 1);
memcpy(cpy, nmv, sizeof cpy);
// Enceladus
draw_object(nmv, projMat, _moon[7], _r*5.0f, 0, 0.1f, 2.0f, 0, -2.0f, (1/20.0f), 0, 0, 0);
draw_object(nmv, projMat, _moon[7], _r*5.0f, 0, 0.1f, 1.0f, 0, -1.0f, (1/20.0f), 0, 0, 0);
// Dione
memcpy(nmv, cpy, sizeof nmv);
draw_object(nmv, projMat, _moon[8], _r*4.1f, 0, 0.1f, -3.0f, 0, -0.5f, (1/18.0f), 0, 0, 0);
draw_object(nmv, projMat, _moon[8], _r*4.1f, 0, 0.1f, -2.0f, 0, -0.5f, (1/18.0f), 0, 0, 0);
// Rhea
memcpy(nmv, cpy, sizeof nmv);
draw_object(nmv, projMat, _moon[9], _r*3.2f, 0, 0.1f, 4.0f, 0, -2.5f, (1/15.0f), 0, 0, 0);
draw_object(nmv, projMat, _moon[9], _r*3.2f, 0, 0.1f, 3.0f, 0, -2.5f, (1/15.0f), 0, 0, 0);
// Titan
memcpy(nmv, cpy, sizeof nmv);
draw_object(nmv, projMat, _moon[10], _r/4.3f, 0, 0.1f, -6.0f, 0, -5.2f, (1/10.0f), 0, 0, 0);
draw_object(nmv, projMat, _moon[10], _r/4.3f, 0, 0.1f, -4.0f, 0, -2.2f, (1/10.0f), 0, 0, 0);
// Iapetus
memcpy(nmv, cpy, sizeof nmv);
draw_object(nmv, projMat, _moon[11], _r/6.3f, 0, 0.1f, 7.0f, 0, -3.2f, (1/14.0f), 0, 0, 0);
draw_object(nmv, projMat, _moon[11], _r/6.3f, 0, 0.1f, 5.0f, 0, 0, (1/14.0f), 0, 0, 0);
// URANUS
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
draw_object(nmv, projMat, _planet[6], _a/(84 * 365.2425f), 0, 1, 65.0f, 1, 0, (1/26.8f)*12, _r/0.7083f, -0.978f, 0);
draw_object(nmv, projMat, _planet[6], _a/(84 * 365.2425f), 0, 1, 65.0f, 1, 0, (2/26.8f)*10, _r/0.7083f, -0.978f, 0);
memcpy(cpy, nmv, sizeof cpy);
@ -412,14 +412,14 @@ void draw(void) {
// NEPTUNE
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
draw_object(nmv, projMat, _planet[7], _a/(165 * 365.2425f), 0, 1, 75.0f, 1, 0, (1/27.7f)*12, _r/0.6f, -0.283f, 1.0f);
draw_object(nmv, projMat, _planet[7], _a/(165 * 365.2425f), 0, 1, 75.0f, 1, 0, (2/27.7f)*10, _r/0.6f, -0.283f, 1.0f);
// Triton
draw_object(nmv, projMat, _moon[16], _r/5.0f, 0, 0.01f, 3.0f, 0.0f, 0.0f, (1/10.0f), 0, 0, 0);
// PLUTO
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
draw_object(nmv, projMat, _planet[8], _a/(248 * 365.2425f), 0, 1, 85.0f, 1, 0, (1/500.7f)*12, _r/6.4f, -0.119f, 1.0f);
draw_object(nmv, projMat, _planet[8], _a/(248 * 365.2425f), 0, 1, 85.0f, 1, 0, (2/500.7f)*10, _r/6.4f, -0.119f, 1.0f);
// Charon
draw_object(nmv, projMat, _moon[17], _r/5.0f, 0, 0.01f, 3.0f, 0.0f, 0.0f, (1/13.0f), 0, 0, 0);