How can I get the camera to follow a moving object from behind in C++ and openGL [closed]
- by user1324894
I am trying to get the camera to follow an object that moves around my environment using the gluLookAt function. This is my code for the object moving in the direction that it faces:
Xtri += -Vtri*cos((90+heading)*(PI/180.0f));
Ztri += Vtri*sin((90+heading)*(PI/180.0f));
I then render the object:
glPushMatrix();
glTranslatef(Xtri,0,Ztri);…