Question about RayCasting

70a4cb133d26eb6c63bff857b2a44bef
0
rajesh_kumar 101 Dec 23, 2009 at 04:54

hi Guys,
I am trying to do a First Person Shooting game.I wants to know the shooting mechanism involved in a FPS game.I heard about raycasting.But i have one doubt whether i have screen’s center position as a starting position of ray or i will take weapon position as a starting poistion of ray.
Anyone please suggest me any articles or Thread.Thanks in advance.

—Rajesh—

3 Replies

Please log in or register to post a reply.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 168 Dec 23, 2009 at 17:36

That’s an interesting question. Different FPS games have done it different ways. It’s more “realistic” to take the line of fire from the weapon, but this means the shot will sometimes be blocked by obstacles and won’t reach the crosshair, which can be annoying for players. So it comes down to a design decision. You should try out both ways and see which one you like better.

70a4cb133d26eb6c63bff857b2a44bef
0
rajesh_kumar 101 Dec 24, 2009 at 10:05

Hi Reedbeta Thanks a lot

B7568a7d781a2ebebe3fa176215ae667
0
Wernaeh 101 Dec 25, 2009 at 14:06

You can also use a combination of both - place the shooting center at the weapon tip, but place the camera a little lower, somewhere above the stomach instead of at the head.

Pro: Shooting line and crosshairs in the HUD match.
Con: You lose some feeling of control - for instance, you’ll not be able to look over cover that your head actually sticks out of.

Cheers,
- Wernaeh