First Person Shooter View - Gun

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
hyp0th3sis
Posts: 4
Joined: Wed Jun 21, 2006 6:48 am

First Person Shooter View - Gun

Post by hyp0th3sis »

I was wondering how it would be possible to make a model of a gun move with the camera, ie. halflife.

A link to a tutorial or even you explaining would be greatly appreciated.

Thanking you in advance, hyp.

>=D
Last edited by hyp0th3sis on Sat Jun 24, 2006 6:37 pm, edited 1 time in total.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

the link goes approx. half the screen up until you hit the search button. The correct search term can be made from your posting (choose some words, concat them with AND) and understand what others have said long time ago.
hyp0th3sis
Posts: 4
Joined: Wed Jun 21, 2006 6:48 am

Oh sorry!

Post by hyp0th3sis »

Alas, I have done so.
Here is a list of terms i tried, and failed with:
-fps view
-first person shooter gun view
-FPS AND view
-first person shooter AND view NOT fps
-fps AND gun AND view
-first person shooter AND halflife

And the closest i got was a thread that had no answer...

Sorry for not covering this in my first posting.

>=D
Last edited by hyp0th3sis on Sat Jun 24, 2006 6:36 pm, edited 1 time in total.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Try
fps AND weapon
attach AND gun AND camera
hyp0th3sis
Posts: 4
Joined: Wed Jun 21, 2006 6:48 am

Post by hyp0th3sis »

Thankyou, but i spoke to soon. I found the solution during the gap between mine and your post.

Thankyou anyway.

For the curious at heart.
The Solution:

Code: Select all

IAnimatedMeshSceneNode* weapon = smgr->addAnimatedMeshSceneNode(weaponModel, camera, 0, core::vector3df(15, -20, 25), core::vector3df(95,3,180), core::vector3df(1.0f, 0.45f, 1.0f)); 
>=D
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, that's it. There had been some additional hints on how to rotate and position the gun such that firing comes from the gun instead of the screen center etc. so you should at least read the FPS camera tutorial in the FAQ forum. Good job :D
Post Reply