PDA

View Full Version : scaling one object



mikemor
09-27-2002, 01:26 PM
I have a scene with several lights,walls,floors, etc and several objects. I would like to scale just one of the objects (which is made of several pieces) uniformly along the 3 axes, but without affecting any of the remaining objects in the scene and without changing the position where the object is located
Where should I put the glscalef instruction? Do I need to push and pop before appliying it?

Thanks

zeckensack
09-27-2002, 01:32 PM
This should do:

draw scene

glPushMatrix();
glTranslatef(object_x,y,z);
glScalef(x_scale,y_scale,z_scale);

draw object

glPopMatrix();

Works best if your object is centered around (0;0;0).

mikemor
09-28-2002, 05:50 AM
Thanks!!
That does it.