I want my camera to put on the shoulder.
Why doesn’t this source working?
source
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glTranslatef(5., 0., 5.);
//stand
glPushMatrix();
glScalef(5.0f, 1.f, 5.f);
glutSolidCube(1.);
glPopMatrix();
gluLookAt(0.0f,0.0f,0.0f,-(float)cos(shoulderAngle),0.0f,-(float)sin(shoulderAngle),0.0f,1.0f,0.0f);
glRotatef(shoulderAngle, 0.0, 1.0, 0.0);
glTranslatef(0., 4., 0.);
//shoulder
glPushMatrix();
glScalef(3.f, 8.f, 5.f);
glutSolidCube(1.);
glPopMatrix();