Graphics Reference
In-Depth Information
Box dx dy dz
Create a 3D box. If specified, (
dx
,
dy
,
dz
) are the lengths of
the sides. [2. 2. 2.]
Create a solid cylinder. [1. 1.]
Cylinder radius
height
Cone radius height
Create a solid cone. [1. 1.]
Create a unit disk parallel to the
XY
plane and passing
through
Z
= 0.
DiskXY
LinesAdjacency [v0]
[v1] [v2] [v3]
Create an instance of the OpenGL geometry shader
GL_LINES_ADJACENCY
primitive. This only works with
geometry shaders. Each vertex consists of an
x
,
y
, and
z
,
given in square brackets. So, for instance, [
v0
] might be:
[1. 2. 3.]
glBegin topology
glVertex x y z
…
glEnd
Specify the vertices for different OpenGL tropologies,
including LinesAdjacency, TrianglesAdjacency, and the
new
GL_PATCHES
topology, discussed in Chapter 13.
Set the width of individual lines to
N
pixels.
Linewidth N
Create a 3D point cloud, a regular point grid in three
dimensions. The parameters
num*
are the number of points
to use in each direction.
PointCloud numx
numy numz
Create a 3D point cloud as above, with the position of each
point jitered (moved randomly) from its regular position.
JitterCloud numx
numy numz
Define the size of points in your scene.
Pointsize size
QuadBox numquads
Create a series of
numquads
(quadrilaterals parallel to the
XY
plane). The
XYZ
coordinates run from (-1.,-1.,-1.) to
(1.,1.,1.). The 3D texture coordinates run from (0.,0.,0.) to
(1.,1.,1.). This is a good way to test 3D textures. [10]
QuadXY z size nx ny
Create a quadrilateral parallel to the
XY
plane, passing
through
Z
=
z
. If given,
size
is the quadrilateral's dimen-
sion, going from (
-size
,
-size
) to (
size
,
size
) in
X
and
Y
. If given,
nx
and
ny
are the number of sub-quads this
quadrilateral is broken into. This is a good way to test 2D
textures. [0 1 4 4]
QuadXZ y size nx nz
Creates a quadrilateral parallel to the
XZ
plane, passing
through
Y
=
y
. If given,
size
is the quadrilateral's dimen-
sion, going from (
-size
,
-size
) to (
size
,
size
) in
X
and
Z
.
If given,
nx
and
nz
are the number of sub-quads this quad-
rilateral is broken into. [0 1 4 4]