SceneNode relative scale issue?

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
Lax
Hobgoblin
Posts: 583
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 50

SceneNode relative scale issue?

Post by Lax »

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

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62

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

Re: SceneNode relative scale issue?

Post by xrgo »

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
Post Reply