void Geode::draw(Matrix4 C) { glMatrixMode(GL_MODELVIEW); setModelView(&C); render(C); glPopMatrix(); }
// funciÛn de gestion de ventana void Display(){ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // borra todo lo existente en el framebuffer setModelView(); // poicionamos el centro de coordenadas glTranslatef(0.0f, 0.0f, -gl_center); // el eje cenital es el Y float x = (float)(radio*sin(theta)*sin(phi)); float y = (float)(radio*cos(theta)); float z = (float)(radio*sin(theta)*cos(phi))+100; gluLookAt(x,y,z,0.0f,0.0f,0.0f,0.0f,1.0f,0.0f); // mira al (0,0,0) setMaterial(); // TO DO modelo->Draw(); //model->Draw(); glFlush(); // actualiza el framebuffer glutSwapBuffers(); // en caso de animacion }
// función de gestión de ventana void Display() { if (!lock) { lock = true; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // borra todo lo existente en el framebuffer setModelView(); // poicionamos el centro de coordenadas glTranslatef(-4.2f, -2.0f, -gl_center); // el eje cenital es el Y float x = (float)(radio*sin(theta)*sin(phi))*-2; float y = (float)(radio*cos(theta)); float z = (float)(radio*sin(theta)*cos(phi)); gluLookAt(x, y, z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); // mira al (0,0,0) setMaterial(); // TO DO /*dibujaEsfera(0.0f, 0.0f, 0.0f, 0.1f); dibujaEsfera(1.0f, 0.0f, 0.0f, 0.1f); dibujaEsfera(0.0f, 1.0f, 0.0f, 0.1f); dibujaEsfera(1.0f, 1.0f, 0.0f, 0.1f); dibujaEsfera(0.0f, 0.0f, -1.0f, 0.1f); dibujaEsfera(1.0f, 0.0f, -1.0f, 0.1f); dibujaEsfera(0.0f, 1.0f, -1.0f, 0.1f); dibujaEsfera(1.0f, 1.0f, -1.0f, 0.1f);*/ //test1(); testGame->display(); glFlush(); // actualiza el framebuffer glutSwapBuffers(); // en caso de animacion lock = false; } }
void Geode::draw(Matrix4 matrix) { setModelView(matrix); render(); unsetModelView(); }
void Geode::drawBoundingSpheres(Matrix4 worldMatrix) { setModelView(worldMatrix); glColor3f(1, 1, 1); glutWireSphere(sphereRadius, 10, 10); unsetModelView(); }