look a weapon to the camera
look a weapon to the camera
I have a modell of a weapon and I want to lock it to the camera, so if the player walks and turns around the weapon moves, too.
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
Re: look a weapon to the camera
And what exactly does prevent you from doing that?804 wrote:I have a modell of a weapon and I want to lock it to the camera, so if the player walks and turns around the weapon moves, too.
Working on game: Marrbles (Currently stopped).
Re: look a weapon to the camera
A first person-camera with weapon !
but i don't know how to pos or rot it to get the right effect.
A view like this:
but i don't know how to pos or rot it to get the right effect.
A view like this:
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
Re: look a weapon to the camera
and as I said, what does prevent you from coding it? what problems have occured when you tried? did you even try..?
Working on game: Marrbles (Currently stopped).
Re: look a weapon to the camera
Yes i did a try!
the problem is that the weapon isn't at the same position as the camera, so i need some kind of circle animator
the problem is that the weapon isn't at the same position as the camera, so i need some kind of circle animator
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: look a weapon to the camera
I think you should revisit the point where parent and child nodes are explained. Child nodes will make every transformation the parent does. So no need to animate here, just position the weapon properly as a child. But I guess that a search for weapon an camera would have brought up many threads which explain this.
Re: look a weapon to the camera
Ok thanks, i will take a Look!
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
Re: look a weapon to the camera
Why not just render the weapon on top of the scene? The view of the weapon is purely notional.
Re: look a weapon to the camera
It should go before the scene say AMD and Nvidia, since it covers a significant amount of area and can save drawing there
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: look a weapon to the camera
Yeah, better to render it in the actual scene pass instead of as an overlay, irrlicht automatically does depth sorting based on a node's distance to the camera, so it would always be rendered firsthendu wrote:It should go before the scene say AMD and Nvidia, since it covers a significant amount of area and can save drawing there
Re: look a weapon to the camera
Any examples, i don't understand how this Gould work.
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: look a weapon to the camera
Everything you need to do has been said, create your weapon node, add it as a child to the camera and position it so it looks correct on screen804 wrote:Any examples, i don't understand how this Gould work.
There really is nothing more to it...
Re: look a weapon to the camera
ISceneManager* smgr = device->getSceneManager();
ICameraSceneNode* Cam = smgr->addCameraSceneNode();
IAnimatedMeshSceneNode* weapon = smgr->addAnimatedMeshSceneNode(smgr->getMesh("media/gun.x"), Cam);
ICameraSceneNode* Cam = smgr->addCameraSceneNode();
IAnimatedMeshSceneNode* weapon = smgr->addAnimatedMeshSceneNode(smgr->getMesh("media/gun.x"), Cam);
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
Re: look a weapon to the camera
Only the transparent and light passes are sorted by distance, solids are by texture (at least in 1.7).Radikalizm wrote: Yeah, better to render it in the actual scene pass instead of as an overlay, irrlicht automatically does depth sorting based on a node's distance to the camera, so it would always be rendered first
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: look a weapon to the camera
Ah, did not realize that, haven't taken a look at the irrlicht source for a while now so it's all a bit rustyhendu wrote:Only the transparent and light passes are sorted by distance, solids are by texture (at least in 1.7).Radikalizm wrote: Yeah, better to render it in the actual scene pass instead of as an overlay, irrlicht automatically does depth sorting based on a node's distance to the camera, so it would always be rendered first