Anyone who has poked around the Quake Console command list probably noticed that there is an incomplete chase camera in Quake, invoked by typing 'chase_active 1'. In this tutorial I'll attempt to fix it up so it's more usable. First I will fix it for WinQuake, then later GLQuake. If you try the camera out right now, with no modification, in WinQuake you will notice your weapon model hovering mid-air. The player isn't drawn, so lets fix that first. Open up r_main.c, scroll down to R_DrawEntitiesOnList, you will see this code: if (currententity == &cl_entities[cl.viewentity]) continue; // don't draw the player if (currententity == &cl_entities[cl.viewentity]) { if (!chase_active.value) continue; // don't draw the player else currententity->angles[0] *= 0.3; } if (!r_drawviewmodel.value || r_fov_greater_than_90) return; if (chase_active.value) return; // move towards destination VectorCopy (chase_dest, r_refdef.vieworg); TraceLine(r_refdef.vieworg, chase_dest, stop); if (Length(stop) != 0) VectorCopy(stop, chase_dest); GLQuake actually has the chasecam done a bit better than software, it only needs one correction: The model pitches are off (they correspond exactly with where you're looking, not like how the server scales it back by a third). Open up gl_rmain.c and find the function R_DrawEntitiesOnList, after the line in the first for loop that reads: currententity = cl_visedicts[i]; if (currententity == &cl_entities[cl.viewentity]) currententity->angles[0] *= 0.3; |