Materials

Elpoet

13-01-2008 20:38:20

Hi! I saw some posts about material, but I do not quite understand.
How do I add a certain material from of my folders to a nxogre character??

must I add something to my CharacterParams? what would that be and where is the link to the .material file

Springare

13-01-2008 21:01:26

I relativly new to this to but if you want to add a certain material to your character you could acces your entity and apply your material.

I don't know if this helps but to apply the same material to the entire model this is one way to do it.

pBody->getEntity()->setMaterialName("CharacterMaterial");

If you want to add different materials to different parts u need to acces the subEntitys.

pBody->getEntity()->getSubEntity(0)->setMaterialName("CharacterHeadMaterial");
pBody->getEntity()->getSubEntity(1)->setMaterialName("CharacterChestMaterial");


Since im new to this there is probly a better way to do this and this might not even be what you meant but hopefully it is of some help to you.

Elpoet

13-01-2008 21:49:34

seems logical to me, but where do I put my .material file?

Springare

13-01-2008 22:51:10

I don't know where u keep your resources. =/

but the simple way should be in
"\media\materials\scripts"

SiWi

14-01-2008 13:31:52

ehmm. You are missunderstanding something. There are two types of materials.
There are ogre materials. You have to set them for an entity. You need .material files for them.
But there are also materials in nxogre. They are there to define, how a actor or body will react if it collides(e.g. bounciness). You don´t need a file for them.

Elpoet

14-01-2008 20:09:21

so if i add a nxcharacter but it doesnt appear. does that mean the material didn't get loaded or somthing?

if so what commando do I use? :)

betajaen

14-01-2008 20:33:55

Characters don't use materials, I mean are you made out of sandpaper or ice?