void draw_scene(void)
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glDisable(GL_DEPTH_TEST);
    background();
    glEnable(GL_DEPTH_TEST);
    glClear(GL_DEPTH_BUFFER_BIT);

    glLoadIdentity();
    gluPerspective(45.0f, (GLfloat)window_width / (GLfloat)window_height, 1.0f, 15500.0f);

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();


    glPushMatrix();
    glTranslatef(0,0,-5);
    print_collected_coins(2.7,1.9,GLUT_BITMAP_HELVETICA_18,"Coins Collected:");
    glPopMatrix();

    glPushMatrix();
    glRotatef(rot_x,1,0,0);
    glRotatef(rot_y,0,1,0);
    glRotatef(rot_z,0,0,1);

    glTranslatef(0,0,-85);
    select_camera();

    glPushMatrix();

    world.design(0,0,0);
    glPushMatrix();
    make_humanoid();
    glPopMatrix();

    glPopMatrix();

    glPopMatrix();
    glFlush();
    glutSwapBuffers();
}
Exemple #2
0
void draw_scene(void)
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glDisable(GL_DEPTH_TEST);
    background();
    glEnable(GL_DEPTH_TEST);
    glClear(GL_DEPTH_BUFFER_BIT);

    glLoadIdentity();
    gluPerspective(45.0f, (GLfloat)window_width / (GLfloat)window_height, 1.0f, 15500.0f);

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    /*glLightfv(GL_LIGHT0, GL_SPECULAR, whiteSpecularLight);
    glLightfv(GL_LIGHT0, GL_AMBIENT, blackAmbientLight);
    glLightfv(GL_LIGHT0, GL_DIFFUSE, whiteDiffuseLight);*/



    glPushMatrix();
    glTranslatef(0,0,-5);
    print_collected_coins(3.0,1.9,GLUT_BITMAP_HELVETICA_18,"Score:");
    glPopMatrix();

    glPushMatrix();
    glRotatef(rot_x,1,0,0);
    glRotatef(rot_y,0,1,0);
    glRotatef(rot_z,0,0,1);

    glTranslatef(0,0,-85);
    select_camera();

    glPushMatrix();

    make_world();

    //display_powers();
    //display_obstacles();

    glPushMatrix();
    if(!falling && !change_lane)
    {
        r_z += robot_velocity;
        robot_motion = robot_slide?0:1;
    }

    glPushMatrix();
    make_humanoid();
    glPopMatrix();

    /*glPushMatrix();
    glTranslatef(humanoid.loc_x/2.0,20,humanoid.loc_z/2.0 + 20);
    test(1,1,10);
    glPopMatrix();*/

    //spot(humanoid.loc_x/2.0,30,humanoid.loc_z/2.0,0,-1,0);

    //make_spotlight();

    glPopMatrix();

    glPopMatrix();

    glPopMatrix();
    glFlush();
    glutSwapBuffers();
}
Exemple #3
0
/** Crée l'interface : boutons, intitulés, menus... */
void Ui_MainWindow::setupUi(QMainWindow *MainWindow) {
  if (MainWindow->objectName().isEmpty())
    MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
  actionQuitter = new QAction(MainWindow);
  actionQuitter->setObjectName(QString::fromUtf8("actionQuitter"));
  actionFichier = new QAction(MainWindow);
  actionFichier->setObjectName(QString::fromUtf8("actionFichier"));
  actionWebcam = new QAction(MainWindow);
  actionWebcam->setObjectName(QString::fromUtf8("actionWebcam"));
  centralwidget = new QWidget(MainWindow);
  centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
  listWidget = new QListWidget(centralwidget);
  new QListWidgetItem(listWidget);
  listWidget->setObjectName(QString::fromUtf8("listWidget"));
  listWidget->setDragDropMode(QAbstractItemView::InternalMove);
  cvwidget = new QOpenCVWidget(this);
  cvwidget->setObjectName(QString::fromUtf8("cvwidget"));
  label_2 = new QLabel(centralwidget);
  label_2->setObjectName(QString::fromUtf8("label_2"));
  label_6 = new QLabel(centralwidget);
  label_6->setObjectName(QString::fromUtf8("label_6"));
  comboBox_4 = new QComboBox(centralwidget);
  comboBox_4->setObjectName(QString::fromUtf8("comboBox_4"));
  buttonBox_2 = new QDialogButtonBox(centralwidget);
  buttonBox_2->setObjectName(QString::fromUtf8("buttonBox_2"));
  apply_button = new QPushButton(tr("Appliquer"));
  delete_button = new QPushButton(tr("Supprimer"));
  buttonBox_2->addButton(apply_button, QDialogButtonBox::AcceptRole);
  buttonBox_2->addButton(delete_button, QDialogButtonBox::RejectRole);
  comboBox = new QComboBox(centralwidget);
  comboBox->setObjectName(QString::fromUtf8("comboBox"));
  MainWindow->setCentralWidget(centralwidget);
  menubar = new QMenuBar(MainWindow);
  menubar->setObjectName(QString::fromUtf8("menubar"));
  menubar->setGeometry(QRect(0, 0, 540, 25));
  menuFichier = new QMenu(menubar);
  menuFichier->setObjectName(QString::fromUtf8("menuFichier"));
  menuOuvrir = new QMenu(menuFichier);
  menuOuvrir->setObjectName(QString::fromUtf8("menuOuvrir"));
  MainWindow->setMenuBar(menubar);
  statusbar = new QStatusBar(MainWindow);
  statusbar->setObjectName(QString::fromUtf8("statusbar"));
  MainWindow->setStatusBar(statusbar);

  menubar->addAction(menuFichier->menuAction());
  menuFichier->addAction(menuOuvrir->menuAction());
  menuFichier->addAction(actionQuitter);
  menuOuvrir->addAction(actionFichier);
  menuOuvrir->addAction(actionWebcam);

  may_the_force_be_with_you();

  retranslateUi(MainWindow);
  QObject::connect(actionQuitter, SIGNAL(triggered()), MainWindow, SLOT(close()));
  QObject::connect(actionFichier, SIGNAL(triggered()), MainWindow, SLOT(select_file()));
  QObject::connect(buttonBox_2, SIGNAL(accepted()), MainWindow, SLOT(apply_changes()));
  QObject::connect(buttonBox_2, SIGNAL(rejected()), MainWindow, SLOT(delete_filter()));
  QObject::connect(actionWebcam, SIGNAL(triggered()), MainWindow, SLOT(select_camera()));

  QMetaObject::connectSlotsByName(MainWindow);
}