[ Previous | Next | Contents | Glossary | Home | Search ]
GL3.2 for AIX: Graphics Library (GL) Technical Reference

v Subroutine

Purpose

Transfers a 2-D, 3-D, or 4-D vertex to the graphics pipe.

Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

void v2s(Int16 vector[2])
                          void v2f(Float32 vector[2])
void v2i(Int32 vector[2])
                          void v2d(Float64 vector[2])
void v3s(Int16 vector[3])
                          void v3f(Float32 vector[3])
void v3i(Int32 vector[3])
                          void v3d(Float64 vector[3])
void v4s(Int16 vector[4])
                          void v4f(Float32 vector[4])
void v4i(Int32 vector[4])
                          void v4d(Float64 vector[4])

FORTRAN Syntax

SUBROUTINE V2S(vector)
INTEGER*2 vector(2)
SUBROUTINE V2I(vector)
INTEGER*4 vector(2)
SUBROUTINE V2F(vector)
REAL vector(2)
SUBROUTINE V2D(vector)
REAL*8 vector(2)
SUBROUTINE V3S(vector)
INTEGER*2 vector(3)
SUBROUTINE V3I(vector)
INTEGER*4 vector(3)
SUBROUTINE V3F(vector)
REAL vector(3)
SUBROUTINE V3D(vector)
REAL*8 vector(3)
SUBROUTINE V4S(vector)
INTEGER*2 vector(4)
SUBROUTINE V4I(vector)
INTEGER*4 vector(4)
SUBROUTINE V4F(vector)
REAL vector(4)
SUBROUTINE V4D(vector)
DOUBLE vector(4)

Description

The v subroutine transfers a single 2-D (v2), 3-D (v3), or 4-D (v4) vertex to the graphics pipeline. The coordinates are passed to v as an array. Separate subroutines are provided for 16-bit integers (s), 32-bit integers limited to a signed 24-bit range (i), 32-bit IEEE single precision floats (f), and 64-bit IEEE double precision floats (d). The z coordinate defaults to 0.0 if not specified. The w coordinate defaults to 1.0.

The Graphics Library subroutines bgnpoint, endpoint, bgnline, endline, bgnclosedline, endclosedline, bgnpolygon, endpolygon, bgntmesh, and endtmesh determine how the vertex is interpreted. For example, vertices specified between the bgnpoint and endpoint subroutines draw single pixels (points) on the screen. Likewise, those specified between the bgnline and endline subroutines draw a sequence of lines (with the line stipple continued through internal vertices). Closed lines return to the first vertex specified, producing the equivalent of an outlined polygon.

Vertices specified when none of the bgnpoint, bgnline, bgnclosedline, bgnpolygon, and bgntmesh subroutines are active set the current graphics position. They do not have any effect on the frame buffer contents. The endpoint, endline, endclosedline, endpolygon, and endtmesh subroutines have varied effects on the current graphics position.

Parameters

vector Specifies 2-, 3-, or 4-element array, depending on whether you call the v2, v3, or v4 version of the routine. The elements of the array are the coordinates of the vertex (point) to transfer to the graphics pipe. Put the x coordinate in element 0, the y coordinate in element 1, the z coordinate in element 2 (for v3 and v4), and the w coordinate in element 3 (for v4).

The nine different forms for the v subroutine are as follows:


2-D 3-D 4-D
Int16 v2s v3s v4s
Int32 v2i v3i v4i
Float32 v2f v3f v4f
Float64 v2d v3d v4d

The syntax for each of the subroutine forms is the same except for the first argument. They differ only in that vi expects long integer coordinates, vs expects short integer coordinates, vf expects single-precision floating point coordinates, and vd expects double-precision floating point coordinates. In addition, the v2* routines assume a 2-D point, the v3* routines assume a 3-D point, and the v4* routines assume a 4-D point (in homogeneous coordinates.

Example

The example C language program cylinder2.c calls the v3f subroutine between the bgnpolygon subroutine and the endpolygon subroutine to specify the vertices of a polygon.

Implementation Specifics

This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.

Files

/usr/include/gl/gl.h Contains C language constant and variable type definitions for GL.
/usr/include/gl/fgl.h Contains FORTRAN constant and variable type definitions for GL.

Related Information

Drawing closed line vertices with the bgnclosedline subroutine.

Drawing vertex-based lines with the bgnline subroutine.

Drawing vertex-based points with the bgnpoint subroutine.

Drawing vertex-based polygons with the bgnpolygon subroutine.

Drawing triangle mesh vertices with the bgntmesh subroutine.

Ending a series of closed line vertices with the endclosedline subroutine.

Ending a series of vertex-based lines with the endline subroutine.

Ending a series of vertex-based points with the endpoint subroutine.

Ending a vertex-based polygon with the endpolygon subroutine.

Ending a series of triangle mesh vertices with the endtmesh subroutine.

AIX Graphics Library Overview, Drawing with Begin-End Style Subroutines, and Understanding the Hardware Used by GL in GL3.2 Version 4 for AIX: Programming Concepts.


[ Previous | Next | Contents | Glossary | Home | Search ]