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.
Model mesh scale issue
Re: Model mesh scale issue
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
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Re: Model mesh scale issue
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.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: Model mesh scale issue
You can also try to use the meshmanipulator to scale the mesh before creating a node for it.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Model mesh scale issue
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?
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Model mesh scale issue
Yes, it's a fixed in-place transformation. But it will probably not work too good with animated meshes...
Re: Model mesh scale issue
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 :]
Thank again for your help :]