Пример #1
0
static void
load_bling (RendererCar *self)
{
    if (!self->display_lists_ready) {
        if (self->chassis_model)
            self->chassis_dl = compile_display_list (self, "chassis",
                    self->chassis_model);
        if (self->wheel_model)
            self->wheel_dl = compile_display_list (self, "wheel",
                    self->wheel_model);
    }
    self->display_lists_ready = 1;
}
Пример #2
0
static void 
_renderer_draw (BotViewer *viewer, BotRenderer *super)
{
    GfeRenderer *self = (GfeRenderer*) super->user;

    glEnable(GL_DEPTH_TEST);

    if (!self->display_lists_ready) {
        if (self->wavefront_model)
            self->wavefront_dl = compile_display_list (self, "wavefront", self->wavefront_model);

            self->wavefront_dl2 = compile_display_list (self, "wavefront", self->wavefront_model2); //edited

        self->display_lists_ready = 1;
    }

    glPushMatrix();


// These are all widgets. Attempt to remove these widget parameters and input actual rotational values
    double scale = bot_gtk_param_widget_get_double(self->pw, PARAM_SCALE);
    glScalef (scale, scale, scale);
    
    double rot_x = bot_gtk_param_widget_get_double(self->pw, PARAM_ROT_X);
    double rot_y = bot_gtk_param_widget_get_double(self->pw, PARAM_ROT_Y);
    double rot_z = bot_gtk_param_widget_get_double(self->pw, PARAM_ROT_Z);
    glRotatef(rot_z, 0, 0, 1);
    glRotatef(rot_y, 0, 1, 0);
    glRotatef(rot_x, 1, 0, 0);

    double dx = bot_gtk_param_widget_get_double(self->pw, PARAM_DX);
    double dy = bot_gtk_param_widget_get_double(self->pw, PARAM_DY);
    double dz = bot_gtk_param_widget_get_double(self->pw, PARAM_DZ);
    glTranslated(dx, dy, dz);

    if (self->display_lists_ready && self->wavefront_dl)
        draw_wavefront_model (self);

    glPopMatrix();
}