restore planets position after planet view
This commit is contained in:
parent
7093660729
commit
00150523c4
59
window.c
59
window.c
@ -76,6 +76,7 @@ static int _overview = 0; // boolean to toggle overview (view from the top).
|
|||||||
static int _p = -1; // the object (sun, planets, pluto) number to move.
|
static int _p = -1; // the object (sun, planets, pluto) number to move.
|
||||||
static float _s = 1.0f; // multiplier for angle (for speeding planets movement and rotation).
|
static float _s = 1.0f; // multiplier for angle (for speeding planets movement and rotation).
|
||||||
static float _a = 0.0f; // rotation angle.
|
static float _a = 0.0f; // rotation angle.
|
||||||
|
static float _r = 0.0f;
|
||||||
|
|
||||||
static Mix_Chunk * bsound = NULL; // background sound.
|
static Mix_Chunk * bsound = NULL; // background sound.
|
||||||
|
|
||||||
@ -286,7 +287,6 @@ static void goto_obj(float * mvMat) {
|
|||||||
|
|
||||||
/*!\brief la fonction appelée à chaque display. */
|
/*!\brief la fonction appelée à chaque display. */
|
||||||
void draw(void) {
|
void draw(void) {
|
||||||
static float r = 0.0f;
|
|
||||||
static double t0 = 0, t, dt;
|
static double t0 = 0, t, dt;
|
||||||
t = gl4dGetElapsedTime();
|
t = gl4dGetElapsedTime();
|
||||||
dt = (t - t0) / 1000.0;
|
dt = (t - t0) / 1000.0;
|
||||||
@ -311,7 +311,7 @@ void draw(void) {
|
|||||||
|
|
||||||
// SUN
|
// SUN
|
||||||
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
||||||
rotate(nmv, (r / 24.5f), 0.0f, 1.0f, 0.0f);
|
rotate(nmv, (_r / 24.5f), 0.0f, 1.0f, 0.0f);
|
||||||
translate(nmv, 0.0f, 1.0f, 0.0f);
|
translate(nmv, 0.0f, 1.0f, 0.0f);
|
||||||
scale(nmv, 2,2,2);
|
scale(nmv, 2,2,2);
|
||||||
transform_n_raster(_sun, nmv, projMat);
|
transform_n_raster(_sun, nmv, projMat);
|
||||||
@ -321,7 +321,7 @@ void draw(void) {
|
|||||||
rotate(nmv, (_a / 87.97f), 0.0f, 1.0f, 0.0f); // orbit mouvement
|
rotate(nmv, (_a / 87.97f), 0.0f, 1.0f, 0.0f); // orbit mouvement
|
||||||
translate(nmv, 4.2f, 1.0f, 0.0f);
|
translate(nmv, 4.2f, 1.0f, 0.0f);
|
||||||
scale(nmv, (1/227.0f) * 12.0f, (1/227.0f) * 12.0f, (1/227.0f) * 12.0f);
|
scale(nmv, (1/227.0f) * 12.0f, (1/227.0f) * 12.0f, (1/227.0f) * 12.0f);
|
||||||
rotate(nmv, (r / 59.0f), 0.0f, 1.0f, 0.0f); // rotation
|
rotate(nmv, (_r / 59.0f), 0.0f, 1.0f, 0.0f); // rotation
|
||||||
transform_n_raster(_planet[0], nmv, projMat);
|
transform_n_raster(_planet[0], nmv, projMat);
|
||||||
|
|
||||||
// VENUS
|
// VENUS
|
||||||
@ -329,7 +329,7 @@ void draw(void) {
|
|||||||
rotate(nmv, (_a / 224.7f), 0.0f, 1.0f, 0.0f); // orbit mouvement
|
rotate(nmv, (_a / 224.7f), 0.0f, 1.0f, 0.0f); // orbit mouvement
|
||||||
translate(nmv, 7.9f, 1.0f, 0.0f);
|
translate(nmv, 7.9f, 1.0f, 0.0f);
|
||||||
scale(nmv, (1/113.0f) * 12.0f, (1/113.0f) * 12.0f, (1/113.0f) * 12.0f);
|
scale(nmv, (1/113.0f) * 12.0f, (1/113.0f) * 12.0f, (1/113.0f) * 12.0f);
|
||||||
rotate(nmv, (r / 243.75f), -0.1773f, -1.0f, 0.0f); // rotation anti-clockwise
|
rotate(nmv, (_r / 243.75f), -0.1773f, -1.0f, 0.0f); // rotation anti-clockwise
|
||||||
transform_n_raster(_planet[1], nmv, projMat);
|
transform_n_raster(_planet[1], nmv, projMat);
|
||||||
|
|
||||||
// EARTH
|
// EARTH
|
||||||
@ -337,7 +337,7 @@ void draw(void) {
|
|||||||
rotate(nmv, (_a / 365.2425f), 0.0f, 1.0f, 0.0f);
|
rotate(nmv, (_a / 365.2425f), 0.0f, 1.0f, 0.0f);
|
||||||
translate(nmv, 10.0f, 1.0f, 0.0f);
|
translate(nmv, 10.0f, 1.0f, 0.0f);
|
||||||
scale(nmv, (1/108.0f) * 12.0f, (1/108.0f) * 12.0f, (1/108.0f) * 12.0f);
|
scale(nmv, (1/108.0f) * 12.0f, (1/108.0f) * 12.0f, (1/108.0f) * 12.0f);
|
||||||
rotate(nmv, r, -0.234f, 1.0f, 0.0f);
|
rotate(nmv, _r, -0.234f, 1.0f, 0.0f);
|
||||||
transform_n_raster(_planet[2], nmv, projMat);
|
transform_n_raster(_planet[2], nmv, projMat);
|
||||||
|
|
||||||
// Moon
|
// Moon
|
||||||
@ -350,19 +350,19 @@ void draw(void) {
|
|||||||
rotate(nmv, (_a / 686.98f), 0.0f, 1.0f, 0.0f);
|
rotate(nmv, (_a / 686.98f), 0.0f, 1.0f, 0.0f);
|
||||||
translate(nmv, 15.2f, 1.0f, 0.0f);
|
translate(nmv, 15.2f, 1.0f, 0.0f);
|
||||||
scale(nmv, (1/208.0f) * 12.0f, (1/208.0f) * 12.0f, (1/208.0f) * 12.0f);
|
scale(nmv, (1/208.0f) * 12.0f, (1/208.0f) * 12.0f, (1/208.0f) * 12.0f);
|
||||||
rotate(nmv, r / 1.0416f, -0.252f, 1.0f, 0.0f);
|
rotate(nmv, _r / 1.0416f, -0.252f, 1.0f, 0.0f);
|
||||||
transform_n_raster(_planet[3], nmv, projMat);
|
transform_n_raster(_planet[3], nmv, projMat);
|
||||||
|
|
||||||
memcpy(cpy, nmv, sizeof cpy);
|
memcpy(cpy, nmv, sizeof cpy);
|
||||||
|
|
||||||
// Phobos
|
// Phobos
|
||||||
rotate(nmv, r * 4.3f, 0.0f, 0.1f, 0.0f);
|
rotate(nmv, _r * 4.3f, 0.0f, 0.1f, 0.0f);
|
||||||
translate(nmv, 10.0f, 1.0f, 0.0f);
|
translate(nmv, 10.0f, 1.0f, 0.0f);
|
||||||
scale(nmv, (1/5.0f), (1/5.0f), (1/5.0f));
|
scale(nmv, (1/5.0f), (1/5.0f), (1/5.0f));
|
||||||
transform_n_raster(_moon[1], nmv, projMat);
|
transform_n_raster(_moon[1], nmv, projMat);
|
||||||
|
|
||||||
// Deimos
|
// Deimos
|
||||||
rotate(cpy, r / 1.5f, 0.0f, 0.1f, 0.0f);
|
rotate(cpy, _r / 1.5f, 0.0f, 0.1f, 0.0f);
|
||||||
translate(cpy, 25.0f, 1.0f, 0.0f);
|
translate(cpy, 25.0f, 1.0f, 0.0f);
|
||||||
scale(cpy, (1/6.0f), (1/6.0f), (1/6.0f));
|
scale(cpy, (1/6.0f), (1/6.0f), (1/6.0f));
|
||||||
transform_n_raster(_moon[2], cpy, projMat);
|
transform_n_raster(_moon[2], cpy, projMat);
|
||||||
@ -372,13 +372,13 @@ void draw(void) {
|
|||||||
rotate(nmv, _a / (12 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
rotate(nmv, _a / (12 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
||||||
translate(nmv, 30.0f, 1.0f, 0.0f);
|
translate(nmv, 30.0f, 1.0f, 0.0f);
|
||||||
scale(nmv, (1/9.7f) * 12.0f, (1/9.7f) * 12.0f, (1/9.7f) * 12.0f);
|
scale(nmv, (1/9.7f) * 12.0f, (1/9.7f) * 12.0f, (1/9.7f) * 12.0f);
|
||||||
rotate(nmv, r / 0.416f, -0.031f, 1.0f, 0.0f);
|
rotate(nmv, _r / 0.416f, -0.031f, 1.0f, 0.0f);
|
||||||
transform_n_raster(_planet[4], nmv, projMat);
|
transform_n_raster(_planet[4], nmv, projMat);
|
||||||
|
|
||||||
memcpy(cpy, nmv, sizeof cpy);
|
memcpy(cpy, nmv, sizeof cpy);
|
||||||
|
|
||||||
// Io
|
// Io
|
||||||
rotate(nmv, r * 3.0f, 0.0f, 0.1f, 0.0f);
|
rotate(nmv, _r * 3.0f, 0.0f, 0.1f, 0.0f);
|
||||||
translate(nmv, 3.0f, 0.0f, 0.0f);
|
translate(nmv, 3.0f, 0.0f, 0.0f);
|
||||||
scale(nmv, (1/11.2f), (1/11.2f), (1/11.2f));
|
scale(nmv, (1/11.2f), (1/11.2f), (1/11.2f));
|
||||||
transform_n_raster(_moon[3], nmv, projMat);
|
transform_n_raster(_moon[3], nmv, projMat);
|
||||||
@ -386,7 +386,7 @@ void draw(void) {
|
|||||||
memcpy(nmv, cpy, sizeof nmv);
|
memcpy(nmv, cpy, sizeof nmv);
|
||||||
|
|
||||||
// Europa
|
// Europa
|
||||||
rotate(nmv, r / 2.0f, 0.0f, 0.1f, 0.0f);
|
rotate(nmv, _r / 2.0f, 0.0f, 0.1f, 0.0f);
|
||||||
translate(nmv, 4.0f, 0.0f, 0.0f);
|
translate(nmv, 4.0f, 0.0f, 0.0f);
|
||||||
scale(nmv, (1/13.2f), (1/13.2f), (1/13.2f));
|
scale(nmv, (1/13.2f), (1/13.2f), (1/13.2f));
|
||||||
transform_n_raster(_moon[4], nmv, projMat);
|
transform_n_raster(_moon[4], nmv, projMat);
|
||||||
@ -394,7 +394,7 @@ void draw(void) {
|
|||||||
memcpy(nmv, cpy, sizeof nmv);
|
memcpy(nmv, cpy, sizeof nmv);
|
||||||
|
|
||||||
// Ganymede
|
// Ganymede
|
||||||
rotate(nmv, r / 3.0f, 0.0f, 0.1f, 0.0f);
|
rotate(nmv, _r / 3.0f, 0.0f, 0.1f, 0.0f);
|
||||||
translate(nmv, 5.0f, 0.0f, 0.0f);
|
translate(nmv, 5.0f, 0.0f, 0.0f);
|
||||||
scale(nmv, (1/9.0f), (1/9.0f), (1/9.0f));
|
scale(nmv, (1/9.0f), (1/9.0f), (1/9.0f));
|
||||||
transform_n_raster(_moon[5], nmv, projMat);
|
transform_n_raster(_moon[5], nmv, projMat);
|
||||||
@ -402,7 +402,7 @@ void draw(void) {
|
|||||||
memcpy(nmv, cpy, sizeof nmv);
|
memcpy(nmv, cpy, sizeof nmv);
|
||||||
|
|
||||||
// Callisto
|
// Callisto
|
||||||
rotate(nmv, r / 5.0f, 0.0f, 0.1f, 0.0f);
|
rotate(nmv, _r / 5.0f, 0.0f, 0.1f, 0.0f);
|
||||||
translate(nmv, 6.0f, 0.0f, 0.0f);
|
translate(nmv, 6.0f, 0.0f, 0.0f);
|
||||||
scale(nmv, (1/10.0f), (1/10.0f), (1/10.0f));
|
scale(nmv, (1/10.0f), (1/10.0f), (1/10.0f));
|
||||||
transform_n_raster(_moon[6], nmv, projMat);
|
transform_n_raster(_moon[6], nmv, projMat);
|
||||||
@ -412,13 +412,13 @@ void draw(void) {
|
|||||||
rotate(nmv, _a / (30 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
rotate(nmv, _a / (30 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
||||||
translate(nmv, 50.4f, 1.0f, 0.0f);
|
translate(nmv, 50.4f, 1.0f, 0.0f);
|
||||||
scale(nmv, (1/11.4f) * 12.0f, (1/11.4f) * 12.0f, (1/11.4f) * 12.0f);
|
scale(nmv, (1/11.4f) * 12.0f, (1/11.4f) * 12.0f, (1/11.4f) * 12.0f);
|
||||||
rotate(nmv, r / 0.4583f, -0.267f, 1.0f, 0.0f);
|
rotate(nmv, _r / 0.4583f, -0.267f, 1.0f, 0.0f);
|
||||||
transform_n_raster(_planet[5], nmv, projMat);
|
transform_n_raster(_planet[5], nmv, projMat);
|
||||||
|
|
||||||
memcpy(cpy, nmv, sizeof cpy);
|
memcpy(cpy, nmv, sizeof cpy);
|
||||||
|
|
||||||
// Enceladus
|
// Enceladus
|
||||||
rotate(nmv, r * 5.0f, 0.0f, 0.1f, 0.0f);
|
rotate(nmv, _r * 5.0f, 0.0f, 0.1f, 0.0f);
|
||||||
translate(nmv, 2.0f, 0.0f, 0.0f);
|
translate(nmv, 2.0f, 0.0f, 0.0f);
|
||||||
scale(nmv, (1/20.0f), (1/20.0f), (1/20.0f));
|
scale(nmv, (1/20.0f), (1/20.0f), (1/20.0f));
|
||||||
transform_n_raster(_moon[7], nmv, projMat);
|
transform_n_raster(_moon[7], nmv, projMat);
|
||||||
@ -426,7 +426,7 @@ void draw(void) {
|
|||||||
memcpy(nmv, cpy, sizeof nmv);
|
memcpy(nmv, cpy, sizeof nmv);
|
||||||
|
|
||||||
// Dione
|
// Dione
|
||||||
rotate(nmv, r * 4.0f, 0.0f, 0.01f, 0.0f);
|
rotate(nmv, _r * 4.0f, 0.0f, 0.01f, 0.0f);
|
||||||
translate(nmv, 3.0f, 0.0f, 0.0f);
|
translate(nmv, 3.0f, 0.0f, 0.0f);
|
||||||
scale(nmv, (1/18.0f), (1/18.0f), (1/18.0f));
|
scale(nmv, (1/18.0f), (1/18.0f), (1/18.0f));
|
||||||
transform_n_raster(_moon[8], nmv, projMat);
|
transform_n_raster(_moon[8], nmv, projMat);
|
||||||
@ -434,7 +434,7 @@ void draw(void) {
|
|||||||
memcpy(nmv, cpy, sizeof nmv);
|
memcpy(nmv, cpy, sizeof nmv);
|
||||||
|
|
||||||
// Rhea
|
// Rhea
|
||||||
rotate(nmv, r * 3.0f, 0.0f, 0.01f, 0.0f);
|
rotate(nmv, _r * 3.0f, 0.0f, 0.01f, 0.0f);
|
||||||
translate(nmv, 4.0f, 0.0f, 0.0f);
|
translate(nmv, 4.0f, 0.0f, 0.0f);
|
||||||
scale(nmv, (1/15.0f), (1/15.0f), (1/15.0f));
|
scale(nmv, (1/15.0f), (1/15.0f), (1/15.0f));
|
||||||
transform_n_raster(_moon[9], nmv, projMat);
|
transform_n_raster(_moon[9], nmv, projMat);
|
||||||
@ -442,7 +442,7 @@ void draw(void) {
|
|||||||
memcpy(nmv, cpy, sizeof nmv);
|
memcpy(nmv, cpy, sizeof nmv);
|
||||||
|
|
||||||
// Titan
|
// Titan
|
||||||
rotate(nmv, r / 4.0f, 0.0f, 0.01f, 0.0f);
|
rotate(nmv, _r / 4.0f, 0.0f, 0.01f, 0.0f);
|
||||||
translate(nmv, 6.0f, 0.0f, 0.0f);
|
translate(nmv, 6.0f, 0.0f, 0.0f);
|
||||||
scale(nmv, (1/10.0f), (1/10.0f), (1/10.0f));
|
scale(nmv, (1/10.0f), (1/10.0f), (1/10.0f));
|
||||||
transform_n_raster(_moon[10], nmv, projMat);
|
transform_n_raster(_moon[10], nmv, projMat);
|
||||||
@ -450,7 +450,7 @@ void draw(void) {
|
|||||||
memcpy(nmv, cpy, sizeof nmv);
|
memcpy(nmv, cpy, sizeof nmv);
|
||||||
|
|
||||||
// Iapetus
|
// Iapetus
|
||||||
rotate(nmv, r / 6.0f, 0.0f, 0.01f, 0.0f);
|
rotate(nmv, _r / 6.0f, 0.0f, 0.01f, 0.0f);
|
||||||
translate(nmv, 7.0f, 0.0f, 0.0f);
|
translate(nmv, 7.0f, 0.0f, 0.0f);
|
||||||
scale(nmv, (1/14.0f), (1/14.0f), (1/14.0f));
|
scale(nmv, (1/14.0f), (1/14.0f), (1/14.0f));
|
||||||
transform_n_raster(_moon[11], nmv, projMat);
|
transform_n_raster(_moon[11], nmv, projMat);
|
||||||
@ -460,13 +460,13 @@ void draw(void) {
|
|||||||
rotate(nmv, _a / (84 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
rotate(nmv, _a / (84 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
||||||
translate(nmv, 65.0f, 1.0f, 0.0f);
|
translate(nmv, 65.0f, 1.0f, 0.0f);
|
||||||
scale(nmv, (1/26.8f) * 12.0f, (1/26.8f) * 12.0f, (1/26.8f) * 12.0f);
|
scale(nmv, (1/26.8f) * 12.0f, (1/26.8f) * 12.0f, (1/26.8f) * 12.0f);
|
||||||
rotate(nmv, r / 0.7083f, -0.978f, 0.0f, 0.0f);
|
rotate(nmv, _r / 0.7083f, -0.978f, 0.0f, 0.0f);
|
||||||
transform_n_raster(_planet[6], nmv, projMat);
|
transform_n_raster(_planet[6], nmv, projMat);
|
||||||
|
|
||||||
memcpy(cpy, nmv, sizeof cpy);
|
memcpy(cpy, nmv, sizeof cpy);
|
||||||
|
|
||||||
// Ariel
|
// Ariel
|
||||||
rotate(nmv, r , 0.01f, 0.0f, 0.0f);
|
rotate(nmv, _r , 0.01f, 0.0f, 0.0f);
|
||||||
translate(nmv, 0.0f, 3.0f, 0.0f);
|
translate(nmv, 0.0f, 3.0f, 0.0f);
|
||||||
scale(nmv, (1/20.0f), (1/20.0f), (1/20.0f));
|
scale(nmv, (1/20.0f), (1/20.0f), (1/20.0f));
|
||||||
transform_n_raster(_moon[12], nmv, projMat);
|
transform_n_raster(_moon[12], nmv, projMat);
|
||||||
@ -474,7 +474,7 @@ void draw(void) {
|
|||||||
memcpy (nmv, cpy, sizeof nmv);
|
memcpy (nmv, cpy, sizeof nmv);
|
||||||
|
|
||||||
// Umbriel
|
// Umbriel
|
||||||
rotate(nmv, r / 2.0f, 0.01f, 0.0f, 0.0f);
|
rotate(nmv, _r / 2.0f, 0.01f, 0.0f, 0.0f);
|
||||||
translate(nmv, 0.0f, 4.0f, 0.0f);
|
translate(nmv, 0.0f, 4.0f, 0.0f);
|
||||||
scale(nmv, (1/20.0f), (1/20.0f), (1/20.0f));
|
scale(nmv, (1/20.0f), (1/20.0f), (1/20.0f));
|
||||||
transform_n_raster(_moon[13], nmv, projMat);
|
transform_n_raster(_moon[13], nmv, projMat);
|
||||||
@ -482,7 +482,7 @@ void draw(void) {
|
|||||||
memcpy (nmv, cpy, sizeof nmv);
|
memcpy (nmv, cpy, sizeof nmv);
|
||||||
|
|
||||||
// Titania
|
// Titania
|
||||||
rotate(nmv, r / 3.0f, 0.01f, 0.0f, 0.0f);
|
rotate(nmv, _r / 3.0f, 0.01f, 0.0f, 0.0f);
|
||||||
translate(nmv, 0.0f, 5.0f, 0.0f);
|
translate(nmv, 0.0f, 5.0f, 0.0f);
|
||||||
scale(nmv, (1/17.0f), (1/17.0f), (1/17.0f));
|
scale(nmv, (1/17.0f), (1/17.0f), (1/17.0f));
|
||||||
transform_n_raster(_moon[14], nmv, projMat);
|
transform_n_raster(_moon[14], nmv, projMat);
|
||||||
@ -490,7 +490,7 @@ void draw(void) {
|
|||||||
memcpy (nmv, cpy, sizeof nmv);
|
memcpy (nmv, cpy, sizeof nmv);
|
||||||
|
|
||||||
// Oberon
|
// Oberon
|
||||||
rotate(nmv, r / 5.0f, 0.01f, 0.0f, 0.0f);
|
rotate(nmv, _r / 5.0f, 0.01f, 0.0f, 0.0f);
|
||||||
translate(nmv, 0.0f, 6.0f, 0.0f);
|
translate(nmv, 0.0f, 6.0f, 0.0f);
|
||||||
scale(nmv, (1/17.0f), (1/17.0f), (1/17.0f));
|
scale(nmv, (1/17.0f), (1/17.0f), (1/17.0f));
|
||||||
transform_n_raster(_moon[15], nmv, projMat);
|
transform_n_raster(_moon[15], nmv, projMat);
|
||||||
@ -500,11 +500,11 @@ void draw(void) {
|
|||||||
rotate(nmv, _a / (165 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
rotate(nmv, _a / (165 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
||||||
translate(nmv, 75.0f, 1.0f, 0.0f);
|
translate(nmv, 75.0f, 1.0f, 0.0f);
|
||||||
scale(nmv, (1/27.7f) * 12.0f, (1/27.7f) * 12.0f, (1/27.7f) * 12.0f);
|
scale(nmv, (1/27.7f) * 12.0f, (1/27.7f) * 12.0f, (1/27.7f) * 12.0f);
|
||||||
rotate(nmv, r / 0.6f, -0.283f, 1.0f, 0.0f);
|
rotate(nmv, _r / 0.6f, -0.283f, 1.0f, 0.0f);
|
||||||
transform_n_raster(_planet[7], nmv, projMat);
|
transform_n_raster(_planet[7], nmv, projMat);
|
||||||
|
|
||||||
// Triton
|
// Triton
|
||||||
rotate(nmv, r / 5.0f, 0.0f, 0.01f, 0.0f);
|
rotate(nmv, _r / 5.0f, 0.0f, 0.01f, 0.0f);
|
||||||
translate(nmv, 3.0f, 0.0f, 0.0f);
|
translate(nmv, 3.0f, 0.0f, 0.0f);
|
||||||
scale(nmv, (1/10.0f), (1/10.0f), (1/10.0f));
|
scale(nmv, (1/10.0f), (1/10.0f), (1/10.0f));
|
||||||
transform_n_raster(_moon[16], nmv, projMat);
|
transform_n_raster(_moon[16], nmv, projMat);
|
||||||
@ -514,11 +514,11 @@ void draw(void) {
|
|||||||
rotate(nmv, _a / (248 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
rotate(nmv, _a / (248 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
||||||
translate(nmv, 85.4f, 1.0f, 0.0f);
|
translate(nmv, 85.4f, 1.0f, 0.0f);
|
||||||
scale(nmv, (1/500.0f) * 12.0f, (1/500.0f) * 12.0f, (1/500.0f) * 12.0f);
|
scale(nmv, (1/500.0f) * 12.0f, (1/500.0f) * 12.0f, (1/500.0f) * 12.0f);
|
||||||
rotate(nmv, r / 6.4, -0.119f, 1.0f, 0.0f);
|
rotate(nmv, _r / 6.4, -0.119f, 1.0f, 0.0f);
|
||||||
transform_n_raster(_planet[8], nmv, projMat);
|
transform_n_raster(_planet[8], nmv, projMat);
|
||||||
|
|
||||||
// Charon
|
// Charon
|
||||||
rotate(nmv, r / 5.0f, 0.0f, 0.01f, 0.0f);
|
rotate(nmv, _r / 5.0f, 0.0f, 0.01f, 0.0f);
|
||||||
translate(nmv, 3.0f, 0.0f, 0.0f);
|
translate(nmv, 3.0f, 0.0f, 0.0f);
|
||||||
scale(nmv, (1/13.0f), (1/13.0f), (1/13.0f));
|
scale(nmv, (1/13.0f), (1/13.0f), (1/13.0f));
|
||||||
transform_n_raster(_moon[16], nmv, projMat);
|
transform_n_raster(_moon[16], nmv, projMat);
|
||||||
@ -530,7 +530,7 @@ void draw(void) {
|
|||||||
|
|
||||||
if (!_pause){
|
if (!_pause){
|
||||||
_a += ((360.0 * dt) / 60) * _s; // 360 in 1 minute so 1 day = 1 min
|
_a += ((360.0 * dt) / 60) * _s; // 360 in 1 minute so 1 day = 1 min
|
||||||
r += ((360.0 * dt) / 60) * _s; // 360 in 1 minute so 1 day = 1 min
|
_r += ((360.0 * dt) / 60) * _s; // 360 in 1 minute so 1 day = 1 min
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -611,6 +611,7 @@ void key(int keycode) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GL4DK_r:
|
case GL4DK_r:
|
||||||
|
_a = _r;
|
||||||
_p = -1;
|
_p = -1;
|
||||||
_pause = 0;
|
_pause = 0;
|
||||||
_movement = 1;
|
_movement = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user