   unProject 2D coordinates after rotation?
  Hi,I have searched the forums on gamedev and have found a lot about unprojecting 2D coords into 3D, but I haven''t found any that incorporate rotations. Currently, I am displaying a 3D object, and i allow the object to be rotated, so that all sides of it can be viewed, rotation is as follows: if( status == OBJECT_MOVING )  {    // delta x controls theta, delta y controls pitch    obj_theta += dx;    obj_pitch += dy;    // make sure theta stays between 0 and 360    if( obj_theta >= 360.0 ) obj_theta -= 360.0;    else if( obj_theta < 0 ) obj_theta += 360.0;    // make sure pitch is capped between [-90,90]    if( obj_pitch >= 90.0 ) obj_pitch = 90.0;    else if( obj_pitch <= -90.0 ) obj_pitch = -90.0;    // let glut know to redraw now    glutPostRedisplay();  }//and then these two are called to rotate the image.   glRotatef( obj_pitch, 1, 0, 0 );   glRotatef( obj_theta, 0, 1, 0 );    Now before I do any rotations, I can pick, and move points along the X/Y axis, and then i can put the new X/Y coords in, and everything works fine.Here is how I unpreject the points: glGetIntegerv(GL_VIEWPORT, viewport);    wx = x;    wy = viewport[3]-y;    glGetDoublev(GL_MODELVIEW_MATRIX, modelview);    glGetDoublev(GL_PROJECTION_MATRIX, projection);    glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &wz;    gluUnProject(wx, wy, wz, modelview, projection, viewport, &newX, &newY, &newZ);   subdivisions[0].verts[nameIndex][0] = (GLfloat) newX;    subdivisions[0].verts[nameIndex][1] = (GLfloat) newY;    subdivisions[0].verts[nameIndex-1][2] = (GLfloat) newZ;However, when a rotation occurs, I cant figure out how to get the new points.All of my vertices are scaled between 0 and 1...and I am guessing (hoping), that there is some mathematical way to incorporate theta and pitch into the new X,Y,Z coordinates. I have read some articles on ray tracing, I dont understand them all, but I dont think that will help in this case. I was wondering if anyone had any ideas?thanks in advance. 