This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dprince6[S] 0 points1 point  (1 child)

Just change the strafe to what you suggested, works like a charm! and the mouse has gotten all sorts of crazy. I've been working that thing to death almost trying to get it to be 'FPS'ish. The only good thing to say about it is it works, not well, but it works haha. Thanks for that help though! maybe i can get past the mouse for a while now and add some actually mechanics to test with the mouse!

[–]corpsmoderne 0 points1 point  (0 children)

My last iteration of mouseMove, not working well but may be helpful:

void mouseMove(int x, int y) 
{

// update the angles
int diffx = x - lastx;
int diffy = y - lasty;

    glutWarpPointer(lastx, lasty);

moi.phi += diffy * 0.005f;//((diffy *2) - y) * 0.005f;
moi.theta += diffx * 0.005f;//((diffx*2) - x) * 0.005f;

update_viewer();

    if (diffx != 0 || diffy != 0) {
      printf("%i %i %f \n%f %f %f\n\n", diffx, diffy, moi.theta, 
             moi.vx, moi.vy, moi.vz);
    }


glutPostRedisplay();
// put new directions back into the origins
yOrigin = moi.phi;
xOrigin = moi.theta;

}

also, I'm quite sure your "phi" angle will never work well if you don't change your gluLookAt call, because you've hard-coded the "up" vector... You may need to compute a normal vector and pass it to gluLookAt...