glGetFloatv not returning what I expect

I have code that renders a stick figure and can render a cloud of points surrounding that stick figure. Now I need to retrieve the point locations. I am using glGetFloatv for this task.

Once I have retrieved the points I attempt to render them to verify that they are correct. They are not correct, and they seem to move when I move the camera, which is odd since the stick figure doesn’t move with the camera.

Here is the code that can render or retrieve the points. Does anyone notice anything wrong with it? Keep in mind that the top part of the if statement renders the points correctly.

for (unsigned int p = 0; p < pose.skeleton->point_cloud_rotations.size(); ++p) {
    glPushMatrix();
    glRotate(pose.skeleton->point_cloud_rotations[p]);
    glTranslated(pose.skeleton->bones[b].radius*1.5, 0,
                         (double)p/pose.skeleton->point_cloud_rotations.size() * pose.skeleton->bones[b].length);

    if (render && show_cloud) {
        if (color)
            glColor4f(pose.skeleton->bones[b].color.x * 0.8, pose.skeleton->bones[b].color.y * 0.8, pose.skeleton->bones[b].color.z * 0.8, alpha);
        gluSphere(quad, pose.skeleton->bones[b].radius / 2.0, 8, 8);
    }
    else if (!render) {
        GLfloat mat[16];
        Vector4f origin;
        origin.x = 0;
        origin.y = 0;
        origin.z = 0;
        origin.w = 1;
        glGetFloatv(GL_MODELVIEW_MATRIX, mat);
        pose.points_in_cloud[b][p] = transpose(make_matrix< float, 4, 4 >(mat)) * origin;
    }
            
    glPopMatrix();
}

Here is the function that I use to render the points I retrieve using the above code. I there something wrong with this?

void Character::draw_points_in_cloud(Pose const &pose, State const &state) {
    glPushMatrix();
    glTranslate(state.position);
    glRotatef(state.orientation * 180.0f / (float)M_PI, 0.0f, 1.0f, 0.0f);

    static GLUquadric *quad = NULL;
    if (quad == NULL) {
        quad = gluNewQuadric();
    }

    for (unsigned int b = 0; b < pose.points_in_cloud.size(); ++b) {
        for (unsigned int p = 0; p < pose.points_in_cloud[b].size(); ++p) {
            glPushMatrix();
            glTranslatef(pose.points_in_cloud[b][p].x, pose.points_in_cloud[b][p].y, pose.points_in_cloud[b][p].z);

            glColor4f(pose.skeleton->bones[b].color.x * 0.8, pose.skeleton->bones[b].color.y * 0.8, pose.skeleton->bones[b].color.z * 0.8, 1.0f);
            gluSphere(quad, pose.skeleton->bones[b].radius / 2.0, 8, 8);
            glPopMatrix();
        }
    }

    glPopMatrix();
}

Let me know if I need to post any additional information or be more clear.

Thanks,
Bryan

Nevermind, I fixed it.

There was something wrong. The points were correct, but I needed to load the identity matrix before rendering them.