simplified repeating code
This commit is contained in:
parent
c357e513b5
commit
57726d85d1
190
window.c
190
window.c
@ -137,7 +137,7 @@ void init(void) {
|
|||||||
bsound = Mix_LoadWAV("./space.wav");
|
bsound = Mix_LoadWAV("./space.wav");
|
||||||
if (Mix_PlayChannel(-1, bsound, 0) < 0)
|
if (Mix_PlayChannel(-1, bsound, 0) < 0)
|
||||||
fprintf(stderr, "Mix_PlayChannel: %s\n", Mix_GetError());
|
fprintf(stderr, "Mix_PlayChannel: %s\n", Mix_GetError());
|
||||||
|
|
||||||
// create all spheres.
|
// create all spheres.
|
||||||
_sun = mkSphere(12, 12); /*ça fait 12x12x2 triangles !*/
|
_sun = mkSphere(12, 12); /*ça fait 12x12x2 triangles !*/
|
||||||
for(i = 0; i < 18; ++i) {
|
for(i = 0; i < 18; ++i) {
|
||||||
@ -180,7 +180,7 @@ void init(void) {
|
|||||||
|
|
||||||
// set texture to an object id and set all options.
|
// set texture to an object id and set all options.
|
||||||
setTexId(_sun, sun_id);
|
setTexId(_sun, sun_id);
|
||||||
if(_use_tex)
|
if(_use_tex)
|
||||||
enableSurfaceOption(_sun, SO_USE_TEXTURE);
|
enableSurfaceOption(_sun, SO_USE_TEXTURE);
|
||||||
if(_use_lighting)
|
if(_use_lighting)
|
||||||
enableSurfaceOption(_sun, SO_USE_LIGHTING);
|
enableSurfaceOption(_sun, SO_USE_LIGHTING);
|
||||||
@ -188,16 +188,16 @@ void init(void) {
|
|||||||
for(i = 0; i < 18; ++i) {
|
for(i = 0; i < 18; ++i) {
|
||||||
setTexId(_moon[i], moon_id[i]);
|
setTexId(_moon[i], moon_id[i]);
|
||||||
disableSurfaceOption(_moon[i], SO_USE_COLOR);
|
disableSurfaceOption(_moon[i], SO_USE_COLOR);
|
||||||
if(_use_tex)
|
if(_use_tex)
|
||||||
enableSurfaceOption(_moon[i], SO_USE_TEXTURE);
|
enableSurfaceOption(_moon[i], SO_USE_TEXTURE);
|
||||||
if(_use_lighting)
|
if(_use_lighting)
|
||||||
enableSurfaceOption(_moon[i], SO_USE_LIGHTING);
|
enableSurfaceOption(_moon[i], SO_USE_LIGHTING);
|
||||||
if (i < 9) {
|
if (i < 9) {
|
||||||
setTexId(_planet[i], id[i]);
|
setTexId(_planet[i], id[i]);
|
||||||
disableSurfaceOption(_planet[i], SO_USE_COLOR);
|
disableSurfaceOption(_planet[i], SO_USE_COLOR);
|
||||||
if(_use_tex)
|
if(_use_tex)
|
||||||
enableSurfaceOption(_planet[i], SO_USE_TEXTURE);
|
enableSurfaceOption(_planet[i], SO_USE_TEXTURE);
|
||||||
if(_use_lighting)
|
if(_use_lighting)
|
||||||
enableSurfaceOption(_planet[i], SO_USE_LIGHTING);
|
enableSurfaceOption(_planet[i], SO_USE_LIGHTING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -281,6 +281,17 @@ static void goto_obj(float * mvMat) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void draw_object(float * nmv, float * projMat, surface_t * obj,
|
||||||
|
float ma, float mx, float my, float mz,
|
||||||
|
float tx, float ty, float tz, float s,
|
||||||
|
float ra, float rx, float ry, float rz) {
|
||||||
|
rotate(nmv, ma, mx, my, mz); // orbit movement
|
||||||
|
translate(nmv, tx, ty, tz);
|
||||||
|
scale(nmv, s, s, s);
|
||||||
|
rotate(nmv, ra, rx, ry, rz); // rotation
|
||||||
|
transform_n_raster(obj, nmv, projMat);
|
||||||
|
}
|
||||||
|
|
||||||
/*!\brief la fonction appelée à chaque display. */
|
/*!\brief la fonction appelée à chaque display. */
|
||||||
void draw(void) {
|
void draw(void) {
|
||||||
static double t0 = 0, t, dt;
|
static double t0 = 0, t, dt;
|
||||||
@ -307,217 +318,114 @@ 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);
|
draw_object(nmv, projMat, _sun, _r/24.5f, 0, 1, 0, 0, 1, 0, 2, 0, 0, 0, 0);
|
||||||
translate(nmv, 0.0f, 1.0f, 0.0f);
|
|
||||||
scale(nmv, 2,2,2);
|
|
||||||
transform_n_raster(_sun, nmv, projMat);
|
|
||||||
|
|
||||||
// MERCURY
|
// MERCURY
|
||||||
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
||||||
rotate(nmv, (_a / 87.97f), 0.0f, 1.0f, 0.0f); // orbit mouvement
|
draw_object(nmv, projMat, _planet[0], _a/87.97f, 0, 1, 0, 4.2f, 1, 0, (1/227.0f)*12, _r/59.0f, 0, 1, 0);
|
||||||
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);
|
|
||||||
rotate(nmv, (_r / 59.0f), 0.0f, 1.0f, 0.0f); // rotation
|
|
||||||
transform_n_raster(_planet[0], nmv, projMat);
|
|
||||||
|
|
||||||
// VENUS
|
// VENUS
|
||||||
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
||||||
rotate(nmv, (_a / 224.7f), 0.0f, 1.0f, 0.0f); // orbit mouvement
|
draw_object(nmv, projMat, _planet[1], _a/224.7f, 0, 1, 0, 7.9f, 1, 0, (1/113.0f)*12, _r/243.75f, -0.1773f, -1, 0);
|
||||||
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);
|
|
||||||
rotate(nmv, (_r / 243.75f), -0.1773f, -1.0f, 0.0f); // rotation anti-clockwise
|
|
||||||
transform_n_raster(_planet[1], nmv, projMat);
|
|
||||||
|
|
||||||
// EARTH
|
// EARTH
|
||||||
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
||||||
rotate(nmv, (_a / 365.2425f), 0.0f, 1.0f, 0.0f);
|
draw_object(nmv, projMat, _planet[2], _a/365.2425f, 0, 1, 0, 10.0f, 1, 0, (1/108.0f)*12, _r, -0.234f, 1, 0);
|
||||||
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);
|
|
||||||
rotate(nmv, _r, -0.234f, 1.0f, 0.0f);
|
|
||||||
transform_n_raster(_planet[2], nmv, projMat);
|
|
||||||
|
|
||||||
// Moon
|
// Moon
|
||||||
translate(nmv, 4.0f, 0.0f, 0.0f);
|
draw_object(nmv, projMat, _moon[0], 1, 0, 0, 0, 4.0f, 0, 0, (1/5.0f), 1, 0, 0, 0);
|
||||||
scale(nmv, (1/5.0f) , (1/5.0f), (1/5.0f));
|
|
||||||
transform_n_raster(_moon[0], nmv, projMat);
|
|
||||||
|
|
||||||
// MARS
|
// MARS
|
||||||
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
||||||
rotate(nmv, (_a / 686.98f), 0.0f, 1.0f, 0.0f);
|
draw_object(nmv, projMat, _planet[3], _a/686.98f, 0, 1, 0, 15.2f, 1, 0, (1/208.0f)*12, _r/1.0416f, -0.252f, 1, 0);
|
||||||
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);
|
|
||||||
rotate(nmv, _r / 1.0416f, -0.252f, 1.0f, 0.0f);
|
|
||||||
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);
|
draw_object(nmv, projMat, _moon[1], _r*4.3f, 0, 0.1f, 0, 10.0f, 0, 0, (1/5.0f), 0, 0, 0, 0);
|
||||||
translate(nmv, 10.0f, 1.0f, 0.0f);
|
|
||||||
scale(nmv, (1/5.0f), (1/5.0f), (1/5.0f));
|
|
||||||
transform_n_raster(_moon[1], nmv, projMat);
|
|
||||||
|
|
||||||
// Deimos
|
// Deimos
|
||||||
rotate(cpy, _r / 1.5f, 0.0f, 0.1f, 0.0f);
|
draw_object(cpy, projMat, _moon[2], _r/1.5f, 0, 0.1f, 0, 25.0f, 0, 0, (1/6.0f), 0, 0, 0, 0);
|
||||||
translate(cpy, 25.0f, 1.0f, 0.0f);
|
|
||||||
scale(cpy, (1/6.0f), (1/6.0f), (1/6.0f));
|
|
||||||
transform_n_raster(_moon[2], cpy, projMat);
|
|
||||||
|
|
||||||
// JUPITER
|
// JUPITER
|
||||||
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
||||||
rotate(nmv, _a / (12 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
draw_object(nmv, projMat, _planet[4], _a/(12 * 365.2425f), 0, 1, 0, 30.0f, 1, 0, (1/9.7f)*12, _r/0.416f, -0.031f, 1, 0);
|
||||||
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);
|
|
||||||
rotate(nmv, _r / 0.416f, -0.031f, 1.0f, 0.0f);
|
|
||||||
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);
|
draw_object(nmv, projMat, _moon[3], _r*3.0f, 0, 0.1f, 0, 3.0f, 0, 2, (1/11.2f), 0, 0, 0, 0);
|
||||||
translate(nmv, 3.0f, 0.0f, 0.0f);
|
|
||||||
scale(nmv, (1/11.2f), (1/11.2f), (1/11.2f));
|
|
||||||
transform_n_raster(_moon[3], nmv, projMat);
|
|
||||||
|
|
||||||
memcpy(nmv, cpy, sizeof nmv);
|
|
||||||
|
|
||||||
// Europa
|
// Europa
|
||||||
rotate(nmv, _r / 2.0f, 0.0f, 0.1f, 0.0f);
|
|
||||||
translate(nmv, 4.0f, 0.0f, 0.0f);
|
|
||||||
scale(nmv, (1/13.2f), (1/13.2f), (1/13.2f));
|
|
||||||
transform_n_raster(_moon[4], nmv, projMat);
|
|
||||||
|
|
||||||
memcpy(nmv, cpy, sizeof nmv);
|
memcpy(nmv, cpy, sizeof nmv);
|
||||||
|
draw_object(nmv, projMat, _moon[4], _r/2.0f, 0, 0.1f, 0, -4.0f, 0, -1, (1/13.2f), 0, 0, 0, 0);
|
||||||
|
|
||||||
// Ganymede
|
// Ganymede
|
||||||
rotate(nmv, _r / 3.0f, 0.0f, 0.1f, 0.0f);
|
|
||||||
translate(nmv, 5.0f, 0.0f, 0.0f);
|
|
||||||
scale(nmv, (1/9.0f), (1/9.0f), (1/9.0f));
|
|
||||||
transform_n_raster(_moon[5], nmv, projMat);
|
|
||||||
|
|
||||||
memcpy(nmv, cpy, sizeof nmv);
|
memcpy(nmv, cpy, sizeof nmv);
|
||||||
|
draw_object(nmv, projMat, _moon[5], _r/3.0f, 0, 0.1f, 0, -5.0f, 0, -1.5f, (1/9.0f), 0, 0, 0, 0);
|
||||||
|
|
||||||
// Callisto
|
// Callisto
|
||||||
rotate(nmv, _r / 5.0f, 0.0f, 0.1f, 0.0f);
|
memcpy(nmv, cpy, sizeof nmv);
|
||||||
translate(nmv, 6.0f, 0.0f, 0.0f);
|
draw_object(nmv, projMat, _moon[6], _r/5.0f, 0, 0.1f, 0, 6.0f, 0, -2.5f, (1/10.0f), 0, 0, 0, 0);
|
||||||
scale(nmv, (1/10.0f), (1/10.0f), (1/10.0f));
|
|
||||||
transform_n_raster(_moon[6], nmv, projMat);
|
|
||||||
|
|
||||||
// SATURN
|
// SATURN
|
||||||
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
||||||
rotate(nmv, _a / (30 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
draw_object(nmv, projMat, _planet[5], _a/(30 * 365.2425f), 0, 1, 0, 50.4f, 1, 0, (1/11.4f)*12, _r/0.4583f, -0.267f, 1, 0);
|
||||||
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);
|
|
||||||
rotate(nmv, _r / 0.4583f, -0.267f, 1.0f, 0.0f);
|
|
||||||
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);
|
draw_object(nmv, projMat, _moon[7], _r*5.0f, 0, 0.1f, 0, 2.0f, 0, -2.0f, (1/20.0f), 0, 0, 0, 0);
|
||||||
translate(nmv, 2.0f, 0.0f, 0.0f);
|
|
||||||
scale(nmv, (1/20.0f), (1/20.0f), (1/20.0f));
|
|
||||||
transform_n_raster(_moon[7], nmv, projMat);
|
|
||||||
|
|
||||||
memcpy(nmv, cpy, sizeof nmv);
|
|
||||||
|
|
||||||
// Dione
|
// Dione
|
||||||
rotate(nmv, _r * 4.0f, 0.0f, 0.01f, 0.0f);
|
|
||||||
translate(nmv, 3.0f, 0.0f, 0.0f);
|
|
||||||
scale(nmv, (1/18.0f), (1/18.0f), (1/18.0f));
|
|
||||||
transform_n_raster(_moon[8], nmv, projMat);
|
|
||||||
|
|
||||||
memcpy(nmv, cpy, sizeof nmv);
|
memcpy(nmv, cpy, sizeof nmv);
|
||||||
|
draw_object(nmv, projMat, _moon[8], _r*4.1f, 0, 0.1f, 0, -3.0f, 0, -0.5f, (1/18.0f), 0, 0, 0, 0);
|
||||||
|
|
||||||
// Rhea
|
// Rhea
|
||||||
rotate(nmv, _r * 3.0f, 0.0f, 0.01f, 0.0f);
|
|
||||||
translate(nmv, 4.0f, 0.0f, 0.0f);
|
|
||||||
scale(nmv, (1/15.0f), (1/15.0f), (1/15.0f));
|
|
||||||
transform_n_raster(_moon[9], nmv, projMat);
|
|
||||||
|
|
||||||
memcpy(nmv, cpy, sizeof nmv);
|
memcpy(nmv, cpy, sizeof nmv);
|
||||||
|
draw_object(nmv, projMat, _moon[9], _r*3.2f, 0, 0.1f, 0, 4.0f, 0, -2.5f, (1/15.0f), 0, 0, 0, 0);
|
||||||
|
|
||||||
// Titan
|
// Titan
|
||||||
rotate(nmv, _r / 4.0f, 0.0f, 0.01f, 0.0f);
|
|
||||||
translate(nmv, 6.0f, 0.0f, 0.0f);
|
|
||||||
scale(nmv, (1/10.0f), (1/10.0f), (1/10.0f));
|
|
||||||
transform_n_raster(_moon[10], nmv, projMat);
|
|
||||||
|
|
||||||
memcpy(nmv, cpy, sizeof nmv);
|
memcpy(nmv, cpy, sizeof nmv);
|
||||||
|
draw_object(nmv, projMat, _moon[10], _r/4.3f, 0, 0.1f, 0, -6.0f, 0, -5.2f, (1/10.0f), 0, 0, 0, 0);
|
||||||
|
|
||||||
// Iapetus
|
// Iapetus
|
||||||
rotate(nmv, _r / 6.0f, 0.0f, 0.01f, 0.0f);
|
memcpy(nmv, cpy, sizeof nmv);
|
||||||
translate(nmv, 7.0f, 0.0f, 0.0f);
|
draw_object(nmv, projMat, _moon[11], _r/6.3f, 0, 0.1f, 0, 7.0f, 0, -3.2f, (1/14.0f), 0, 0, 0, 0);
|
||||||
scale(nmv, (1/14.0f), (1/14.0f), (1/14.0f));
|
|
||||||
transform_n_raster(_moon[11], nmv, projMat);
|
|
||||||
|
|
||||||
// URANUS
|
// URANUS
|
||||||
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
||||||
rotate(nmv, _a / (84 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
draw_object(nmv, projMat, _planet[6], _a/(84 * 365.2425f), 0, 1, 0, 65.0f, 1, 0, (1/26.8f)*12, _r/0.7083f, -0.978f, 0, 0);
|
||||||
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);
|
|
||||||
rotate(nmv, _r / 0.7083f, -0.978f, 0.0f, 0.0f);
|
|
||||||
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);
|
draw_object(nmv, projMat, _moon[12], _r, 0.01f, 0, 0, 0, 3.0f, -2.2f, (1/20.0f), 0, 0, 0, 0);
|
||||||
translate(nmv, 0.0f, 3.0f, 0.0f);
|
|
||||||
scale(nmv, (1/20.0f), (1/20.0f), (1/20.0f));
|
|
||||||
transform_n_raster(_moon[12], nmv, projMat);
|
|
||||||
|
|
||||||
memcpy (nmv, cpy, sizeof nmv);
|
|
||||||
|
|
||||||
// Umbriel
|
// Umbriel
|
||||||
rotate(nmv, _r / 2.0f, 0.01f, 0.0f, 0.0f);
|
|
||||||
translate(nmv, 0.0f, 4.0f, 0.0f);
|
|
||||||
scale(nmv, (1/20.0f), (1/20.0f), (1/20.0f));
|
|
||||||
transform_n_raster(_moon[13], nmv, projMat);
|
|
||||||
|
|
||||||
memcpy (nmv, cpy, sizeof nmv);
|
memcpy (nmv, cpy, sizeof nmv);
|
||||||
|
draw_object(nmv, projMat, _moon[13], _r/2.0f, 0.01f, 0, 0, 0, -4.0f, -1.2f, (1/20.0f), 0, 0, 0, 0);
|
||||||
|
|
||||||
// Titania
|
// Titania
|
||||||
rotate(nmv, _r / 3.0f, 0.01f, 0.0f, 0.0f);
|
|
||||||
translate(nmv, 0.0f, 5.0f, 0.0f);
|
|
||||||
scale(nmv, (1/17.0f), (1/17.0f), (1/17.0f));
|
|
||||||
transform_n_raster(_moon[14], nmv, projMat);
|
|
||||||
|
|
||||||
memcpy (nmv, cpy, sizeof nmv);
|
memcpy (nmv, cpy, sizeof nmv);
|
||||||
|
draw_object(nmv, projMat, _moon[14], _r/5.0f, 0.01f, 0, 0, 0, 5.0f, 0, (1/17.0f), 0, 0, 0, 0);
|
||||||
|
|
||||||
// Oberon
|
// Oberon
|
||||||
rotate(nmv, _r / 5.0f, 0.01f, 0.0f, 0.0f);
|
memcpy (nmv, cpy, sizeof nmv);
|
||||||
translate(nmv, 0.0f, 6.0f, 0.0f);
|
draw_object(nmv, projMat, _moon[15], _r/7.0f, 0.01f, 0, 0, 0, 6.0f, -4.4f, (1/17.0f), 0, 0, 0, 0);
|
||||||
scale(nmv, (1/17.0f), (1/17.0f), (1/17.0f));
|
|
||||||
transform_n_raster(_moon[15], nmv, projMat);
|
|
||||||
|
|
||||||
// NEPTUNE
|
// NEPTUNE
|
||||||
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
||||||
rotate(nmv, _a / (165 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
draw_object(nmv, projMat, _planet[7], _a/(165 * 365.2425f), 0, 1, 0, 75.0f, 1, 0, (1/27.7f)*12, _r/0.6f, -0.283f, 1.0f, 0);
|
||||||
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);
|
|
||||||
rotate(nmv, _r / 0.6f, -0.283f, 1.0f, 0.0f);
|
|
||||||
transform_n_raster(_planet[7], nmv, projMat);
|
|
||||||
|
|
||||||
// Triton
|
// Triton
|
||||||
rotate(nmv, _r / 5.0f, 0.0f, 0.01f, 0.0f);
|
draw_object(nmv, projMat, _moon[16], _r/5.0f, 0, 0.01f, 0, 3.0f, 0.0f, 0.0f, (1/10.0f), 0, 0, 0, 0);
|
||||||
translate(nmv, 3.0f, 0.0f, 0.0f);
|
|
||||||
scale(nmv, (1/10.0f), (1/10.0f), (1/10.0f));
|
|
||||||
transform_n_raster(_moon[16], nmv, projMat);
|
|
||||||
|
|
||||||
// PLUTO
|
// PLUTO
|
||||||
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
memcpy(nmv, mvMat, sizeof nmv); /* copie mvMat dans nmv */
|
||||||
rotate(nmv, _a / (248 * 365.2425f), 0.0f, 1.0f, 0.0f);
|
draw_object(nmv, projMat, _planet[8], _a/(248 * 365.2425f), 0, 1, 0, 85.0f, 1, 0, (1/500.7f)*12, _r/6.4f, -0.119f, 1.0f, 0);
|
||||||
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);
|
|
||||||
rotate(nmv, _r / 6.4, -0.119f, 1.0f, 0.0f);
|
|
||||||
transform_n_raster(_planet[8], nmv, projMat);
|
|
||||||
|
|
||||||
// Charon
|
// Charon
|
||||||
rotate(nmv, _r / 5.0f, 0.0f, 0.01f, 0.0f);
|
draw_object(nmv, projMat, _moon[17], _r/5.0f, 0, 0.01f, 0, 3.0f, 0.0f, 0.0f, (1/13.0f), 0, 0, 0, 0);
|
||||||
translate(nmv, 3.0f, 0.0f, 0.0f);
|
|
||||||
scale(nmv, (1/13.0f), (1/13.0f), (1/13.0f));
|
|
||||||
transform_n_raster(_moon[16], nmv, projMat);
|
|
||||||
|
|
||||||
/* déclarer qu'on a changé (en bas niveau) des pixels du screen */
|
/* déclarer qu'on a changé (en bas niveau) des pixels du screen */
|
||||||
gl4dpScreenHasChanged();
|
gl4dpScreenHasChanged();
|
||||||
|
Loading…
Reference in New Issue
Block a user