I am trying to rotate a model about a point, (the camera), and have it render in the same place. This is proving difficult, as the model always either shoots away, or just doesn't render in the right place.
The model is a set of arms, as a First Person View. Any ideas on how to do this? I have found multiple sites saying how, I tried them, and they just didn't work.
Thanks in advance!
EDIT:
My render code:
public void renderModel(Camera cam) {
setPos(0, 0, 0);
glPushMatrix();
glLoadIdentity();
glRotatef(cam.pitch, 1f, 0f, 0.0f);
glRotatef(-cam.yaw, 0.0f, 1f, 0.0f);
glRotatef(cam.roll, 0.0f, 0f, 1f);
setPos(cam.x + 1, cam.y - 2, cam.z + 1);
glBegin(GL_TRIANGLES);
glColor3f(colour[0], colour[1], colour[2]);
for (Face face : faces) {
Vector3f n1 = normals.get((int) face.normal.x - 1);
glNormal3f(n1.x, n1.y, n1.z);
Vector3f v1 = vertices.get((int) face.vertex.x - 1);
glVertex3f(v1.x + xPos, v1.y + yPos, v1.z + zPos);
Vector3f n2 = normals.get((int) face.normal.y - 1);
glNormal3f(n2.x, n2.y, n2.z);
Vector3f v2 = vertices.get((int) face.vertex.y - 1);
glVertex3f(v2.x + xPos, v2.y + yPos, v2.z + zPos);
Vector3f n3 = normals.get((int) face.normal.z - 1);
glNormal3f(n3.x, n3.y, n3.z);
Vector3f v3 = vertices.get((int) face.vertex.z - 1);
glVertex3f(v3.x + xPos, v3.y + yPos, v3.z + zPos);
}
glEnd();
glPopMatrix();
}
Edited by Matthewj234, 04 June 2012 - 09:59 AM.






