** Reference Pages [#f6ca3f60]

- [[OpenGL 2.1 Reference Pages:http://www.opengl.org/sdk/docs/man2/]]

- [[The OpenGL Utility Toolkit (GLUT) Programming Interface API Version 3:http://www.opengl.org/documentation/specs/glut/spec3/spec3.html]]

** Coordinate System [#w9c93ff5]

*** void glMatrixMode(GLenum mode); [#d91993a7]

- Initial Parameter

GL_MODELVIEW

- Parameters

-- GL_MODELVIEW:

Applies subsequent matrix operations to the modelview matrix stack.

-- GL_PROJECTION: 

Applies subsequent matrix operations to the projection matrix stack.

-- GL_TEXTURE

Applies subsequent matrix operations to the texture matrix stack.

-- GL_COLOR

Applies subsequent matrix operations to the color matrix stack.

- Description

Specifies which matrix stack is the target for subsequent matrix operations. Three values are accepted: GL_MODELVIEW, GL_PROJECTION, and GL_TEXTURE. The initial value is GL_MODELVIEW. Additionally, if the ARB_imaging extension is supported, GL_COLOR is also accepted.~
~
To find out which matrix stack is currently the target of all matrix operations, call glGet with argument GL_MATRIX_MODE. The initial value is GL_MODELVIEW.

*** void glLoadIdentity(); [#b87e789a]

- Description

glLoadIdentity replaces the current matrix with the identity matrix. It is semantically equivalent to calling glLoadMatrix with the identity matrix~
~
1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1~
but in some cases it is more efficient.

*** void gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top); [#sd8cd5bc]

- Parameters

-- left, right

Specify the coordinates for the left and right vertical clipping planes.

-- bottom, top

Specify the coordinates for the bottom and top horizontal clipping planes.

*** void glRasterPos(x, y); [#z6fec9d4]

- Functions

-- glRasterPos2s(GLshort x, GLshort y);

-- glRasterPos2i(GLint x, GLint y);

-- glRasterPos2f(GLfloat x, GLfloat y);

-- glRasterPos2d(GLdouble x, GLdouble y);

-- glRasterPos3s(GLshort x, GLshort y, GLshort z);

-- glRasterPos3i(GLint x, GLint y, GLint z);

-- glRasterPos3f(GLfloat x, GLfloat y, GLfloat z);

-- glRasterPos3d(GLdouble x, GLdouble y, GLdouble z);

-- glRasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w);

-- glRasterPos4i(GLint x, GLint y, GLint z, GLint w);

-- glRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w);

-- glRasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w);

- Parameters

-- x, y, z, w

Specify the x, y, z, and w object coordinates (if present) for the raster position.

** Characters [#v3920d43]

*** void glutBitmapCharacter(void *font, int character); [#s1ced5e9]

- Description

glutBitmapCharacter renders a bitmap character using OpenGL.

- Parameters

-- GLUT_BITMAP_8_BY_13

-- GLUT_BITMAP_9_BY_15

-- GLUT_BITMAP_TIMES_ROMAN_10

-- GLUT_BITMAP_TIMES_ROMAN_24

-- GLUT_BITMAP_HELVETICA_10

-- GLUT_BITMAP_HELVETICA_12

-- GLUT_BITMAP_HELVETICA_18

** Initialization [#u06208ad]

*** void glClear(GLbitfield mask); [#p93b092f]

- Description

glClear sets the bitplane area of the window to values previously selected by glClearColor, glClearIndex, glClearDepth, glClearStencil, and glClearAccum. Multiple color buffers can be cleared simultaneously by selecting more than one buffer at a time using glDrawBuffer.~
~
The pixel ownership test, the scissor test, dithering, and the buffer writemasks affect the operation of glClear. The scissor box bounds the cleared region. Alpha function, blend function, logical operation, stenciling, texture mapping, and depth-buffering are ignored by glClear.~
~
glClear takes a single argument that is the bitwise OR of several values indicating which buffer is to be cleared.

- Parameters

-- GL_COLOR_BUFFER_BIT

Indicates the buffers currently enabled for color writing.

-- GL_DEPTH_BUFFER_BIT

Indicates the depth buffer.

-- GL_ACCUM_BUFFER_BIT

Indicates the accumulation buffer.

-- GL_STENCIL_BUFFER_BIT

Indicates the stencil buffer.

*** void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf appha); [#y2207c0b]

- Description

glClearColor specifies the red, green, blue, and alpha values used by glClear to clear the color buffers. Values specified by glClearColor are clamped to the range 0 1.

- Parameters

-- red, green, blue, alpha

Specify the red, green, blue, and alpha values used when the color buffers are cleared. The initial values are all 0.

** Display Function [#r127733a]

*** void glColor3f(GLfloat red, GLfloat green, GLfloat blue); [#o5a91620]

- Parameters

-- red, green, blue

Specify new red, green, and blue values for the current color.

-- alpha

Specifies a new alpha value for the current color. Included only in the four-argument glColor4 commands.

*** void glBegin(GLenum mode); / void glEnd(); [#f4a97a69]

- Description

glBegin and glEnd delimit the vertices that define a primitive or a group of like primitives. glBegin accepts a single argument that specifies in which of ten ways the vertices are interpreted. Taking n as an integer count starting at one, and N as the total number of vertices specified, the interpretations are as the following parameters.

- Parameters

-- GL_POINTS

Treats each vertex as a single point. Vertex n defines point n. N points are drawn.

-- GL_LINES

Treats each pair of vertices as an independent line segment. Vertices 2 â?¢ n - 1 and 2 â?¢ n define line n. N 2 lines are drawn.

-- GL_LINE_STRIP

Draws a connected group of line segments from the first vertex to the last. Vertices n and n + 1 define line n. N - 1 lines are drawn.

-- GL_LINE_LOOP

Draws a connected group of line segments from the first vertex to the last, then back to the first. Vertices n and n + 1 define line n. The last line, however, is defined by vertices N and 1 . N lines are drawn.

-- GL_TRIANGLES

Treats each triplet of vertices as an independent triangle. Vertices 3 â?¢ n - 2 , 3 â?¢ n - 1 , and 3 â?¢ n define triangle n. N 3 triangles are drawn.

-- GL_TRIANGLE_STRIP

Draws a connected group of triangles. One triangle is defined for each vertex presented after the first two vertices. For odd n, vertices n, n + 1 , and n + 2 define triangle n. For even n, vertices n + 1 , n, and n + 2 define triangle n. N - 2 triangles are drawn.

-- GL_TRIANGLE_FAN

Draws a connected group of triangles. One triangle is defined for each vertex presented after the first two vertices. Vertices 1 , n + 1 , and n + 2 define triangle n. N - 2 triangles are drawn.

-- GL_QUADS

Treats each group of four vertices as an independent quadrilateral. Vertices 4 â?¢ n - 3 , 4 â?¢ n - 2 , 4 â?¢ n - 1 , and 4 â?¢ n define quadrilateral n. N 4 quadrilaterals are drawn.

-- GL_QUAD_STRIP

Draws a connected group of quadrilaterals. One quadrilateral is defined for each pair of vertices presented after the first pair. Vertices 2 â?¢ n - 1 , 2 â?¢ n , 2 â?¢ n + 2 , and 2 â?¢ n + 1 define quadrilateral n. N 2 - 1 quadrilaterals are drawn. Note that the order in which vertices are used to construct a quadrilateral from strip data is different from that used with independent data.

-- GL_POLYGON

Draws a single, convex polygon. Vertices 1 through N define this polygon.

*** void glVertex(); [#x12ea186]

- Functions

-- glVertex2s(GLshort x, GLshort y);

-- glVertex2i(GLint x, GLint y);

-- glVertex2f(GLfloat x, GLfloat y);

-- glVertex2d(GLdouble x, GLdouble y);

-- glVertex3s(GLshort x, GLshort y, GLshort z);

-- glVertex3i(GLint x, GLint y, GLint z);

-- glVertex3f(GLfloat x, GLfloat y, GLfloat z);

-- glVertex3d(GLdouble x, GLdouble y, GLdouble z);

-- glVertex4s(GLshort x, GLshort y, GLshort z, GLshort w);

-- glVertex4i(GLint x, GLint y, GLint z, GLint w);

-- glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w);

-- glVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w);

- Parameters

-- x, y, z, w

Specify x, y, z, and w coordinates of a vertex. Not all parameters are present in all forms of the command.

*** void glRect(); [#s57fc687]

- Description

glRect supports efficient specification of rectangles as two corner points. Each rectangle command takes four arguments, organized either as two consecutive pairs of x y coordinates or as two pointers to arrays, each containing an x y pair. The resulting rectangle is defined in the z = 0 plane.~
~
glRect(x1, y1, x2, y2) is exactly equivalent to the following sequence:~
~
glBegin(GL_POLYGON);~
glVertex2(x1, y1);~
glVertex2(x2, y1);~
glVertex2(x2, y2);~
glVertex2(x1, y2);~
glEnd();~
~   
Note that if the second vertex is above and to the right of the first vertex, the rectangle is constructed with a counterclockwise winding.

- void glRectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);

- Parameters

-- x1, y1

Specify one vertex of a rectangle.

-- x2, y2

Specify the opposite vertex of the rectangle.

- void glRectdv(const GLdouble v1, const GLdouble v2);

- Parameters

-- v1

Specifies a pointer to one vertex of a rectangle.

-- v2

Specifies a pointer to the opposite vertex of the rectangle.


*** void glFlush(); [#sec0449b]

- Description

Different GL implementations buffer commands in several different locations, including network buffers and the graphics accelerator itself. glFlush empties all of these buffers, causing all issued commands to be executed as quickly as they are accepted by the actual rendering engine. Though this execution may not be completed in any particular time period, it does complete in finite time.~
~
Because any GL program might be executed over a network, or on an accelerator that buffers commands, all programs should call glFlush whenever they count on having all of their previously issued commands completed. For example, call glFlush before waiting for user input that depends on the generated image.

*** void glPointSize(GLfloat size); [#v14a5cc5]

- Parameters

-- size

Specifies the diameter of rasterized points. The initial value is 1.


トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS