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
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
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:
[b]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[/b]
thx a lot
you r very friendly
Originally posted by nexusone:
[b]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
[/b]
don’t forget glEnable(GL_NORMALIZE);
or the normals will be scaled to and you will get strange effect(when using lighting)
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)