.TH glu 3erl "wx 1.8" "" "Erlang Module Definition" .SH NAME glu \- A part of the standard OpenGL Utility api. .SH DESCRIPTION .LP A part of the standard OpenGL Utility api\&. See www\&.opengl\&.org .LP Booleans are represented by integers 0 and 1\&. .SH "DATA TYPES" .RS 2 .TP 2 .B enum() = non_neg_integer(): .RS 2 .LP See wx/include/gl\&.hrl or glu\&.hrl .RE .TP 2 .B matrix() = \fBmatrix12()\fR\& | \fBmatrix16()\fR\&: .TP 2 .B matrix12() = {float(), float(), float(), float(), float(), float(), float(), float(), float(), float(), float(), float()}: .TP 2 .B matrix16() = {float(), float(), float(), float(), float(), float(), float(), float(), float(), float(), float(), float(), float(), float(), float(), float()}: .TP 2 .B mem() = binary() | tuple(): .RS 2 .LP Memory block .RE .TP 2 .B vertex() = {float(), float(), float()}: .RE .SH EXPORTS .LP .B tesselate(Normal, Vs::[Vs]) -> {Triangles, VertexPos} .br .RS .LP Types: .RS 3 Normal = \fBvertex()\fR\& .br Vs = \fBvertex()\fR\& .br Triangles = [integer()] .br VertexPos = binary() .br .RE .RE .RS .LP General purpose polygon triangulation\&. The first argument is the normal and the second a list of vertex positions\&. Returned is a list of indecies of the vertices and a binary (64bit native float) containing an array of vertex positions, it starts with the vertices in Vs and may contain newly created vertices in the end\&. .RE .LP .B build1DMipmapLevels(Target, InternalFormat, Width, Format, Type, Level, Base, Max, Data) -> integer() .br .RS .LP Types: .RS 3 Target = \fBenum()\fR\& .br InternalFormat = integer() .br Width = integer() .br Format = \fBenum()\fR\& .br Type = \fBenum()\fR\& .br Level = integer() .br Base = integer() .br Max = integer() .br Data = binary() .br .RE .RE .RS .LP Builds a subset of one-dimensional mipmap levels .LP \fIglu:build1DMipmapLevels\fR\& builds a subset of prefiltered one-dimensional texture maps of decreasing resolutions called a mipmap\&. This is used for the antialiasing of texture mapped primitives\&. .LP A return value of zero indicates success, otherwise a GLU error code is returned (see \fBglu:errorString/1\fR\& )\&. .LP A series of mipmap levels from \fIBase\fR\& to \fIMax\fR\& is built by decimating \fIData\fR\& in half until size 1×1 is reached\&. At each level, each texel in the halved mipmap level is an average of the corresponding two texels in the larger mipmap level\&. \fBgl:texImage1D/8\fR\& is called to load these mipmap levels from \fIBase\fR\& to \fIMax\fR\& \&. If \fIMax\fR\& is larger than the highest mipmap level for the texture of the specified size, then a GLU error code is returned (see \fBglu:errorString/1\fR\& ) and nothing is loaded\&. .LP For example, if \fILevel\fR\& is 2 and \fIWidth\fR\& is 16, the following levels are possible: 16×1, 8×1, 4×1, 2×1, 1×1\&. These correspond to levels 2 through 6 respectively\&. If \fIBase\fR\& is 3 and \fIMax\fR\& is 5, then only mipmap levels 8×1, 4×1 and 2×1 are loaded\&. However, if \fIMax\fR\& is 7, then an error is returned and nothing is loaded since \fIMax\fR\& is larger than the highest mipmap level which is, in this case, 6\&. .LP The highest mipmap level can be derived from the formula log 2(width×2 level)\&. .LP See the \fBgl:texImage1D/8\fR\& reference page for a description of the acceptable values for \fIType\fR\& parameter\&. See the \fBgl:drawPixels/5\fR\& reference page for a description of the acceptable values for \fILevel\fR\& parameter\&. .LP See external documentation\&. .RE .LP .B build1DMipmaps(Target, InternalFormat, Width, Format, Type, Data) -> integer() .br .RS .LP Types: .RS 3 Target = \fBenum()\fR\& .br InternalFormat = integer() .br Width = integer() .br Format = \fBenum()\fR\& .br Type = \fBenum()\fR\& .br Data = binary() .br .RE .RE .RS .LP Builds a one-dimensional mipmap .LP \fIglu:build1DMipmaps\fR\& builds a series of prefiltered one-dimensional texture maps of decreasing resolutions called a mipmap\&. This is used for the antialiasing of texture mapped primitives\&. .LP A return value of zero indicates success, otherwise a GLU error code is returned (see \fBglu:errorString/1\fR\& )\&. .LP Initially, the \fIWidth\fR\& of \fIData\fR\& is checked to see if it is a power of 2\&. If not, a copy of \fIData\fR\& is scaled up or down to the nearest power of 2\&. (If \fIWidth\fR\& is exactly between powers of 2, then the copy of \fIData\fR\& will scale upwards\&.) This copy will be used for subsequent mipmapping operations described below\&. For example, if \fIWidth\fR\& is 57, then a copy of \fIData\fR\& will scale up to 64 before mipmapping takes place\&. .LP Then, proxy textures (see \fBgl:texImage1D/8\fR\& ) are used to determine if the implementation can fit the requested texture\&. If not, \fIWidth\fR\& is continually halved until it fits\&. .LP Next, a series of mipmap levels is built by decimating a copy of \fIData\fR\& in half until size 1×1 is reached\&. At each level, each texel in the halved mipmap level is an average of the corresponding two texels in the larger mipmap level\&. .LP \fBgl:texImage1D/8\fR\& is called to load each of these mipmap levels\&. Level 0 is a copy of \fIData\fR\& \&. The highest level is (log 2)(width)\&. For example, if \fIWidth\fR\& is 64 and the implementation can store a texture of this size, the following mipmap levels are built: 64×1, 32×1, 16×1, 8×1, 4×1, 2×1, and 1×1\&. These correspond to levels 0 through 6, respectively\&. .LP See the \fBgl:texImage1D/8\fR\& reference page for a description of the acceptable values for the \fIType\fR\& parameter\&. See the \fBgl:drawPixels/5\fR\& reference page for a description of the acceptable values for the \fIData\fR\& parameter\&. .LP See external documentation\&. .RE .LP .B build2DMipmapLevels(Target, InternalFormat, Width, Height, Format, Type, Level, Base, Max, Data) -> integer() .br .RS .LP Types: .RS 3 Target = \fBenum()\fR\& .br InternalFormat = integer() .br Width = integer() .br Height = integer() .br Format = \fBenum()\fR\& .br Type = \fBenum()\fR\& .br Level = integer() .br Base = integer() .br Max = integer() .br Data = binary() .br .RE .RE .RS .LP Builds a subset of two-dimensional mipmap levels .LP \fIglu:build2DMipmapLevels\fR\& builds a subset of prefiltered two-dimensional texture maps of decreasing resolutions called a mipmap\&. This is used for the antialiasing of texture mapped primitives\&. .LP A return value of zero indicates success, otherwise a GLU error code is returned (see \fBglu:errorString/1\fR\& )\&. .LP A series of mipmap levels from \fIBase\fR\& to \fIMax\fR\& is built by decimating \fIData\fR\& in half along both dimensions until size 1×1 is reached\&. At each level, each texel in the halved mipmap level is an average of the corresponding four texels in the larger mipmap level\&. (In the case of rectangular images, the decimation will ultimately reach an N×1 or 1×N configuration\&. Here, two texels are averaged instead\&.) \fBgl:texImage2D/9\fR\& is called to load these mipmap levels from \fIBase\fR\& to \fIMax\fR\& \&. If \fIMax\fR\& is larger than the highest mipmap level for the texture of the specified size, then a GLU error code is returned (see \fBglu:errorString/1\fR\& ) and nothing is loaded\&. .LP For example, if \fILevel\fR\& is 2 and \fIWidth\fR\& is 16 and \fIHeight\fR\& is 8, the following levels are possible: 16×8, 8×4, 4×2, 2×1, 1×1\&. These correspond to levels 2 through 6 respectively\&. If \fIBase\fR\& is 3 and \fIMax\fR\& is 5, then only mipmap levels 8×4, 4×2, and 2×1 are loaded\&. However, if \fIMax\fR\& is 7, then an error is returned and nothing is loaded since \fIMax\fR\& is larger than the highest mipmap level which is, in this case, 6\&. .LP The highest mipmap level can be derived from the formula log 2(max(width height)×2 level)\&. .LP See the \fBgl:texImage1D/8\fR\& reference page for a description of the acceptable values for \fIFormat\fR\& parameter\&. See the \fBgl:drawPixels/5\fR\& reference page for a description of the acceptable values for \fIType\fR\& parameter\&. .LP See external documentation\&. .RE .LP .B build2DMipmaps(Target, InternalFormat, Width, Height, Format, Type, Data) -> integer() .br .RS .LP Types: .RS 3 Target = \fBenum()\fR\& .br InternalFormat = integer() .br Width = integer() .br Height = integer() .br Format = \fBenum()\fR\& .br Type = \fBenum()\fR\& .br Data = binary() .br .RE .RE .RS .LP Builds a two-dimensional mipmap .LP \fIglu:build2DMipmaps\fR\& builds a series of prefiltered two-dimensional texture maps of decreasing resolutions called a mipmap\&. This is used for the antialiasing of texture-mapped primitives\&. .LP A return value of zero indicates success, otherwise a GLU error code is returned (see \fBglu:errorString/1\fR\& )\&. .LP Initially, the \fIWidth\fR\& and \fIHeight\fR\& of \fIData\fR\& are checked to see if they are a power of 2\&. If not, a copy of \fIData\fR\& (not \fIData\fR\& ), is scaled up or down to the nearest power of 2\&. This copy will be used for subsequent mipmapping operations described below\&. (If \fIWidth\fR\& or \fIHeight\fR\& is exactly between powers of 2, then the copy of \fIData\fR\& will scale upwards\&.) For example, if \fIWidth\fR\& is 57 and \fIHeight\fR\& is 23, then a copy of \fIData\fR\& will scale up to 64 in \fIWidth\fR\& and down to 16 in depth, before mipmapping takes place\&. .LP Then, proxy textures (see \fBgl:texImage2D/9\fR\& ) are used to determine if the implementation can fit the requested texture\&. If not, both dimensions are continually halved until it fits\&. (If the OpenGL version is (<= 1\&.0, both maximum texture dimensions are clamped to the value returned by \fBgl:getBooleanv/1\fR\& with the argument \fI?GLU_MAX_TEXTURE_SIZE\fR\& \&.) .LP Next, a series of mipmap levels is built by decimating a copy of \fIData\fR\& in half along both dimensions until size 1×1 is reached\&. At each level, each texel in the halved mipmap level is an average of the corresponding four texels in the larger mipmap level\&. (In the case of rectangular images, the decimation will ultimately reach an N×1 or 1×N configuration\&. Here, two texels are averaged instead\&.) .LP \fBgl:texImage2D/9\fR\& is called to load each of these mipmap levels\&. Level 0 is a copy of \fIData\fR\& \&. The highest level is (log 2)(max(width height))\&. For example, if \fIWidth\fR\& is 64 and \fIHeight\fR\& is 16 and the implementation can store a texture of this size, the following mipmap levels are built: 64×16, 32×8, 16×4, 8×2, 4×1, 2×1, and 1×1 These correspond to levels 0 through 6, respectively\&. .LP See the \fBgl:texImage1D/8\fR\& reference page for a description of the acceptable values for \fIFormat\fR\& parameter\&. See the \fBgl:drawPixels/5\fR\& reference page for a description of the acceptable values for \fIType\fR\& parameter\&. .LP See external documentation\&. .RE .LP .B build3DMipmapLevels(Target, InternalFormat, Width, Height, Depth, Format, Type, Level, Base, Max, Data) -> integer() .br .RS .LP Types: .RS 3 Target = \fBenum()\fR\& .br InternalFormat = integer() .br Width = integer() .br Height = integer() .br Depth = integer() .br Format = \fBenum()\fR\& .br Type = \fBenum()\fR\& .br Level = integer() .br Base = integer() .br Max = integer() .br Data = binary() .br .RE .RE .RS .LP Builds a subset of three-dimensional mipmap levels .LP \fIglu:build3DMipmapLevels\fR\& builds a subset of prefiltered three-dimensional texture maps of decreasing resolutions called a mipmap\&. This is used for the antialiasing of texture mapped primitives\&. .LP A return value of zero indicates success, otherwise a GLU error code is returned (see \fBglu:errorString/1\fR\& )\&. .LP A series of mipmap levels from \fIBase\fR\& to \fIMax\fR\& is built by decimating \fIData\fR\& in half along both dimensions until size 1×1×1 is reached\&. At each level, each texel in the halved mipmap level is an average of the corresponding eight texels in the larger mipmap level\&. (If exactly one of the dimensions is 1, four texels are averaged\&. If exactly two of the dimensions are 1, two texels are averaged\&.) \fBgl:texImage3D/10\fR\& is called to load these mipmap levels from \fIBase\fR\& to \fIMax\fR\& \&. If \fIMax\fR\& is larger than the highest mipmap level for the texture of the specified size, then a GLU error code is returned (see \fBglu:errorString/1\fR\& ) and nothing is loaded\&. .LP For example, if \fILevel\fR\& is 2 and \fIWidth\fR\& is 16, \fIHeight\fR\& is 8 and \fIDepth\fR\& is 4, the following levels are possible: 16×8×4, 8×4×2, 4×2×1, 2×1×1, 1×1×1\&. These correspond to levels 2 through 6 respectively\&. If \fIBase\fR\& is 3 and \fIMax\fR\& is 5, then only mipmap levels 8×4×2, 4×2×1, and 2×1×1 are loaded\&. However, if \fIMax\fR\& is 7, then an error is returned and nothing is loaded, since \fIMax\fR\& is larger than the highest mipmap level which is, in this case, 6\&. .LP The highest mipmap level can be derived from the formula log 2(max(width height depth)×2 level)\&. .LP See the \fBgl:texImage1D/8\fR\& reference page for a description of the acceptable values for \fIFormat\fR\& parameter\&. See the \fBgl:drawPixels/5\fR\& reference page for a description of the acceptable values for \fIType\fR\& parameter\&. .LP See external documentation\&. .RE .LP .B build3DMipmaps(Target, InternalFormat, Width, Height, Depth, Format, Type, Data) -> integer() .br .RS .LP Types: .RS 3 Target = \fBenum()\fR\& .br InternalFormat = integer() .br Width = integer() .br Height = integer() .br Depth = integer() .br Format = \fBenum()\fR\& .br Type = \fBenum()\fR\& .br Data = binary() .br .RE .RE .RS .LP Builds a three-dimensional mipmap .LP \fIglu:build3DMipmaps\fR\& builds a series of prefiltered three-dimensional texture maps of decreasing resolutions called a mipmap\&. This is used for the antialiasing of texture-mapped primitives\&. .LP A return value of zero indicates success, otherwise a GLU error code is returned (see \fBglu:errorString/1\fR\& )\&. .LP Initially, the \fIWidth\fR\& , \fIHeight\fR\& and \fIDepth\fR\& of \fIData\fR\& are checked to see if they are a power of 2\&. If not, a copy of \fIData\fR\& is made and scaled up or down to the nearest power of 2\&. (If \fIWidth\fR\& , \fIHeight\fR\& , or \fIDepth\fR\& is exactly between powers of 2, then the copy of \fIData\fR\& will scale upwards\&.) This copy will be used for subsequent mipmapping operations described below\&. For example, if \fIWidth\fR\& is 57, \fIHeight\fR\& is 23, and \fIDepth\fR\& is 24, then a copy of \fIData\fR\& will scale up to 64 in width, down to 16 in height, and up to 32 in depth before mipmapping takes place\&. .LP Then, proxy textures (see \fBgl:texImage3D/10\fR\& ) are used to determine if the implementation can fit the requested texture\&. If not, all three dimensions are continually halved until it fits\&. .LP Next, a series of mipmap levels is built by decimating a copy of \fIData\fR\& in half along all three dimensions until size 1×1×1 is reached\&. At each level, each texel in the halved mipmap level is an average of the corresponding eight texels in the larger mipmap level\&. (If exactly one of the dimensions is 1, four texels are averaged\&. If exactly two of the dimensions are 1, two texels are averaged\&.) .LP \fBgl:texImage3D/10\fR\& is called to load each of these mipmap levels\&. Level 0 is a copy of \fIData\fR\& \&. The highest level is (log 2)(max(width height depth))\&. For example, if \fIWidth\fR\& is 64, \fIHeight\fR\& is 16, and \fIDepth\fR\& is 32, and the implementation can store a texture of this size, the following mipmap levels are built: 64×16×32, 32×8×16, 16×4×8, 8×2×4, 4×1×2, 2×1×1, and 1×1×1\&. These correspond to levels 0 through 6, respectively\&. .LP See the \fBgl:texImage1D/8\fR\& reference page for a description of the acceptable values for \fIFormat\fR\& parameter\&. See the \fBgl:drawPixels/5\fR\& reference page for a description of the acceptable values for \fIType\fR\& parameter\&. .LP See external documentation\&. .RE .LP .B checkExtension(ExtName, ExtString) -> 0 | 1 .br .RS .LP Types: .RS 3 ExtName = string() .br ExtString = string() .br .RE .RE .RS .LP Determines if an extension name is supported .LP \fIglu:checkExtension\fR\& returns \fI?GLU_TRUE\fR\& if \fIExtName\fR\& is supported otherwise \fI?GLU_FALSE\fR\& is returned\&. .LP This is used to check for the presence for OpenGL, GLU, or GLX extension names by passing the extension strings returned by \fBgl:getString/1\fR\& , \fBglu:getString/1\fR\& , see \fIglXGetClientString\fR\& , see \fIglXQueryExtensionsString\fR\&, or see \fIglXQueryServerString\fR\&, respectively, as \fIExtString\fR\& \&. .LP See external documentation\&. .RE .LP .B cylinder(Quad, Base, Top, Height, Slices, Stacks) -> ok .br .RS .LP Types: .RS 3 Quad = integer() .br Base = float() .br Top = float() .br Height = float() .br Slices = integer() .br Stacks = integer() .br .RE .RE .RS .LP Draw a cylinder .LP \fIglu:cylinder\fR\& draws a cylinder oriented along the \fIz\fR\& axis\&. The base of the cylinder is placed at \fIz\fR\& = 0 and the top at z=height\&. Like a sphere, a cylinder is subdivided around the \fIz\fR\& axis into slices and along the \fIz\fR\& axis into stacks\&. .LP Note that if \fITop\fR\& is set to 0\&.0, this routine generates a cone\&. .LP If the orientation is set to \fI?GLU_OUTSIDE\fR\& (with \fBglu:quadricOrientation/2\fR\& ), then any generated normals point away from the \fIz\fR\& axis\&. Otherwise, they point toward the \fIz\fR\& axis\&. .LP If texturing is turned on (with \fBglu:quadricTexture/2\fR\& ), then texture coordinates are generated so that \fIt\fR\& ranges linearly from 0\&.0 at \fIz\fR\& = 0 to 1\&.0 at \fIz\fR\& = \fIHeight\fR\& , and \fIs\fR\& ranges from 0\&.0 at the +\fIy\fR\& axis, to 0\&.25 at the +\fIx\fR\& axis, to 0\&.5 at the -\fIy\fR\& axis, to 0\&.75 at the -\fIx\fR\& axis, and back to 1\&.0 at the +\fIy\fR\& axis\&. .LP See external documentation\&. .RE .LP .B deleteQuadric(Quad) -> ok .br .RS .LP Types: .RS 3 Quad = integer() .br .RE .RE .RS .LP Destroy a quadrics object .LP \fIglu:deleteQuadric\fR\& destroys the quadrics object (created with \fBglu:newQuadric/0\fR\& ) and frees any memory it uses\&. Once \fIglu:deleteQuadric\fR\& has been called, \fIQuad\fR\& cannot be used again\&. .LP See external documentation\&. .RE .LP .B disk(Quad, Inner, Outer, Slices, Loops) -> ok .br .RS .LP Types: .RS 3 Quad = integer() .br Inner = float() .br Outer = float() .br Slices = integer() .br Loops = integer() .br .RE .RE .RS .LP Draw a disk .LP \fIglu:disk\fR\& renders a disk on the \fIz\fR\& = 0 plane\&. The disk has a radius of \fIOuter\fR\& and contains a concentric circular hole with a radius of \fIInner\fR\& \&. If \fIInner\fR\& is 0, then no hole is generated\&. The disk is subdivided around the \fIz\fR\& axis into slices (like pizza slices) and also about the \fIz\fR\& axis into rings (as specified by \fISlices\fR\& and \fILoops\fR\& , respectively)\&. .LP With respect to orientation, the +\fIz\fR\& side of the disk is considered to be \fIoutside\fR\& (see \fBglu:quadricOrientation/2\fR\& )\&. This means that if the orientation is set to \fI?GLU_OUTSIDE\fR\& , then any normals generated point along the +\fIz\fR\& axis\&. Otherwise, they point along the -\fIz\fR\& axis\&. .LP If texturing has been turned on (with \fBglu:quadricTexture/2\fR\& ), texture coordinates are generated linearly such that where r=outer, the value at (\fIr\fR\&, 0, 0) is (1, 0\&.5), at (0, \fIr\fR\&, 0) it is (0\&.5, 1), at (-\fIr\fR\&, 0, 0) it is (0, 0\&.5), and at (0, -\fIr\fR\&, 0) it is (0\&.5, 0)\&. .LP See external documentation\&. .RE .LP .B errorString(Error) -> string() .br .RS .LP Types: .RS 3 Error = \fBenum()\fR\& .br .RE .RE .RS .LP Produce an error string from a GL or GLU error code .LP \fIglu:errorString\fR\& produces an error string from a GL or GLU error code\&. The string is in ISO Latin 1 format\&. For example, \fIglu:errorString\fR\&(\fI?GLU_OUT_OF_MEMORY\fR\&) returns the string \fIout of memory\fR\&\&. .LP The standard GLU error codes are \fI?GLU_INVALID_ENUM\fR\&, \fI?GLU_INVALID_VALUE\fR\&, and \fI?GLU_OUT_OF_MEMORY\fR\&\&. Certain other GLU functions can return specialized error codes through callbacks\&. See the \fBgl:getError/0\fR\& reference page for the list of GL error codes\&. .LP See external documentation\&. .RE .LP .B getString(Name) -> string() .br .RS .LP Types: .RS 3 Name = \fBenum()\fR\& .br .RE .RE .RS .LP Return a string describing the GLU version or GLU extensions .LP \fIglu:getString\fR\& returns a pointer to a static string describing the GLU version or the GLU extensions that are supported\&. .LP The version number is one of the following forms: .LP \fImajor_number\&.minor_number\fR\&\fImajor_number\&.minor_number\&.release_number\fR\&\&. .LP The version string is of the following form: .LP \fIversion number<space>vendor-specific information\fR\& .LP Vendor-specific information is optional\&. Its format and contents depend on the implementation\&. .LP The standard GLU contains a basic set of features and capabilities\&. If a company or group of companies wish to support other features, these may be included as extensions to the GLU\&. If \fIName\fR\& is \fI?GLU_EXTENSIONS\fR\&, then \fIglu:getString\fR\& returns a space-separated list of names of supported GLU extensions\&. (Extension names never contain spaces\&.) .LP All strings are null-terminated\&. .LP See external documentation\&. .RE .LP .B lookAt(EyeX, EyeY, EyeZ, CenterX, CenterY, CenterZ, UpX, UpY, UpZ) -> ok .br .RS .LP Types: .RS 3 EyeX = float() .br EyeY = float() .br EyeZ = float() .br CenterX = float() .br CenterY = float() .br CenterZ = float() .br UpX = float() .br UpY = float() .br UpZ = float() .br .RE .RE .RS .LP Define a viewing transformation .LP \fIglu:lookAt\fR\& creates a viewing matrix derived from an eye point, a reference point indicating the center of the scene, and an \fIUP\fR\& vector\&. .LP The matrix maps the reference point to the negative \fIz\fR\& 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 \fIUP\fR\& vector projected onto the viewing plane is mapped to the positive \fIy\fR\& axis so that it points upward in the viewport\&. The \fIUP\fR\& vector must not be parallel to the line of sight from the eye point to the reference point\&. .LP Let .LP F=(centerX-eyeX centerY-eyeY centerZ-eyeZ) .LP Let \fIUP\fR\& be the vector (upX upY upZ)\&. .LP Then normalize as follows: f=F/(||F||) .LP UP"=UP/(||UP||) .LP Finally, let s=f×UP", and u=s×f\&. .LP M is then constructed as follows: M=(s[0] s[1] s[2] 0 u[0] u[1] u[2] 0-f[0]-f[1]-f[2] 0 0 0 0 1) .LP and \fIglu:lookAt\fR\& is equivalent to glMultMatrixf(M); glTranslated(-eyex, -eyey, -eyez); .LP See external documentation\&. .RE .LP .B newQuadric() -> integer() .br .RS .LP Create a quadrics object .LP \fIglu:newQuadric\fR\& creates and returns a pointer to a new quadrics object\&. This object must be referred to when calling quadrics rendering and control functions\&. A return value of 0 means that there is not enough memory to allocate the object\&. .LP See external documentation\&. .RE .LP .B ortho2D(Left, Right, Bottom, Top) -> ok .br .RS .LP Types: .RS 3 Left = float() .br Right = float() .br Bottom = float() .br Top = float() .br .RE .RE .RS .LP Define a 2D orthographic projection matrix .LP \fIglu:ortho2D\fR\& sets up a two-dimensional orthographic viewing region\&. This is equivalent to calling \fBgl:ortho/6\fR\& with near=-1 and far=1\&. .LP See external documentation\&. .RE .LP .B partialDisk(Quad, Inner, Outer, Slices, Loops, Start, Sweep) -> ok .br .RS .LP Types: .RS 3 Quad = integer() .br Inner = float() .br Outer = float() .br Slices = integer() .br Loops = integer() .br Start = float() .br Sweep = float() .br .RE .RE .RS .LP Draw an arc of a disk .LP \fIglu:partialDisk\fR\& renders a partial disk on the z=0 plane\&. A partial disk is similar to a full disk, except that only the subset of the disk from \fIStart\fR\& through \fIStart\fR\& + \fISweep\fR\& is included (where 0 degrees is along the +f2yf axis, 90 degrees along the +\fIx\fR\& axis, 180 degrees along the -\fIy\fR\& axis, and 270 degrees along the -\fIx\fR\& axis)\&. .LP The partial disk has a radius of \fIOuter\fR\& and contains a concentric circular hole with a radius of \fIInner\fR\& \&. If \fIInner\fR\& is 0, then no hole is generated\&. The partial disk is subdivided around the \fIz\fR\& axis into slices (like pizza slices) and also about the \fIz\fR\& axis into rings (as specified by \fISlices\fR\& and \fILoops\fR\& , respectively)\&. .LP With respect to orientation, the +\fIz\fR\& side of the partial disk is considered to be outside (see \fBglu:quadricOrientation/2\fR\& )\&. This means that if the orientation is set to \fI?GLU_OUTSIDE\fR\&, then any normals generated point along the +\fIz\fR\& axis\&. Otherwise, they point along the -\fIz\fR\& axis\&. .LP If texturing is turned on (with \fBglu:quadricTexture/2\fR\& ), texture coordinates are generated linearly such that where r=outer, the value at (\fIr\fR\&, 0, 0) is (1\&.0, 0\&.5), at (0, \fIr\fR\&, 0) it is (0\&.5, 1\&.0), at (-\fIr\fR\&, 0, 0) it is (0\&.0, 0\&.5), and at (0, -\fIr\fR\&, 0) it is (0\&.5, 0\&.0)\&. .LP See external documentation\&. .RE .LP .B perspective(Fovy, Aspect, ZNear, ZFar) -> ok .br .RS .LP Types: .RS 3 Fovy = float() .br Aspect = float() .br ZNear = float() .br ZFar = float() .br .RE .RE .RS .LP Set up a perspective projection matrix .LP \fIglu:perspective\fR\& specifies a viewing frustum into the world coordinate system\&. In general, the aspect ratio in \fIglu:perspective\fR\& should match the aspect ratio of the associated viewport\&. For example, aspect=2\&.0 means the viewer\&'s angle of view is twice as wide in \fIx\fR\& as it is in \fIy\fR\&\&. If the viewport is twice as wide as it is tall, it displays the image without distortion\&. .LP The matrix generated by \fIglu:perspective\fR\& is multipled by the current matrix, just as if \fBgl:multMatrixd/1\fR\& were called with the generated matrix\&. To load the perspective matrix onto the current matrix stack instead, precede the call to \fIglu:perspective\fR\& with a call to \fBgl:loadIdentity/0\fR\& \&. .LP Given \fIf\fR\& defined as follows: .LP f=cotangent(fovy/2) The generated matrix is .LP (f/aspect 0 0 0 0 f 0 0 0 0(zFar+zNear)/(zNear-zFar)(2×zFar×zNear)/(zNear-zFar) 0 0 -1 0) .LP See external documentation\&. .RE .LP .B pickMatrix(X, Y, DelX, DelY, Viewport) -> ok .br .RS .LP Types: .RS 3 X = float() .br Y = float() .br DelX = float() .br DelY = float() .br Viewport = {integer(), integer(), integer(), integer()} .br .RE .RE .RS .LP Define a picking region .LP \fIglu:pickMatrix\fR\& creates a projection matrix that can be used to restrict drawing to a small region of the viewport\&. This is typically useful to determine what objects are being drawn near the cursor\&. Use \fIglu:pickMatrix\fR\& to restrict drawing to a small region around the cursor\&. Then, enter selection mode (with \fBgl:renderMode/1\fR\& ) and rerender the scene\&. All primitives that would have been drawn near the cursor are identified and stored in the selection buffer\&. .LP The matrix created by \fIglu:pickMatrix\fR\& is multiplied by the current matrix just as if \fBgl:multMatrixd/1\fR\& is called with the generated matrix\&. To effectively use the generated pick matrix for picking, first call \fBgl:loadIdentity/0\fR\& to load an identity matrix onto the perspective matrix stack\&. Then call \fIglu:pickMatrix\fR\&, and, finally, call a command (such as \fBglu:perspective/4\fR\& ) to multiply the perspective matrix by the pick matrix\&. .LP When using \fIglu:pickMatrix\fR\& to pick NURBS, be careful to turn off the NURBS property \fI?GLU_AUTO_LOAD_MATRIX\fR\&\&. If \fI?GLU_AUTO_LOAD_MATRIX\fR\& is not turned off, then any NURBS surface rendered is subdivided differently with the pick matrix than the way it was subdivided without the pick matrix\&. .LP See external documentation\&. .RE .LP .B project(ObjX, ObjY, ObjZ, Model, Proj, View) -> {integer(), WinX::float(), WinY::float(), WinZ::float()} .br .RS .LP Types: .RS 3 ObjX = float() .br ObjY = float() .br ObjZ = float() .br Model = \fBmatrix()\fR\& .br Proj = \fBmatrix()\fR\& .br View = {integer(), integer(), integer(), integer()} .br .RE .RE .RS .LP Map object coordinates to window coordinates .LP \fIglu:project\fR\& transforms the specified object coordinates into window coordinates using \fIModel\fR\& , \fIProj\fR\& , and \fIView\fR\& \&. The result is stored in \fIWinX\fR\& , \fIWinY\fR\& , and \fIWinZ\fR\& \&. A return value of \fI?GLU_TRUE\fR\& indicates success, a return value of \fI?GLU_FALSE\fR\& indicates failure\&. .LP To compute the coordinates, let v=(objX objY objZ 1\&.0) represented as a matrix with 4 rows and 1 column\&. Then \fIglu:project\fR\& computes v" as follows: .LP v"=P×M×v .LP where P is the current projection matrix \fIProj\fR\& and M is the current modelview matrix \fIModel\fR\& (both represented as 4×4 matrices in column-major order)\&. .LP The window coordinates are then computed as follows: .LP winX=view(0)+view(2)×(v"(0)+1)/2 .LP winY=view(1)+view(3erl)×(v"(1)+1)/2 .LP winZ=(v"(2)+1)/2 .LP See external documentation\&. .RE .LP .B quadricDrawStyle(Quad, Draw) -> ok .br .RS .LP Types: .RS 3 Quad = integer() .br Draw = \fBenum()\fR\& .br .RE .RE .RS .LP Specify the draw style desired for quadrics .LP \fIglu:quadricDrawStyle\fR\& specifies the draw style for quadrics rendered with \fIQuad\fR\& \&. The legal values are as follows: .LP \fI?GLU_FILL\fR\&: Quadrics are rendered with polygon primitives\&. The polygons are drawn in a counterclockwise fashion with respect to their normals (as defined with \fBglu:quadricOrientation/2\fR\& )\&. .LP \fI?GLU_LINE\fR\&: Quadrics are rendered as a set of lines\&. .LP \fI?GLU_SILHOUETTE\fR\&: Quadrics are rendered as a set of lines, except that edges separating coplanar faces will not be drawn\&. .LP \fI?GLU_POINT\fR\&: Quadrics are rendered as a set of points\&. .LP See external documentation\&. .RE .LP .B quadricNormals(Quad, Normal) -> ok .br .RS .LP Types: .RS 3 Quad = integer() .br Normal = \fBenum()\fR\& .br .RE .RE .RS .LP Specify what kind of normals are desired for quadrics .LP \fIglu:quadricNormals\fR\& specifies what kind of normals are desired for quadrics rendered with \fIQuad\fR\& \&. The legal values are as follows: .LP \fI?GLU_NONE\fR\&: No normals are generated\&. .LP \fI?GLU_FLAT\fR\&: One normal is generated for every facet of a quadric\&. .LP \fI?GLU_SMOOTH\fR\&: One normal is generated for every vertex of a quadric\&. This is the initial value\&. .LP See external documentation\&. .RE .LP .B quadricOrientation(Quad, Orientation) -> ok .br .RS .LP Types: .RS 3 Quad = integer() .br Orientation = \fBenum()\fR\& .br .RE .RE .RS .LP Specify inside/outside orientation for quadrics .LP \fIglu:quadricOrientation\fR\& specifies what kind of orientation is desired for quadrics rendered with \fIQuad\fR\& \&. The \fIOrientation\fR\& values are as follows: .LP \fI?GLU_OUTSIDE\fR\&: Quadrics are drawn with normals pointing outward (the initial value)\&. .LP \fI?GLU_INSIDE\fR\&: Quadrics are drawn with normals pointing inward\&. .LP Note that the interpretation of \fIoutward\fR\& and \fIinward\fR\& depends on the quadric being drawn\&. .LP See external documentation\&. .RE .LP .B quadricTexture(Quad, Texture) -> ok .br .RS .LP Types: .RS 3 Quad = integer() .br Texture = 0 | 1 .br .RE .RE .RS .LP Specify if texturing is desired for quadrics .LP \fIglu:quadricTexture\fR\& specifies if texture coordinates should be generated for quadrics rendered with \fIQuad\fR\& \&. If the value of \fITexture\fR\& is \fI?GLU_TRUE\fR\&, then texture coordinates are generated, and if \fITexture\fR\& is \fI?GLU_FALSE\fR\&, they are not\&. The initial value is \fI?GLU_FALSE\fR\&\&. .LP The manner in which texture coordinates are generated depends upon the specific quadric rendered\&. .LP See external documentation\&. .RE .LP .B scaleImage(Format, WIn, HIn, TypeIn, DataIn, WOut, HOut, TypeOut, DataOut) -> integer() .br .RS .LP Types: .RS 3 Format = \fBenum()\fR\& .br WIn = integer() .br HIn = integer() .br TypeIn = \fBenum()\fR\& .br DataIn = binary() .br WOut = integer() .br HOut = integer() .br TypeOut = \fBenum()\fR\& .br DataOut = \fBmem()\fR\& .br .RE .RE .RS .LP Scale an image to an arbitrary size .LP \fIglu:scaleImage\fR\& scales a pixel image using the appropriate pixel store modes to unpack data from the source image and pack data into the destination image\&. .LP When shrinking an image, \fIglu:scaleImage\fR\& uses a box filter to sample the source image and create pixels for the destination image\&. When magnifying an image, the pixels from the source image are linearly interpolated to create the destination image\&. .LP A return value of zero indicates success, otherwise a GLU error code is returned (see \fBglu:errorString/1\fR\& )\&. .LP See the \fBgl:readPixels/7\fR\& reference page for a description of the acceptable values for the \fIFormat\fR\& , \fITypeIn\fR\& , and \fITypeOut\fR\& parameters\&. .LP See external documentation\&. .RE .LP .B sphere(Quad, Radius, Slices, Stacks) -> ok .br .RS .LP Types: .RS 3 Quad = integer() .br Radius = float() .br Slices = integer() .br Stacks = integer() .br .RE .RE .RS .LP Draw a sphere .LP \fIglu:sphere\fR\& draws a sphere of the given radius centered around the origin\&. The sphere is subdivided around the \fIz\fR\& axis into slices and along the \fIz\fR\& axis into stacks (similar to lines of longitude and latitude)\&. .LP If the orientation is set to \fI?GLU_OUTSIDE\fR\& (with \fBglu:quadricOrientation/2\fR\& ), then any normals generated point away from the center of the sphere\&. Otherwise, they point toward the center of the sphere\&. .LP If texturing is turned on (with \fBglu:quadricTexture/2\fR\& ), then texture coordinates are generated so that \fIt\fR\& ranges from 0\&.0 at z=-radius to 1\&.0 at z=radius (\fIt\fR\& increases linearly along longitudinal lines), and \fIs\fR\& ranges from 0\&.0 at the +\fIy\fR\& axis, to 0\&.25 at the +\fIx\fR\& axis, to 0\&.5 at the -\fIy\fR\& axis, to 0\&.75 at the -\fIx\fR\& axis, and back to 1\&.0 at the +\fIy\fR\& axis\&. .LP See external documentation\&. .RE .LP .B unProject(WinX, WinY, WinZ, Model, Proj, View) -> {integer(), ObjX::float(), ObjY::float(), ObjZ::float()} .br .RS .LP Types: .RS 3 WinX = float() .br WinY = float() .br WinZ = float() .br Model = \fBmatrix()\fR\& .br Proj = \fBmatrix()\fR\& .br View = {integer(), integer(), integer(), integer()} .br .RE .RE .RS .LP Map window coordinates to object coordinates .LP \fIglu:unProject\fR\& maps the specified window coordinates into object coordinates using \fIModel\fR\& , \fIProj\fR\& , and \fIView\fR\& \&. The result is stored in \fIObjX\fR\& , \fIObjY\fR\& , and \fIObjZ\fR\& \&. A return value of \fI?GLU_TRUE\fR\& indicates success; a return value of \fI?GLU_FALSE\fR\& indicates failure\&. .LP To compute the coordinates (objX objY objZ), \fIglu:unProject\fR\& multiplies the normalized device coordinates by the inverse of \fIModel\fR\& * \fIProj\fR\& as follows: .LP (objX objY objZ W)=INV(P M) ((2(winX-view[0]))/(view[2])-1(2(winY-view[1]))/(view[3])-1 2(winZ)-1 1) INV denotes matrix inversion\&. W is an unused variable, included for consistent matrix notation\&. .LP See external documentation\&. .RE .LP .B unProject4(WinX, WinY, WinZ, ClipW, Model, Proj, View, NearVal, FarVal) -> {integer(), ObjX::float(), ObjY::float(), ObjZ::float(), ObjW::float()} .br .RS .LP Types: .RS 3 WinX = float() .br WinY = float() .br WinZ = float() .br ClipW = float() .br Model = \fBmatrix()\fR\& .br Proj = \fBmatrix()\fR\& .br View = {integer(), integer(), integer(), integer()} .br NearVal = float() .br FarVal = float() .br .RE .RE .RS .LP See \fBunProject/6\fR\& .RE .SH AUTHORS .LP .I <>