Scaling issue

Started by kkl, January 09, 2013, 04:14:45 PM

Previous topic - Next topic

kkl

Hi, I wanted to scale object in custom factor x and factor y, but I found only scale(float factor) which I think it is scaling factor x and y equally. Is there any simply function to do factor x and y scaling? or I have to do it from ground up by multiplying the matrix?

Thomas.

This is not so simple. If you use default shader and calculation of normals, lighting will be wrong (because non orthogonal transformation). Maybe will works scale in shader, but I do not test it.

EgonOlsen

Should the new scaling be static or dynamic?

kkl

Both... On one side, I would like to scale a plane from square to rectangle shape. I guess this would be the static one. On the other side, I want to scale 3D object dynamically to create sort of cartoon effect (e.g. ball bouncing effect). How shall I do it?

EgonOlsen

You can tweak the rotation matrix manually. As Thomas has mentioned, this might cause the lighting calculations to become slightly wrong, but in most cases, this shouldn't be an issue. For static scaling, you do it in the same way, then make the change permanent by calling rotateMesh() and clear the rotation matrix afterwards (and call build()).

kkl

I just tried the static scaling... It worked!! But I haven't go through the dynamic scaling yet... Will keep you posted. Thanx ;)