Resizing objects within code
Resizing objects within code
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.
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: Resizing objects within code
Thanks a lot.
Re: Resizing objects within code
You can just do node->setScale(...); as well.
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: Resizing objects within code
This scales the node, not the meshmongoose7 wrote:You can just do node->setScale(...); as well.
He specifically asked to scale the mesh, so in that case you need the mesh manipulator
Re: Resizing objects within code
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.
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: Resizing objects within code
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 itmongoose7 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.
In this situation it's easier to scale your mesh instead of scaling each node to get a correct size
Re: Resizing objects within code
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.