Model mesh scale issue

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.

Model mesh scale issue

Postby armakapo » Wed Mar 14, 2012 1:03 am

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.
armakapo
 
Posts: 10
Joined: Wed Mar 14, 2012 12:54 am

Re: Model mesh scale issue

Postby REDDemon » Wed Mar 14, 2012 8:06 am

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 ;-)
OpenGL is not hard. What you have to do is just explained in specifications. What is hard is dealing with poor OpenGL implementations.
User avatar
REDDemon
 
Posts: 831
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: Model mesh scale issue

Postby Mel » Wed Mar 14, 2012 8:55 am

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.
http://santiagong.daportfolio.com/
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
User avatar
Mel
Competition winner
 
Posts: 1783
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Model mesh scale issue

Postby CuteAlien » Wed Mar 14, 2012 9:24 am

You can also try to use the meshmanipulator to scale the mesh before creating a node for it.
IRC: #irrlicht on irc.freenode.net
My patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Games with Irrlicht: http://www.irrgheist.com/
News: http://www.reddit.com/r/irrlicht/
User avatar
CuteAlien
Admin
 
Posts: 5349
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Re: Model mesh scale issue

Postby Mel » Wed Mar 14, 2012 11:51 am

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?
http://santiagong.daportfolio.com/
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
User avatar
Mel
Competition winner
 
Posts: 1783
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Model mesh scale issue

Postby hybrid » Wed Mar 14, 2012 11:58 am

Yes, it's a fixed in-place transformation. But it will probably not work too good with animated meshes...
hybrid
Admin
 
Posts: 13943
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany

Re: Model mesh scale issue

Postby armakapo » Wed Mar 14, 2012 1:44 pm

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 :]
armakapo
 
Posts: 10
Joined: Wed Mar 14, 2012 12:54 am


Return to Beginners Help

Who is online

Users browsing this forum: No registered users and 1 guest