Sunteți pe pagina 1din 3

Commands of Open GL

GlLoadIdentity():
glLoadIdentity() replaces the current matrix with the identity matrix.
glTranslate and glRotate are always relative to the matrix's current state. So for
instance, if you call glTranslate, you are translating from the matrix's current
'position', not from the origin. But if you want to start over at the origin, that's
when you call glLoadIdentity(), and then you can glTranslate from the matrix which
is now located at the origin, or glRotate from the matrix which is now oriented in
the default direction.

glutWireCube():
Parameters:
width The width, height and depth of the cube.

glutSolidCube and glutWireCube render a solid or wireframe cube respectively. The


cube is centered at the modeling coordinates origin with sides of length size.

The glutWireCube() function draws an axis-aligned wireframe cube with a specified width, height and
depth. The vertices of the cube are at (+/- width/2, +/- width/2, +/- width/2), so that the cube is centered
at the origin.

void glutWireCube(GLdouble size);

glutSolidSphere():

Parameters:
radius Sphere radius.
slices The number of divisions around the z axis. (latitudal)
stacks The number of divisions along the z axis. (longitudal)

The glutSolidSphere() function draws a shaded sphere centered at the origin. The
surface is created from quadrangles (except for triangles as degenerate quads at
the poles) in a longitude/latitude pattern. The equatorial great circle lies in the xy-
plane and is centered on the origin.

gluLLookAt():

gluLookAt define a viewing transformation


void gluLookAt(GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble cent
erY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);

Parameters:
eyeX, eyeY, eyeZ

Specifies the position of the eye point.

centerX, centerY, centerZ

Specifies the position of the reference point.

upX, upY, upZ

Specifies the direction of the up vector.

gluLookAt creates a viewing matrix derived from an eye point, a reference point
indicating the center of the scene, and an UP vector.

The matrix maps the reference point to the negative z axis and the eye point to
the origin. When a typical projection matrix is used, the center of the scene
therefore maps to the center of the viewport. Similarly, the direction described by
the UP vector projected onto the viewing plane is mapped to the positive y axis so
that it points upward in the viewport. The UP vector must not be parallel to the line
of sight from the eye point to the reference point.

glutWireSphere():

void ( GLdouble
radius,
glutWireSphere
GLint slices,
GLint stacks
)

Void glutWireSphere(GLdouble radius, Glint slices, Glint stacks)

Draw a wireframe sphere centered at the origin.

Parameters:
radius Sphere radius.
slices The number of divisions around the z axis. (latitudal)
stacks The number of divisions along the z axis. (longitudal)

The glutWireSphere() function draws a wireframe sphere centered at the origin.


The "equatorial" great circle lies in the xy-plane.
Note:
The number of line segments representing the spherical surface is
proportional to (slices*stacks).

glutWireTeapot():

glutWireTeapot(GLdouble size)

Draw a wireframe teapot.

Parameters:
size Scale factor.
This function draws the standard Teapot in wireframe using OpenGL evaluators.
This is the classic "Utah Teapot" of computer graphics. The base should lie in the
xy-plane with "up" being along the positive z axis.

S-ar putea să vă placă și