Resizing objects within code

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
brick
Posts: 36
Joined: Sun Jul 10, 2011 12:15 pm

Resizing objects within code

Post by brick »

I was wondering if there was any way to resize an imported mesh inside irrlicht code, e.g. if an object that I have imported was modeled too big and I would like to change its dimensions. Perhaps there is an answer to this in the tutorials, but I haven't found it.
brick
Posts: 36
Joined: Sun Jul 10, 2011 12:15 pm

Re: Resizing objects within code

Post by brick »

Thanks a lot.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Resizing objects within code

Post by mongoose7 »

You can just do node->setScale(...); as well.
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Re: Resizing objects within code

Post by Radikalizm »

mongoose7 wrote:You can just do node->setScale(...); as well.
This scales the node, not the mesh ;)
He specifically asked to scale the mesh, so in that case you need the mesh manipulator
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Resizing objects within code

Post by mongoose7 »

True, but it wasn't clear to me whether he wanted to resize the mesh or just show the object smaller. Also, I can't think of a reason why one would want to resize a mesh. I suppose you could build a large mesh out of smaller ones, but I don't think anyone does this. Well, there is MindCraft, but it uses internally generated objects.
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Re: Resizing objects within code

Post by Radikalizm »

mongoose7 wrote:True, but it wasn't clear to me whether he wanted to resize the mesh or just show the object smaller. Also, I can't think of a reason why one would want to resize a mesh. I suppose you could build a large mesh out of smaller ones, but I don't think anyone does this. Well, there is MindCraft, but it uses internally generated objects.
Say you have a mesh which has to be used by multiple nodes, and this mesh is somewhat too big (and for some reason you can't/won't edit it to make it smaller) and you want to scale it
In this situation it's easier to scale your mesh instead of scaling each node to get a correct size
brick
Posts: 36
Joined: Sun Jul 10, 2011 12:15 pm

Re: Resizing objects within code

Post by brick »

Yeah, I was perhaps inaccurate in my original post. I didn't care what I was working with, I just wanted to make the object appear smaller on the scene. node->setScale() also does the job perfectly.
Post Reply