Some questions!

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
aelmetwaly
Posts: 7
Joined: Sat Oct 11, 2003 8:20 pm

Some questions!

Post by aelmetwaly »

=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?
sirshane

Post by 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.
Saalen
Posts: 51
Joined: Thu Sep 04, 2003 7:49 am
Location: Germany
Contact:

Post by Saalen »

I attached a weapon to the camera view. See
http://irrlicht.sourceforge.net/phpBB2/ ... .php?t=347
Guest

Post by Guest »

if the texture file which you are applying on a mesh is in the same directory of the mesh file, it will have texture automatically. If there is some change in the directory structure it seems to be not working.
Saalen
Posts: 51
Joined: Thu Sep 04, 2003 7:49 am
Location: Germany
Contact:

Post by Saalen »

Which type of mesh do you use?
aelmetwaly
Posts: 7
Joined: Sat Oct 11, 2003 8:20 pm

Post by aelmetwaly »

quake 3 level meshs load its textures automatically but 3ds don't.
and the texture files in the same directroy as the mesh file. but it won't work!
Post Reply