Models feet touching the floor etc

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
kendric
Posts: 71
Joined: Tue May 29, 2007 9:05 pm

Models feet touching the floor etc

Post by kendric »

Are most models that you load into irrlicht set up so that if you set their position, you are telling where their center goes? Or are you telling where the bottom of their feet or the bottom of the box that the model is for should stand.

One odd behaviour I noticed on a zombie model I found on the net for free, was that if I offset its position by a certain amount, its feet were now on the floor instead of it being in the air, but then when it died, it fell into the floor and you couldn't see it.

Whats the standerd way for deciding what to setPosition on a scene node that comes from a model, or is there no standard.

Thanks.
omar shaaban
Posts: 616
Joined: Wed Nov 01, 2006 6:26 pm
Location: Cairo,Egypt
Contact:

Post by omar shaaban »

setpostion() sets the postion of the node so if the centre of the mesh is at his body and u set the postion(0,0,0)u would see half his body so...if u want to make him stand on the floor just set the centre of the mesh at his feet and that will do it! or tru to mesure the distance between the feet and the floor and set it like(0,19,0);
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Not what he asked by a long shot.
Basically, there are 2 school of thinking.
First one goes with the center of the model in X,Z and lowest point on Y
It's usually the simplest and most useful. But there are some exception, especially in an environment where ground means little. In those case, a central point or NOTICEABLE point in the model is chosen. This is important. If yo always reference to pure center, you risk having your animation reacting weirdly with the physic of your game. Thus, you take for example the bellybutton of a character and choose to call it arbitrarily "center". If you keep this logic with all your models, you'll know that all animations will be AROUND that point. Again, if your project is grounded in anyway, this is more likely not the method you're looking for. But in a puzzle or floating game or space game, that might be perfect (in space, unless an extern force come affect you, all your movement are always around your mass center.)

My best advice is edit that model to correct that bug, if you can't do it and want to keep it, just note somewhere all it's behavior and adapt your code around ;)
kendric
Posts: 71
Joined: Tue May 29, 2007 9:05 pm

Post by kendric »

Ok thanks. I don't know much about model editing but I will see what I can do.
Post Reply