First Person view like in for ex. Half-Life

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
MedievalMagic13

First Person view like in for ex. Half-Life

Post by MedievalMagic13 »

Hello guys.

I'm making a first person shooter, but I don't know how to walk around with a gun like in other games (for example Half-Life). I'm so far that the gun moves with the camera, but it doesn't rotate with it and it stands in the wrong way.

I've checked the forum, but can't really find what I need. I was hoping if somebody could show me exactly how to do it, or give me a link to another FPS game based on Irrlicht which has a gun in it.

Thanks in advance.
deps
Posts: 115
Joined: Sat Jan 10, 2004 5:22 pm
Location: Tranås, Sweden

Post by deps »

vector3df camrot = camera->getRotation();
weaponNode->setRotation( camrot );

i think. never done it before.
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

There was a bug like this in version 0.4. It is fixed in 0.4.2.
Error1312
Posts: 23
Joined: Fri Dec 26, 2003 8:32 pm
Location: Belgium

Post by Error1312 »

Thanks for the answers. I had this code, but I was using version 0.4 instead of 0.4.2. The gun turns with the camera perfectly now :D , but now I have some other problems again :( :

- I've loaded a bitmap with a light node (like in the SpecialFX example), but now certain walls are totally black and while turning the camera, the light acts strange. My level flickers black and than it's normal again. (it's like a disco if you know what I mean).

That's why I was using 0.4 because I don't have that problem there, but now I have no choice but using 0.4.2.

Would somebody know the solution for this problem?
deps
Posts: 115
Joined: Sat Jan 10, 2004 5:22 pm
Location: Tranås, Sweden

Post by deps »

Are you using opengl or directx?
Opengl lightning is still a bit buggy, iirc.
Error1312
Posts: 23
Joined: Fri Dec 26, 2003 8:32 pm
Location: Belgium

Post by Error1312 »

I'm using DirectX.

I've used 'addlightscenenode' like in the exampleFX example to load a bitmap in a 3D world. In version 0.4 this works, the whole room is lighted, but in 0.4.2 it acts very strange.
Post Reply