Original Post
Hi! I'm currently working on a prototype of a third person shooter game I've had in a mind for a while. I'm using the quake3 engine as my prototyping platform. At the moment, I'm focusing on the camera system. My current implementation uses polar coordinates to easily position the camera around the character using an azimuth, zenith and distance to pivot point. The pivot point is located a few units above the player's head, so that you don't get your character model in the way. It simply occupies the lower region of the screen. However, this offseting introduces a new problem: it also offsets the aiming point of the player. The hud crosshair no longer points at the location the missiles/bullets are expected to hit. I'm probably not the first dude trying to do that, so I was curious if anyone has faced this problem before and how they solved it. And I don't want to shoot from the camera origin: bullets and missiles have to come from the player weapon's muzzleflash point. The only decent solution that I've been able to figure out so far is to dynamically update the player character direction to face the point the camera is looking at. It would involve the following steps: * chasecam pivot = get current character head origin + offset (X units up) * use current character's yaw/pitch angle to position the chasecam in its back, applying any extra polar coordinate offsets (distance,azimuth,zenith) * orient the camera to face the pivot point * trace a ray from current camera position along the camera direction to find the closest intersection point with the world. We'll call it the focus point of the camera * adjust the character entity orientation to face this focus point Any other suggestions/critics/comments?
