3D Viewer OpenGL

I copied an OpenGL example out of a VSJ magazine, and it drew and rotated a 3D pyramid.  I then plotted a large 3d person, but could not get it in the view screen because of scale.  How do I change the depth of the object in the view screen?
I used glViewport, glBegin, glVertex, glEnd
LVL 1
MitchBroadheadAsked:
Who is Participating?
 
Erick37Connect With a Mentor Commented:
Two ways:
1) If you are using the LookAt call, modify the eye position to push yourself back from the object:
gluLookAt(0.0, 0.0, 25.0, _' our eye position
    0.0, 0.0, 0.0, _ ' center position
    0.0, 1.0, 0.0)  ' Y is positive going up

2) Use glScale to draw the object smaller:
glPushMatrix
    glScalef(0.5, 0.5, 0.5) 'Draw 50%
    'Do your vertex drawing here
glPopMatrix
0
 
Erick37Commented:
Another thing you can do is set the Field-of-view larger:

gluPerspective(60.0, _ 'Field-Of-View (degrees)
    width / height, _ 'Aspect ratio
    0.01, _ ' z close clipping
    100.0) 'z far clipping
0
 
Erick37Commented:
And finally, you could draw the object further away from the center position using glTranslate.

glPushMatrix
    glTranslatef(0.0, 0.0, -25.0) 'starting at origin 0,0,-25
    'Do your vertex drawing here
glPopMatrix
0
All Courses

From novice to tech pro — start learning today.