# The Industry's Foundation for High Performance Graphics

#### from games to virtual reality, mobile phones to supercomputers

hi,
i want to render an object a bit smaller,then how can i use glScale()??
for example wanna it be the half,then how can i write with the attribute in this function?

thx for helping

2. ## Re: about glscale() -_-!

Example:

glScale_(x_axis, y_axis, z_axis)

_ = f for float, d for double, i for int

//Draw object
//
glPushMatrix(); // We use this so Scale will not effect next objects, also use with translate and rotate of an object

glTranslatef(x, y, z);
glRotatef(angle, x, y ,z);
glScalef( 1.0, 1.0, 1.0); // 1.0 is no change to scale, 0.5 would be half size, 2.0 would be double.

draw_object();
glPopMatrix(); restore matrix

also look at some openGL tutors like at nehe.gamedev.net

Originally posted by iux:
hi,
i want to render an object a bit smaller,then how can i use glScale()??
for example wanna it be the half,then how can i write with the attribute in this function?

thx for helping

3. ## Re: about glscale() -_-!

thx a lot
you r very friendly

Originally posted by nexusone:
Example:

glScale_(x_axis, y_axis, z_axis)

_ = f for float, d for double, i for int

//Draw object
//
glPushMatrix(); // We use this so Scale will not effect next objects, also use with translate and rotate of an object

glTranslatef(x, y, z);
glRotatef(angle, x, y ,z);
glScalef( 1.0, 1.0, 1.0); // 1.0 is no change to scale, 0.5 would be half size, 2.0 would be double.

draw_object();
glPopMatrix(); restore matrix

also look at some openGL tutors like at nehe.gamedev.net

4. ## Re: about glscale() -_-!

don't forget glEnable(GL_NORMALIZE);
or the normals will be scaled to and you will get strange effect(when using lighting)

5. ## Re: about glscale() -_-!

or thx,
its importent to me

Originally posted by gvm:
don't forget glEnable(GL_NORMALIZE);
or the normals will be scaled to and you will get strange effect(when using lighting)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•