Scale question

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
powerpop
Posts: 171
Joined: Thu Jan 08, 2004 1:39 am
Location: san francisco

Scale question

Post by powerpop »

hi - how does scale work - is it a percentage or an absolute value - for instance if i have a 64x64x64 cube and want to make it 512x512x512 do i make the scale call as:

node->setScale(core::vector3df(4.0,4.0,4.0));

or

node->setScale(core::vector3df(512.0,512.0,512.0));

if its the first option i hope there is a way to get the exact bounding box of the object so i can calculate how to get from 64 to 512 - i had this problem in Ogre where they pad the bounding box for every object so there is no way to get a somewhat accurate size estimate on a model ...
DarkWhoppy
Posts: 386
Joined: Thu Sep 25, 2003 12:43 pm
Contact:

Post by DarkWhoppy »

I think its percentage... like node->scale(vector3df(2.0,2.0,2.0)); will scale a mess to twice its normal size.
Programmer of the Irrlicht Scene Editor:
Homepage - Forum Thread
Version 2 on its way!!
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Post by Boogle »

Yes it is percentage. And to get exact scaling do something like:

Code: Select all

node->setScale(irr::core::vector3df(512.0f/64.0f,512.0f/64.0f,512.0f/64.0f));
In the case of 512 and 64, this is just 8.0f (64*8=512). For other numbers, it may work out to a non-round number and this method will always give as-close-to exact as you can get.
Post Reply