|
From: Mike D. <o3d...@us...> - 2005-01-08 07:22:58
|
Update of /cvsroot/grappelmann/spaceplane In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20632 Modified Files: gravity.cpp gravity.h mesh.cpp object3d.cpp Log Message: - removed some debugging - changes to constants Index: gravity.cpp =================================================================== RCS file: /cvsroot/grappelmann/spaceplane/gravity.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** gravity.cpp 29 Aug 2004 05:43:27 -0000 1.8 --- gravity.cpp 8 Jan 2005 07:22:49 -0000 1.9 *************** *** 197,201 **** rotation.m_z = 0; ! double mass = (rand() / (double)RAND_MAX) * (double)1000; objectArray[0].setMass(mass); --- 197,201 ---- rotation.m_z = 0; ! double mass = (rand() / (double)RAND_MAX) * (double)500; objectArray[0].setMass(mass); *************** *** 218,222 **** rotation.m_z = (pos_t)((pos_t) (rand() / (pos_t)RAND_MAX) * (pos_t)360) - 180; ! double mass = (rand() / (double)RAND_MAX) * (double)1000000000; objectArray[i].setMass(mass); --- 218,222 ---- rotation.m_z = (pos_t)((pos_t) (rand() / (pos_t)RAND_MAX) * (pos_t)360) - 180; ! double mass = (rand() / (double)RAND_MAX) * (double)1000000; objectArray[i].setMass(mass); *************** *** 321,327 **** } ! char* vrmlFilename = argv[1]; ModelLoader* modelLoader = new X3DLoader(); ! SceneObject* slugMobile = modelLoader->loadModel(vrmlFilename); //Model monkey(vrmlFilename); --- 321,328 ---- } ! //char* vrmlFilename = argv[1]; ModelLoader* modelLoader = new X3DLoader(); ! SceneObject* slugMobile = modelLoader->loadModel("slug_mobile.x3d"); ! SceneObject* rocket = modelLoader->loadModel("rocket.x3d"); //Model monkey(vrmlFilename); *************** *** 367,372 **** for(; objectCount < MAX_OBJECTARRAY_SIZE; objectCount++) { ! objectArray.push_back(slugMobile); } // randomise the object's initial position --- 368,376 ---- for(; objectCount < MAX_OBJECTARRAY_SIZE; objectCount++) { ! objectArray.push_back(rocket); } + // big 'planet' + //objectArray.push_back(slugMobile); + //objectCount++; // randomise the object's initial position *************** *** 375,378 **** --- 379,393 ---- exit(-1); } + + /* + long planetIndex = objectArray.size() - 1; + //objectArray[planetIndex].setDiameter(500); + objectArray[planetIndex].setMass(1000000000); + + Coord3D& planetPosition = objectArray[planetIndex].getPos(); + planetPosition.m_x = -40; + planetPosition.m_y = 0; + planetPosition.m_z = 0; + */ /* *************** *** 392,396 **** --- 407,421 ---- glTranslatef(0.0, 0.0, -5.0); + double cosX; + double cosY; + double cosZ; + double sinX; + double sinY; + double sinZ; + GLdouble viewPointMatrix[16]; + // a factor to convert between degrees and radians + double degreeToRadianRatio = M_PI / 180; + // now loop until we are done while(!SystemStateSingleton::instance().done) { *************** *** 426,429 **** --- 451,455 ---- // statGraphRenderer.render(); + /* GLfloat light_position[] = { lightPos.m_x, lightPos.m_y, lightPos.m_z, 1.0 }; GLfloat white_light[] = { 1, 1, 1, 1.0 }; *************** *** 437,440 **** --- 463,467 ---- glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient_light); glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_FALSE); + */ glMatrixMode( GL_MODELVIEW ); glLoadIdentity( ); *************** *** 448,458 **** // call draw here] ! glRotatef(-rotation.m_x, 1.0, 0.0, 0.0); ! glRotatef(-rotation.m_y, 0.0, 1.0, 0.0); ! glRotatef(-rotation.m_z, 0.0, 0.0, 1.0); ! glTranslatef(position.m_x, position.m_y, position.m_z); //position.m_z -= 0.1; ! glColor3f(1, 1, 1); glBegin(GL_LINES); glVertex3f(10, 0, -20); --- 475,551 ---- // call draw here] ! //glutWireSphere(10.0, 50, 50); ! ! /* ! glColor3f(0, 0, 1.0); ! glBegin(GL_LINES); ! glVertex3f(0, 0, 0); ! glVertex3f(0, 0, 10); ! glEnd(); ! */ ! ! //glRotatef(-rotation.m_z, 0.0, 0.0, 1.0); //position.m_z -= 0.1; ! glColor3f(1.0, 0, 0); ! glBegin(GL_LINES); ! glVertex3f(0, 0, -20); ! glVertex3f(20, 0, -20); ! glEnd(); ! glBegin(GL_LINES); ! glVertex3f(0, 0, -20); ! glVertex3f(0, 20, -20); ! glEnd(); ! glBegin(GL_LINES); ! glVertex3f(0, 0, -20); ! glVertex3f(0, 0, -40); ! glEnd(); ! ! ! double xXvalue = cos((rotation.m_y) * degreeToRadianRatio); ! double xZvalue = sin((rotation.m_y) * degreeToRadianRatio); ! double yYvalue = sin((rotation.m_x + 90) * degreeToRadianRatio); ! double yZvalue = -cos((rotation.m_x + 90) * degreeToRadianRatio); ! cout << "rotation.m_x [" << rotation.m_x << "]" << endl; ! cout << "rotation.m_y [" << rotation.m_y << "]" << endl; ! cout << "yYvalue [" << yYvalue << "]" << endl; ! cout << "yZvalue [" << yZvalue << "]" << endl; ! cout << "xXvalue [" << xXvalue << "]" << endl; ! cout << "xZvalue [" << xZvalue << "]" << endl; ! ! glRotatef(-rotation.m_x, xXvalue, 0.0, xZvalue); ! glColor3f(0, 1.0, 0); ! glBegin(GL_LINES); ! glVertex3f(0, 0, -20); ! glVertex3f(20, 0, -20); ! glEnd(); ! glBegin(GL_LINES); ! glVertex3f(0, 0, -20); ! glVertex3f(0, 20, -20); ! glEnd(); ! glBegin(GL_LINES); ! glVertex3f(0, 0, -20); ! glVertex3f(0, 0, -40); ! glEnd(); ! ! glRotatef(-rotation.m_y, 0.0, yYvalue, yZvalue); ! glColor3f(0, 0, 1.0); ! glBegin(GL_LINES); ! glVertex3f(0, 0, -20); ! glVertex3f(20, 0, -20); ! glEnd(); ! glBegin(GL_LINES); ! glVertex3f(0, 0, -20); ! glVertex3f(0, 20, -20); ! glEnd(); ! glBegin(GL_LINES); ! glVertex3f(0, 0, -20); ! glVertex3f(0, 0, -40); ! glEnd(); ! ! glColor3f(1.0, 1.0, 1.0); ! ! glTranslatef(position.m_x, position.m_y, position.m_z); ! glBegin(GL_LINES); glVertex3f(10, 0, -20); *************** *** 485,488 **** --- 578,582 ---- for(vector<Object3D>::iterator i = objectArray.begin(); i != objectArray.end(); i++) { count++; + // *** NOTE *** REMOVE comment below (*i).draw(); } *************** *** 507,510 **** --- 601,608 ---- /* $Log$ + Revision 1.9 2005/01/08 07:22:49 o3dozone + - removed some debugging + - changes to constants + Revision 1.8 2004/08/29 05:43:27 o3dozone - added gravity Index: gravity.h =================================================================== RCS file: /cvsroot/grappelmann/spaceplane/gravity.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gravity.h 24 Jun 2004 19:46:40 -0000 1.2 --- gravity.h 8 Jan 2005 07:22:49 -0000 1.3 *************** *** 22,26 **** #include "statgraphrenderer.h" ! #define MAX_OBJECTARRAY_SIZE 200 #endif --- 22,26 ---- #include "statgraphrenderer.h" ! #define MAX_OBJECTARRAY_SIZE 5 #endif *************** *** 28,31 **** --- 28,35 ---- /* $Log$ + Revision 1.3 2005/01/08 07:22:49 o3dozone + - removed some debugging + - changes to constants + Revision 1.2 2004/06/24 19:46:40 o3dozone - added magic CVS tags Index: mesh.cpp =================================================================== RCS file: /cvsroot/grappelmann/spaceplane/mesh.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mesh.cpp 17 Aug 2004 18:21:43 -0000 1.6 --- mesh.cpp 8 Jan 2005 07:22:49 -0000 1.7 *************** *** 37,41 **** bool Mesh::_draw() { // first draw myself ! cout << "<Mesh::_draw>\tI'm a star!" << endl; // then draw the children --- 37,41 ---- bool Mesh::_draw() { // first draw myself ! //cout << "<Mesh::_draw>\tI'm a star!" << endl; // then draw the children *************** *** 56,59 **** --- 56,63 ---- /* $Log$ + Revision 1.7 2005/01/08 07:22:49 o3dozone + - removed some debugging + - changes to constants + Revision 1.6 2004/08/17 18:21:43 o3dozone Index: object3d.cpp =================================================================== RCS file: /cvsroot/grappelmann/spaceplane/object3d.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** object3d.cpp 29 Aug 2004 05:43:27 -0000 1.2 --- object3d.cpp 8 Jan 2005 07:22:49 -0000 1.3 *************** *** 14,18 **** m_transform.setRotation(m_rotation, length); ! double scale = m_mass / 1000000000; Coord3D scaleCoords(scale, scale, scale); m_transform.setScale(scaleCoords); --- 14,18 ---- m_transform.setRotation(m_rotation, length); ! double scale = m_mass / 1000000; Coord3D scaleCoords(scale, scale, scale); m_transform.setScale(scaleCoords); |