int main(int argc, char *argv[]) { point_num = 8000; screenwidth = screenheight = 1024; if (argc != 4) { printf("Usage : %s numOfSites screenWidth readSitesFromFile\n"); exit(-1); } point_num = atoi(argv[1]); screenwidth = atoi(argv[2]); bReadSitesFromFile = atoi(argv[3]); if(screenwidth <= 1 || point_num < 2) { printf("Invalid Args!\n"); return -1; } screenheight = screenwidth; // * 5 / 8; InitializeGlut(&argc, argv); srand((unsigned)time(NULL)); InitializeSites(point_num); glutMainLoop(); DestroySites(); DestroyCg(); DestroyGlut(); return 0; }
int main(int argc, char *argv[]) { string inputSkeleton; string inputMotion; SMRMotion motion; ParamHandler argh; argh.AddLong("motion", 'm').SetString().SetDesc("input motion file" , "<file>"); argh.AddLong("skeleton", 's').SetString().SetDesc("input skeleton file" , "<file>"); argh.AddLong("help", 'h').SetBool().SetDesc("Displays quick manual."); argh.StartParse(argc, argv); for(;;) { int c = argh.GetParam(); if(c == -1)break; switch(c) { case 's': inputSkeleton = argh.GetString(); break;//worst = argh.GetBool(); break; case 'm': inputMotion = argh.GetString(); break; default : printf( "*** SMR simple viewer demo ***\n" "\n Usage: motionPlayer [<option> [<...>]] \n" "\n This demo lets you play bvh or asf/amc animations\n"); argh.ListOptions(); printf("\nNo warranty whatsoever.\n"); return 0; } } if (inputMotion.find(".amc",0) != string::npos ) { if (inputSkeleton.find(".asf") == string::npos ) { cout << "You shall specify an asf skeleton file with an amc file" << endl; return 0; }else { motion = loadMotionFromAcclaim( getFileName(inputSkeleton), getFileName(inputMotion) ); myMotionPlayer = new SMRMotionPlayer( &motion ); } }else if (inputMotion.find(".bvh",0) != string::npos ) { motion = loadMotionFromBVH( getFileName(inputMotion) ); myMotionPlayer = new SMRMotionPlayer( &motion ); }else if (inputSkeleton.find(".vsk",0) != string::npos ) { motion = loadMotionFromVSK( inputSkeleton, inputMotion); myMotionPlayer = new SMRMotionPlayer( &motion ); //SMRSkeleton mySkeleton = loadSkeletonFromVSK(inputSkeleton); //SMRQuaternion identity; //identity.identity(); //for(int i = 0; i< mySkeleton.getNumJoints(); i++) //{ // mySkeleton.getJoint(i)->setOrientation(identity); //} //save the file as bvh //exportMotionToBVH("shrug.bvh",motion, mySkeleton); // //exportPoseToBVH("blah.bvh", mySkeleton); //mySkeleton.setMode(RELATIVEMODE); } else { cout << "unknown file format" << endl; return 0; } // get GLUT to work InitializeGlut(&argc, argv); // Init the Smr Library Smr::initSmr(); // Init the shaders capability InitShaders(); // Get my scene prepared InitScene(); // Enter the endless loop glutMainLoop(); // Exit properly ShutDown(); //delete(motion); return 0; }