Third Person Shooting
by Paul /*Wedge*/ DElia · in Torque Game Engine · 07/04/2006 (5:18 pm) · 1 replies
I've been looking at some examples of third person shooters to reevaluate the methods I was using. The problem I realized with all the current examples of third person crosshair/shooting, is they still rely on FPS methods for aiming. Seeing how released games do it though, it seems completley different. Basically they use a normal fixed cross-hair, and project from the point of the crosshair into the world, and then direct the fire at whatever is there. And it works great, you never really notice that the player is changing where they aim.
So I decided to look at material that lets you project mouse clicks into worldspace. The problem I seemed to notice with these, is they all rely on the unproject method, that as far as I can tell, you can only use inside of a GUI, and thus, only on the client. So any vector data derived from that method would have to constantly be sent to the server, and that just didn't seem very efficient if you're going to be firing tons of round out of dual SMGs.
Now what I'm thinking of doing is defining either an arbitrary offset from the player or maybe a mountpoint (since my player isn't always facing up on the z vector), and raycasting along the camera vector from that point. Then find the difference between the point from the cast and the muzzlepoint, and fire along that. To make the crosshair easy to lineup, I'll probably derive it's position from a 3d->2d projection of the offset point and I think it will be accurate.
So does anyone know if I'm going about this the right way, or there's a better way using a 2d->3d projection or some such?
So I decided to look at material that lets you project mouse clicks into worldspace. The problem I seemed to notice with these, is they all rely on the unproject method, that as far as I can tell, you can only use inside of a GUI, and thus, only on the client. So any vector data derived from that method would have to constantly be sent to the server, and that just didn't seem very efficient if you're going to be firing tons of round out of dual SMGs.
Now what I'm thinking of doing is defining either an arbitrary offset from the player or maybe a mountpoint (since my player isn't always facing up on the z vector), and raycasting along the camera vector from that point. Then find the difference between the point from the cast and the muzzlepoint, and fire along that. To make the crosshair easy to lineup, I'll probably derive it's position from a 3d->2d projection of the offset point and I think it will be accurate.
So does anyone know if I'm going about this the right way, or there's a better way using a 2d->3d projection or some such?
About the author
Torque Owner Berserk