=Who can I load a mesh representing a weapon inside the world and makes it looks like the one in FPS games?
when I do that using code like this:
weapon_node->setRotation(camera->getRotation());
weapon_node->setPosition(camera->getPosition());
when I move with the camera the weapon jerks and vibrate?
is there a better way?
=Is there a function to get the material list of a mesh by name not by index?
=When I load a 3ds mesh, it appears without its texures, but when I open it by other programs
it appears complete with its textures, why is that?
=What are the versions of 3ds formate, Irrlicht engine suppors?
Some questions!
-
sirshane
Rather than set the weapon to the same position and orientation as the camera, you probably want to add the weapon's node as a child node of the camera, like this:
camera->addChild( weapon_node );
The weapon should move with the camera's motion, as it would in any first person shooter.
The purpose of nodes is to arrange 3d objects into a hierarchy, so that they may be organized more easily. Any node can have child nodes which move and rotate according to their parent's orientations automatically. ( To be completely honest I haven't actually tried this in Irrlicht yet, but that's the general idea behind nodes and it should be the same. )
As for getting a list of materials by name, i'm not too sure... Maybe someone else can help out here?
When you load a 3ds model you need to apply it's texture manually, like so:
weapon_node->setMaterialTexture( 0, videoDriver->getTexture( "blah.jpg" ) );
That sets the first texture of the weapon mesh to 'blah.jpg'.
As far as I know Irrlicht loads all 3ds types.
camera->addChild( weapon_node );
The weapon should move with the camera's motion, as it would in any first person shooter.
The purpose of nodes is to arrange 3d objects into a hierarchy, so that they may be organized more easily. Any node can have child nodes which move and rotate according to their parent's orientations automatically. ( To be completely honest I haven't actually tried this in Irrlicht yet, but that's the general idea behind nodes and it should be the same. )
As for getting a list of materials by name, i'm not too sure... Maybe someone else can help out here?
When you load a 3ds model you need to apply it's texture manually, like so:
weapon_node->setMaterialTexture( 0, videoDriver->getTexture( "blah.jpg" ) );
That sets the first texture of the weapon mesh to 'blah.jpg'.
As far as I know Irrlicht loads all 3ds types.
I attached a weapon to the camera view. See
http://irrlicht.sourceforge.net/phpBB2/ ... .php?t=347
http://irrlicht.sourceforge.net/phpBB2/ ... .php?t=347
-
Guest
-
aelmetwaly
- Posts: 7
- Joined: Sat Oct 11, 2003 8:20 pm