diff --git a/main.cpp b/main.cpp index d489016..dda3de7 100644 --- a/main.cpp +++ b/main.cpp @@ -28,8 +28,8 @@ stim::gl_network T; //test network //hard-coded parameters float resample_rate = 0.5; //sample rate for the network (fraction of sigma used as the maximum sample rate) -float camera_factor = 1.2; //start point of the camera as a function of X and Y size -float orbit_factor = 0.01; //degrees per pixel used to orbit the camera +float camera_factor = 1.2f; //start point of the camera as a function of X and Y size +float orbit_factor = 0.01f; //degrees per pixel used to orbit the camera //mouse position tracking int mouse_x; @@ -78,9 +78,9 @@ void glut_render_modelview(){ glMatrixMode(GL_MODELVIEW); //load the modelview matrix for editing glLoadIdentity(); //start with the identity matrix - stim::vec eye = cam.getPosition(); //get the camera position (eye point) - stim::vec focus = cam.getLookAt(); //get the camera focal point - stim::vec up = cam.getUp(); //get the camera "up" orientation + stim::vec3 eye = cam.getPosition(); //get the camera position (eye point) + stim::vec3 focus = cam.getLookAt(); //get the camera focal point + stim::vec3 up = cam.getUp(); //get the camera "up" orientation gluLookAt(eye[0], eye[1], eye[2], focus[0], focus[1], focus[2], up[0], up[1], up[2]); //set up the OpenGL camera } @@ -170,7 +170,8 @@ void glut_initialize(){ int myargc = 1; //GLUT requires arguments, so create some bogus ones char* myargv[1]; - myargv [0]=strdup ("netmets"); + myargv[0] = (char*)malloc(1); + myargv[0][0] = 'h'; glutInit(&myargc, myargv); //pass bogus arguments to glutInit() glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA); //generate a color buffer, depth buffer, and enable double buffering @@ -186,10 +187,10 @@ void glut_initialize(){ texture_initialize(); //set up texture mapping (create texture maps, enable features) - stim::vec c = bb.center(); //get the center of the network bounding box + stim::vec3 c = bb.center(); //get the center of the network bounding box //place the camera along the z-axis at a distance determined by the network size along x and y - cam.setPosition(c + stim::vec(0, 0, camera_factor * std::max(bb.size()[0], bb.size()[1]))); + cam.setPosition(c + stim::vec3(0, 0, camera_factor * std::max(bb.size()[0], bb.size()[1]))); cam.LookAt(c[0], c[1], c[2]); //look at the center of the network } @@ -247,7 +248,7 @@ int main(int argc, char* argv[]) if(args.nargs() == 2){ //if two files are specified, they will be displayed in neighboring viewports and compared num_nets = 2; //set the number of networks to two - float sigma = args["sigma"].as_float(); //get the sigma value from the user + float sigma = (float)args["sigma"].as_float(); //get the sigma value from the user T.load_obj(args.arg(1)); //load the second (test) network GT = GT.resample(resample_rate * sigma); //resample both networks based on the sigma value -- libgit2 0.21.4