Download presentation
Presentation is loading. Please wait.
Published byMarissa McLaughlin Modified over 10 years ago
1
Robot Arm //Função callback de redesenho da janela de visualização void Display(void) { glClear(GL_COLOR_BUFFER_BIT); glPushMatrix(); glTranslatef(-1.0, 0.0, 0.0); glRotatef((GLfloat) ombro, 0.0, 1.0, 0.0); glTranslatef(1.0, 0.0, 0.0); glPushMatrix(); glScalef(2.0, 0.4, 1.0); glutWireCube(1.0); glPopMatrix(); …… continua no próximo slide …
2
Robot Arma (continuação da Display) … glTranslatef(1.0, 0.0, 0.0); glRotatef((GLfloat) cotovelo, 0.0, 0.0, 1.0); glTranslatef(1.0, 0.0, 0.0); glPushMatrix(); glScalef(2.0, 0.4, 1.0); glutWireCube(1.0); glPopMatrix(); glPopMatrix(); glutSwapBuffers(); }
3
Robot Arm void Reshape(GLsizei w, GLsizei h) { // Especifica as dimensões da viewport glViewport(0, 0, (GLsizei) w, (GLsizei) h); glMatrixMode(GL_PROJECTION); gluPerspective(65.0, (GLfloat) w/(GLfloat) h, 1.0, 20.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(0.0, 0.0, -5.0); }
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.