SceneNode relative scale issue?

Design / architecture / roadmap discussions related to future of Ogre3D (version 2.0 and above)
Post Reply
Lax
Gnome
Posts: 305
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 4

SceneNode relative scale issue?

Post by Lax » Wed May 23, 2018 9:29 pm

Hi,

while implementing some stuff, I tried to use the scene node relative scale function. But the result is, that the model just disappeared.

Code: Select all

sceneNode->scale(relativeAmount)
Whereas the other way doing relative scale:

Code: Select all

sceneNode->setScale(sceneNode->getScale() + relativeAmount);
does work correctly. Is this an Ogre issue?

Best Regards
Lax
0 x

xrgo
OGRE Expert User
OGRE Expert User
Posts: 897
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 49

Re: SceneNode relative scale issue?

Post by xrgo » Thu May 24, 2018 12:52 am

I believe scale() is like translate(), this means that every time you do scale() it will apply that scale to the prev applied scale, in other words:

Code: Select all

myNode->scale(10); //now the scale is 10
myNode->scale(10); //now the scale is 100
myNode->scale(10); //now the scale is 1000
myNode->scale(1); //now the scale is 1000
myNode->scale(0.5); //now the scale is 50
so probably your mesh is getting too big/small very quickly so it disappears

if that's not your case... still the correct analog version for scale() using setScale() should be:

Code: Select all

sceneNode->setScale(sceneNode->getScale() * relativeAmount);
with * not +, so you probably just using wrong values and comparing it with a wrong setScale
0 x

Post Reply