diff --git a/sources/main.cpp b/sources/main.cpp index 4af9c6e..b0f8f3a 100755 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -363,11 +363,11 @@ glRotatef(deltay, 0.0f, 1.0f, 0.0f); // Rotation around the Y axis glRotatef(deltaz, 1.0f, 0.0f, 0.0f); - cube->draw(); - cube->rotate(Vec(0.0f, 0.01f, 0.01f)); + //cube->draw(); + //cube->rotate(Vec(0.0f, 0.01f, 0.01f)); - //myModel->draw(); + myModel->draw(); light0.draw(); light0.trace(); @@ -424,61 +424,17 @@ } //scene rotation - if (keystate[SDLK_LEFT]) { - deltay -= 2.0f; - } - - if (keystate[SDLK_RIGHT]) { - deltay += 2.0f; - } - - if (keystate[SDLK_UP]) { - deltaz -= 2.0f; - } - - if (keystate[SDLK_DOWN]) { - deltaz += 2.0f; - } - + if (keystate[SDLK_LEFT]) deltay -= 2.0f; + if (keystate[SDLK_RIGHT]) deltay += 2.0f; + if (keystate[SDLK_UP]) deltaz -= 2.0f; + if (keystate[SDLK_DOWN]) deltaz += 2.0f; + // move viewer - if (keystate[SDLK_w]) { - viewer_zpos -= 0.1f; - } - - if (keystate[SDLK_s]) { - viewer_zpos += 0.1f; - } - - //if (keystate[SDLK_w]) { - //viewer_ypos += 0.1f; - //} - - //if (keystate[SDLK_s]) { - //viewer_ypos -= 0.1f; - //} - - if (keystate[SDLK_a]) { - viewer_xpos -= 0.1f; - } - - if (keystate[SDLK_d]) { - viewer_xpos += 0.1f; - } - - //light rotation - /* if (keystate[SDLK_a]) - lightpos[0]+=lightdelta; - if (keystate[SDLK_d]) - lightpos[0]-=lightdelta; - if (keystate[SDLK_w]) - lightpos[1]+=lightdelta; - if (keystate[SDLK_s]) - lightpos[1]-=lightdelta; - if (keystate[SDLK_q]) - lightpos[2]+=lightdelta; - if (keystate[SDLK_e]) - lightpos[2]-=lightdelta; - */ + if (keystate[SDLK_w]) viewer_zpos -= 0.1f; + if (keystate[SDLK_s]) viewer_zpos += 0.1f; + if (keystate[SDLK_a]) viewer_xpos -= 0.1f; + if (keystate[SDLK_d]) viewer_xpos += 0.1f; + if (keystate[SDLK_SPACE]) { deltacolor += 0.01f; if (deltacolor > 1.0f) { @@ -486,36 +442,10 @@ } } - - //////////////// // Swap buffers: mysleep(2000); // Just don't kill computer resources ;) SDL_GL_SwapBuffers(); - - // Plain stupid log, just to show values: - //printf("X: %d, Y: %d, but1: %d, but2: %d\n", - - //light rotation - /* if (keystate[SDLK_a]) - lightpos[0]+=lightdelta; - if (keystate[SDLK_d]) - lightpos[0]-=lightdelta; - if (keystate[SDLK_w]) - lightpos[1]+=lightdelta; - if (keystate[SDLK_s]) - lightpos[1]-=lightdelta; - if (keystate[SDLK_q]) - lightpos[2]+=lightdelta; - if (keystate[SDLK_e]) - lightpos[2]-=lightdelta; - */ - if (keystate[SDLK_SPACE]) { - deltacolor += 0.01f; - if (deltacolor > 1.0f) { - deltacolor = 0.0f; - } - } } // Ok, release everything and byebye: diff --git a/sources/poly.cpp b/sources/poly.cpp index ffef192..6f3f102 100755 --- a/sources/poly.cpp +++ b/sources/poly.cpp @@ -138,7 +138,7 @@ glEnd(); //draw Normals - for ( std::vector::size_type i = 0; i < vcount; i++ ) { +/* for ( std::vector::size_type i = 0; i < vcount; i++ ) { Vec cur = rotate_xyz(*initpoints.at(i) - *position); //previous and next Vector of current Vector to calculate normal Vec prev = rotate_xyz(*initpoints.at((i-1+vcount)%vcount) - *position); @@ -150,7 +150,7 @@ glVertex3fv((cur + *position).c); glVertex3fv((cur + prev.cross(next).normalize() + *position).c); glEnd(); - } + }*/ } int Poly::numPoints() {