Page 1 of 1

First Person Shooter View - Gun

Posted: Sat Jun 24, 2006 5:43 pm
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

Posted: Sat Jun 24, 2006 6:12 pm
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.

Oh sorry!

Posted: Sat Jun 24, 2006 6:20 pm
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

Posted: Sat Jun 24, 2006 6:33 pm
by hybrid
Try
fps AND weapon
attach AND gun AND camera

Posted: Sat Jun 24, 2006 6:36 pm
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

Posted: Sat Jun 24, 2006 6:42 pm
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