Page 1 of 1

Model mesh scale issue

Posted: Wed Mar 14, 2012 1:03 am
by armakapo
Hello, this is my first post on the forums, I've been using Irrlicht for a few weeks now. I have a question about a loaded mesh's scale. The thing is simple, I got a few models (b3d) from free sources, but their scale isn't good. For example, when I load a character's mesh and make a node, its height is about 50 units. I'll assume 1 unit = meter so, I have to scale it. There is no problem with that, using setScale(), but the thing is that all the children of that node are affected with that scale. Is there a built-in way to avoid that?
Thanks in advance.

Re: Model mesh scale issue

Posted: Wed Mar 14, 2012 8:06 am
by REDDemon
sure. Make that node a child too of another node so that old children now are brothers and it will no longer have additional nodes as children ;-)

Re: Model mesh scale issue

Posted: Wed Mar 14, 2012 8:55 am
by Mel
Or else, apply the inverse of the scale. If you are scaling the parent node to 1/50, scale the child node by 50 to compensate both scalings. Take into account that this represents no cost in the end, so you can have this setup always.

Re: Model mesh scale issue

Posted: Wed Mar 14, 2012 9:24 am
by CuteAlien
You can also try to use the meshmanipulator to scale the mesh before creating a node for it.

Re: Model mesh scale issue

Posted: Wed Mar 14, 2012 11:51 am
by Mel
That was something i wasn't aware of. All i use the mesh manipulator for is to create meshes with tangent vertices. The mesh manipulator scales the position of the vertices, not the transformation matrix, right?

Re: Model mesh scale issue

Posted: Wed Mar 14, 2012 11:58 am
by hybrid
Yes, it's a fixed in-place transformation. But it will probably not work too good with animated meshes...

Re: Model mesh scale issue

Posted: Wed Mar 14, 2012 1:44 pm
by armakapo
Thanks a lot for your answers! I will try applying the inverse scale to the children. It will work for sure, but I don't think it will fix relative positions too. For example creating a flyCircleAnimator with X radius, and some center, relative to its parent. I'll have to multiply those values for the inverse scale too I guess. May I ask you, in your personal experience, do you have to scale the animated meshes you create? (for example with blender), or the units are 1:1 when you export and load your models?. Just was a bit curious on that, as I never created my own model yet.
Thank again for your help :]