Cam FirstPerson

how i can put the camera to firstperson like counter strike?

i don't understand the testfirstperson class.

thanks

If you want to attach a camera to a object, you can use a CameraNode, if you want to move the Camera with mouse and keyboard use FirstPersonHandler.

Play with the Test classes more, its the best way to learn.

i want the same camera of counter strike for example…

thanks

leonardotr11 said:

i want the same camera of counter strike for example...
thanks

I think no one can give you a better answer to your question than Core-Dump has already.
The FirstPersonHandler is a similar camera to the spectrator-camera in Counter Strike.

When you want to create a first-person-shooter, you will need a player-character with some kind of physics. Then your question would be how to create a CharacterController. The easiest start for this would be a terrain, where the camera has a fixed height over the terrain. There are samples for this, too.
leonardotr11 said:

how i can put the camera to firstperson like counter strike?
i don't understand the testfirstperson class.
thanks

Hi!

What don't you understand in this class? I'm going to try to explain to you how you can do. Use StandardGame to create your application, add a game state that uses an input handler fitted in your needs (FirstPersonHandler), your input handler has to be called on update:

Create your game state:

public final class LevelGameState extends BasicGameState{



Declare the first person handler:

private FirstPersonHandler input;



Call it:

@Override
    public final void update(final float tpf){
        super.update(tpf);
        //TODO: save the previous location
        input.update(tpf);
        //TODO: save the next location
        //TODO: test collisions
    }



Add your game state into the game state manager of StandardGame

GameStateManager.getInstance().attachChild(levelGameState);



What don't you understand now? Would you like me to suggest you a more complete and commented source code?

I don't want to derivate this thread but quite lots of people here seem to try to create a first person shooter. It would be fine to have a "flag rush"-like tutorial but for FPS. At least, we should work a bit together because we will have to solve the same problems:
- how to setup the camera?
- how to implement "objects" that can be collected (ammunitions, weapons, ...)?
- how to improve the performances on low end machines?
- how to use particle effects when you shoot or during explosions?
- how to simulate smoke?
- how to implement the jointing (like in Turok 2, a shot can tear an arm)?
- how to implement dynamic geographical modifications (like in Red Faction 2, you can break walls)?