Provided by: erlang-manpages_16.b.3-dfsg-1ubuntu2_all

**NAME**

glu - A part of the standard OpenGL Utility api.

**DESCRIPTION**

A part of the standard OpenGL Utility api. See www.opengl.org Booleans are represented by integers 0 and 1.

**DATA** **TYPES**

enum()=non_neg_integer(): See wx/include/gl.hrl or glu.hrlmatrix()={float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}:mem()=binary()|tuple(): Memory blockvertex()={float(),float(),float()}:

**EXPORTS**

tesselate(Normal,Vs::[Vs])->{Triangles,VertexPos}Types: Normal = vertex() Vs = vertex() Triangles = [integer()] VertexPos = binary() 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.build1DMipmapLevels(Target,InternalFormat,Width,Format,Type,Level,Base,Max,Data)->integer()Types: Target = enum() InternalFormat = integer() Width = integer() Format = enum() Type = enum() Level = integer() Base = integer() Max = integer() Data = binary() Builds a subset of one-dimensional mipmap levelsglu:build1DMipmapLevelsbuilds a subset of prefiltered one-dimensional texture maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture mapped primitives. A return value of zero indicates success, otherwise a GLU error code is returned (seeglu:errorString/1). A series of mipmap levels fromBasetoMaxis built by decimatingDatain 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.gl:texImage1D/8is called to load these mipmap levels fromBasetoMax. IfMaxis larger than the highest mipmap level for the texture of the specified size, then a GLU error code is returned (seeglu:errorString/1) and nothing is loaded. For example, ifLevelis 2 andWidthis 16, the following levels are possible: 16×1, 8×1, 4×1, 2×1, 1×1. These correspond to levels 2 through 6 respectively. IfBaseis 3 andMaxis 5, then only mipmap levels 8×1, 4×1 and 2×1 are loaded. However, ifMaxis 7, then an error is returned and nothing is loaded sinceMaxis larger than the highest mipmap level which is, in this case, 6. The highest mipmap level can be derived from the formula log 2(width×2 level). See thegl:texImage1D/8reference page for a description of the acceptable values forTypeparameter. See thegl:drawPixels/5reference page for a description of the acceptable values forLevelparameter. See external documentation.build1DMipmaps(Target,InternalFormat,Width,Format,Type,Data)->integer()Types: Target = enum() InternalFormat = integer() Width = integer() Format = enum() Type = enum() Data = binary() Builds a one-dimensional mipmapglu:build1DMipmapsbuilds a series of prefiltered one-dimensional texture maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture mapped primitives. A return value of zero indicates success, otherwise a GLU error code is returned (seeglu:errorString/1). Initially, theWidthofDatais checked to see if it is a power of 2. If not, a copy ofDatais scaled up or down to the nearest power of 2. (IfWidthis exactly between powers of 2, then the copy ofDatawill scale upwards.) This copy will be used for subsequent mipmapping operations described below. For example, ifWidthis 57, then a copy ofDatawill scale up to 64 before mipmapping takes place. Then, proxy textures (seegl:texImage1D/8) are used to determine if the implementation can fit the requested texture. If not,Widthis continually halved until it fits. Next, a series of mipmap levels is built by decimating a copy ofDatain 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.gl:texImage1D/8is called to load each of these mipmap levels. Level 0 is a copy ofData. The highest level is (log 2)(width). For example, ifWidthis 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. See thegl:texImage1D/8reference page for a description of the acceptable values for theTypeparameter. See thegl:drawPixels/5reference page for a description of the acceptable values for theDataparameter. See external documentation.build2DMipmapLevels(Target,InternalFormat,Width,Height,Format,Type,Level,Base,Max,Data)->integer()Types: Target = enum() InternalFormat = integer() Width = integer() Height = integer() Format = enum() Type = enum() Level = integer() Base = integer() Max = integer() Data = binary() Builds a subset of two-dimensional mipmap levelsglu:build2DMipmapLevelsbuilds a subset of prefiltered two-dimensional texture maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture mapped primitives. A return value of zero indicates success, otherwise a GLU error code is returned (seeglu:errorString/1). A series of mipmap levels fromBasetoMaxis built by decimatingDatain 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.)gl:texImage2D/9is called to load these mipmap levels fromBasetoMax. IfMaxis larger than the highest mipmap level for the texture of the specified size, then a GLU error code is returned (seeglu:errorString/1) and nothing is loaded. For example, ifLevelis 2 andWidthis 16 andHeightis 8, the following levels are possible: 16×8, 8×4, 4×2, 2×1, 1×1. These correspond to levels 2 through 6 respectively. IfBaseis 3 andMaxis 5, then only mipmap levels 8×4, 4×2, and 2×1 are loaded. However, ifMaxis 7, then an error is returned and nothing is loaded sinceMaxis larger than the highest mipmap level which is, in this case, 6. The highest mipmap level can be derived from the formula log 2(max(width height)×2 level). See thegl:texImage1D/8reference page for a description of the acceptable values forFormatparameter. See thegl:drawPixels/5reference page for a description of the acceptable values forTypeparameter. See external documentation.build2DMipmaps(Target,InternalFormat,Width,Height,Format,Type,Data)->integer()Types: Target = enum() InternalFormat = integer() Width = integer() Height = integer() Format = enum() Type = enum() Data = binary() Builds a two-dimensional mipmapglu:build2DMipmapsbuilds a series of prefiltered two-dimensional texture maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture-mapped primitives. A return value of zero indicates success, otherwise a GLU error code is returned (seeglu:errorString/1). Initially, theWidthandHeightofDataare checked to see if they are a power of 2. If not, a copy ofData(notData), is scaled up or down to the nearest power of 2. This copy will be used for subsequent mipmapping operations described below. (IfWidthorHeightis exactly between powers of 2, then the copy ofDatawill scale upwards.) For example, ifWidthis 57 andHeightis 23, then a copy ofDatawill scale up to 64 inWidthand down to 16 in depth, before mipmapping takes place. Then, proxy textures (seegl:texImage2D/9) 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 bygl:getBooleanv/1with the argument?GLU_MAX_TEXTURE_SIZE.) Next, a series of mipmap levels is built by decimating a copy ofDatain 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.)gl:texImage2D/9is called to load each of these mipmap levels. Level 0 is a copy ofData. The highest level is (log 2)(max(width height)). For example, ifWidthis 64 andHeightis 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. See thegl:texImage1D/8reference page for a description of the acceptable values forFormatparameter. See thegl:drawPixels/5reference page for a description of the acceptable values forTypeparameter. See external documentation.build3DMipmapLevels(Target,InternalFormat,Width,Height,Depth,Format,Type,Level,Base,Max,Data)->integer()Types: Target = enum() InternalFormat = integer() Width = integer() Height = integer() Depth = integer() Format = enum() Type = enum() Level = integer() Base = integer() Max = integer() Data = binary() Builds a subset of three-dimensional mipmap levelsglu:build3DMipmapLevelsbuilds a subset of prefiltered three-dimensional texture maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture mapped primitives. A return value of zero indicates success, otherwise a GLU error code is returned (seeglu:errorString/1). A series of mipmap levels fromBasetoMaxis built by decimatingDatain 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.)gl:texImage3D/10is called to load these mipmap levels fromBasetoMax. IfMaxis larger than the highest mipmap level for the texture of the specified size, then a GLU error code is returned (seeglu:errorString/1) and nothing is loaded. For example, ifLevelis 2 andWidthis 16,Heightis 8 andDepthis 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. IfBaseis 3 andMaxis 5, then only mipmap levels 8×4×2, 4×2×1, and 2×1×1 are loaded. However, ifMaxis 7, then an error is returned and nothing is loaded, sinceMaxis larger than the highest mipmap level which is, in this case, 6. The highest mipmap level can be derived from the formula log 2(max(width height depth)×2 level). See thegl:texImage1D/8reference page for a description of the acceptable values forFormatparameter. See thegl:drawPixels/5reference page for a description of the acceptable values forTypeparameter. See external documentation.build3DMipmaps(Target,InternalFormat,Width,Height,Depth,Format,Type,Data)->integer()Types: Target = enum() InternalFormat = integer() Width = integer() Height = integer() Depth = integer() Format = enum() Type = enum() Data = binary() Builds a three-dimensional mipmapglu:build3DMipmapsbuilds a series of prefiltered three-dimensional texture maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture-mapped primitives. A return value of zero indicates success, otherwise a GLU error code is returned (seeglu:errorString/1). Initially, theWidth,HeightandDepthofDataare checked to see if they are a power of 2. If not, a copy ofDatais made and scaled up or down to the nearest power of 2. (IfWidth,Height, orDepthis exactly between powers of 2, then the copy ofDatawill scale upwards.) This copy will be used for subsequent mipmapping operations described below. For example, ifWidthis 57,Heightis 23, andDepthis 24, then a copy ofDatawill scale up to 64 in width, down to 16 in height, and up to 32 in depth before mipmapping takes place. Then, proxy textures (seegl:texImage3D/10) are used to determine if the implementation can fit the requested texture. If not, all three dimensions are continually halved until it fits. Next, a series of mipmap levels is built by decimating a copy ofDatain 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.)gl:texImage3D/10is called to load each of these mipmap levels. Level 0 is a copy ofData. The highest level is (log 2)(max(width height depth)). For example, ifWidthis 64,Heightis 16, andDepthis 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. See thegl:texImage1D/8reference page for a description of the acceptable values forFormatparameter. See thegl:drawPixels/5reference page for a description of the acceptable values forTypeparameter. See external documentation.checkExtension(ExtName,ExtString)->0|1Types: ExtName = string() ExtString = string() Determines if an extension name is supportedglu:checkExtensionreturns?GLU_TRUEifExtNameis supported otherwise?GLU_FALSEis returned. This is used to check for the presence for OpenGL, GLU, or GLX extension names by passing the extension strings returned bygl:getString/1,glu:getString/1, seeglXGetClientString, seeglXQueryExtensionsString, or seeglXQueryServerString, respectively, asExtString. See external documentation.cylinder(Quad,Base,Top,Height,Slices,Stacks)->okTypes: Quad = integer() Base = float() Top = float() Height = float() Slices = integer() Stacks = integer() Draw a cylinderglu:cylinderdraws a cylinder oriented along thezaxis. The base of the cylinder is placed atz= 0 and the top at z=height. Like a sphere, a cylinder is subdivided around thezaxis into slices and along thezaxis into stacks. Note that ifTopis set to 0.0, this routine generates a cone. If the orientation is set to?GLU_OUTSIDE(withglu:quadricOrientation/2), then any generated normals point away from thezaxis. Otherwise, they point toward thezaxis. If texturing is turned on (withglu:quadricTexture/2), then texture coordinates are generated so thattranges linearly from 0.0 atz= 0 to 1.0 atz=Height, andsranges from 0.0 at the +yaxis, to 0.25 at the +xaxis, to 0.5 at the -yaxis, to 0.75 at the -xaxis, and back to 1.0 at the +yaxis. See external documentation.deleteQuadric(Quad)->okTypes: Quad = integer() Destroy a quadrics objectglu:deleteQuadricdestroys the quadrics object (created withglu:newQuadric/0) and frees any memory it uses. Onceglu:deleteQuadrichas been called,Quadcannot be used again. See external documentation.disk(Quad,Inner,Outer,Slices,Loops)->okTypes: Quad = integer() Inner = float() Outer = float() Slices = integer() Loops = integer() Draw a diskglu:diskrenders a disk on thez= 0 plane. The disk has a radius ofOuterand contains a concentric circular hole with a radius ofInner. IfInneris 0, then no hole is generated. The disk is subdivided around thezaxis into slices (like pizza slices) and also about thezaxis into rings (as specified bySlicesandLoops, respectively). With respect to orientation, the +zside of the disk is considered to beoutside(seeglu:quadricOrientation/2). This means that if the orientation is set to?GLU_OUTSIDE, then any normals generated point along the +zaxis. Otherwise, they point along the -zaxis. If texturing has been turned on (withglu:quadricTexture/2), texture coordinates are generated linearly such that where r=outer, the value at (r, 0, 0) is (1, 0.5), at (0,r, 0) it is (0.5, 1), at (-r, 0, 0) it is (0, 0.5), and at (0, -r, 0) it is (0.5, 0). See external documentation.errorString(Error)->string()Types: Error = enum() Produce an error string from a GL or GLU error codeglu:errorStringproduces an error string from a GL or GLU error code. The string is in ISO Latin 1 format. For example,glu:errorString(?GLU_OUT_OF_MEMORY) returns the stringoutofmemory. The standard GLU error codes are?GLU_INVALID_ENUM,?GLU_INVALID_VALUE, and?GLU_OUT_OF_MEMORY. Certain other GLU functions can return specialized error codes through callbacks. See thegl:getError/0reference page for the list of GL error codes. See external documentation.getString(Name)->string()Types: Name = enum() Return a string describing the GLU version or GLU extensionsglu:getStringreturns a pointer to a static string describing the GLU version or the GLU extensions that are supported. The version number is one of the following forms:major_number.minor_numbermajor_number.minor_number.release_number. The version string is of the following form:versionnumber<space>vendor-specificinformationVendor-specific information is optional. Its format and contents depend on the implementation. 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. IfNameis?GLU_EXTENSIONS, thenglu:getStringreturns a space-separated list of names of supported GLU extensions. (Extension names never contain spaces.) All strings are null-terminated. See external documentation.lookAt(EyeX,EyeY,EyeZ,CenterX,CenterY,CenterZ,UpX,UpY,UpZ)->okTypes: EyeX = float() EyeY = float() EyeZ = float() CenterX = float() CenterY = float() CenterZ = float() UpX = float() UpY = float() UpZ = float() Define a viewing transformationglu:lookAtcreates a viewing matrix derived from an eye point, a reference point indicating the center of the scene, and anUPvector. The matrix maps the reference point to the negativezaxis 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 theUPvector projected onto the viewing plane is mapped to the positiveyaxis so that it points upward in the viewport. TheUPvector must not be parallel to the line of sight from the eye point to the reference point. Let F=(centerX-eyeX centerY-eyeY centerZ-eyeZ) LetUPbe the vector (upX upY upZ). Then normalize as follows: f=F/(||F||) UP"=UP/(||UP||) Finally, let s=f×UP", and u=s×f. 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) andglu:lookAtis equivalent to glMultMatrixf(M); glTranslated(-eyex, -eyey, -eyez); See external documentation.newQuadric()->integer()Create a quadrics objectglu:newQuadriccreates 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. See external documentation.ortho2D(Left,Right,Bottom,Top)->okTypes: Left = float() Right = float() Bottom = float() Top = float() Define a 2D orthographic projection matrixglu:ortho2Dsets up a two-dimensional orthographic viewing region. This is equivalent to callinggl:ortho/6with near=-1 and far=1. See external documentation.partialDisk(Quad,Inner,Outer,Slices,Loops,Start,Sweep)->okTypes: Quad = integer() Inner = float() Outer = float() Slices = integer() Loops = integer() Start = float() Sweep = float() Draw an arc of a diskglu:partialDiskrenders 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 fromStartthroughStart+Sweepis included (where 0 degrees is along the +f2yf axis, 90 degrees along the +xaxis, 180 degrees along the -yaxis, and 270 degrees along the -xaxis). The partial disk has a radius ofOuterand contains a concentric circular hole with a radius ofInner. IfInneris 0, then no hole is generated. The partial disk is subdivided around thezaxis into slices (like pizza slices) and also about thezaxis into rings (as specified bySlicesandLoops, respectively). With respect to orientation, the +zside of the partial disk is considered to be outside (seeglu:quadricOrientation/2). This means that if the orientation is set to?GLU_OUTSIDE, then any normals generated point along the +zaxis. Otherwise, they point along the -zaxis. If texturing is turned on (withglu:quadricTexture/2), texture coordinates are generated linearly such that where r=outer, the value at (r, 0, 0) is (1.0, 0.5), at (0,r, 0) it is (0.5, 1.0), at (-r, 0, 0) it is (0.0, 0.5), and at (0, -r, 0) it is (0.5, 0.0). See external documentation.perspective(Fovy,Aspect,ZNear,ZFar)->okTypes: Fovy = float() Aspect = float() ZNear = float() ZFar = float() Set up a perspective projection matrixglu:perspectivespecifies a viewing frustum into the world coordinate system. In general, the aspect ratio inglu:perspectiveshould match the aspect ratio of the associated viewport. For example, aspect=2.0 means the viewer's angle of view is twice as wide inxas it is iny. If the viewport is twice as wide as it is tall, it displays the image without distortion. The matrix generated byglu:perspectiveis multipled by the current matrix, just as ifgl:multMatrixd/1were called with the generated matrix. To load the perspective matrix onto the current matrix stack instead, precede the call toglu:perspectivewith a call togl:loadIdentity/0. Givenfdefined as follows: f=cotangent(fovy/2) The generated matrix is (f/aspect 0 0 0 0 f 0 0 0 0(zFar+zNear)/(zNear-zFar)(2×zFar×zNear)/(zNear-zFar) 0 0 -1 0) See external documentation.pickMatrix(X,Y,DelX,DelY,Viewport)->okTypes: X = float() Y = float() DelX = float() DelY = float() Viewport = {integer(), integer(), integer(), integer()} Define a picking regionglu:pickMatrixcreates 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. Useglu:pickMatrixto restrict drawing to a small region around the cursor. Then, enter selection mode (withgl:renderMode/1) and rerender the scene. All primitives that would have been drawn near the cursor are identified and stored in the selection buffer. The matrix created byglu:pickMatrixis multiplied by the current matrix just as ifgl:multMatrixd/1is called with the generated matrix. To effectively use the generated pick matrix for picking, first callgl:loadIdentity/0to load an identity matrix onto the perspective matrix stack. Then callglu:pickMatrix, and, finally, call a command (such asglu:perspective/4) to multiply the perspective matrix by the pick matrix. When usingglu:pickMatrixto pick NURBS, be careful to turn off the NURBS property?GLU_AUTO_LOAD_MATRIX. If?GLU_AUTO_LOAD_MATRIXis 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. See external documentation.project(ObjX,ObjY,ObjZ,Model,Proj,View)->{integer(),WinX::float(),WinY::float(),WinZ::float()}Types: ObjX = float() ObjY = float() ObjZ = float() Model = matrix() Proj = matrix() View = {integer(), integer(), integer(), integer()} Map object coordinates to window coordinatesglu:projecttransforms the specified object coordinates into window coordinates usingModel,Proj, andView. The result is stored inWinX,WinY, andWinZ. A return value of?GLU_TRUEindicates success, a return value of?GLU_FALSEindicates failure. To compute the coordinates, let v=(objX objY objZ 1.0) represented as a matrix with 4 rows and 1 column. Thenglu:projectcomputes v" as follows: v"=P×M×v where P is the current projection matrixProjand M is the current modelview matrixModel(both represented as 4×4 matrices in column-major order). The window coordinates are then computed as follows: winX=view(0)+view(2)×(v"(0)+1)/2 winY=view(1)+view(3erl)×(v"(1)+1)/2 winZ=(v"(2)+1)/2 See external documentation.quadricDrawStyle(Quad,Draw)->okTypes: Quad = integer() Draw = enum() Specify the draw style desired for quadricsglu:quadricDrawStylespecifies the draw style for quadrics rendered withQuad. The legal values are as follows:?GLU_FILL: Quadrics are rendered with polygon primitives. The polygons are drawn in a counterclockwise fashion with respect to their normals (as defined withglu:quadricOrientation/2).?GLU_LINE: Quadrics are rendered as a set of lines.?GLU_SILHOUETTE: Quadrics are rendered as a set of lines, except that edges separating coplanar faces will not be drawn.?GLU_POINT: Quadrics are rendered as a set of points. See external documentation.quadricNormals(Quad,Normal)->okTypes: Quad = integer() Normal = enum() Specify what kind of normals are desired for quadricsglu:quadricNormalsspecifies what kind of normals are desired for quadrics rendered withQuad. The legal values are as follows:?GLU_NONE: No normals are generated.?GLU_FLAT: One normal is generated for every facet of a quadric.?GLU_SMOOTH: One normal is generated for every vertex of a quadric. This is the initial value. See external documentation.quadricOrientation(Quad,Orientation)->okTypes: Quad = integer() Orientation = enum() Specify inside/outside orientation for quadricsglu:quadricOrientationspecifies what kind of orientation is desired for quadrics rendered withQuad. TheOrientationvalues are as follows:?GLU_OUTSIDE: Quadrics are drawn with normals pointing outward (the initial value).?GLU_INSIDE: Quadrics are drawn with normals pointing inward. Note that the interpretation ofoutwardandinwarddepends on the quadric being drawn. See external documentation.quadricTexture(Quad,Texture)->okTypes: Quad = integer() Texture = 0 | 1 Specify if texturing is desired for quadricsglu:quadricTexturespecifies if texture coordinates should be generated for quadrics rendered withQuad. If the value ofTextureis?GLU_TRUE, then texture coordinates are generated, and ifTextureis?GLU_FALSE, they are not. The initial value is?GLU_FALSE. The manner in which texture coordinates are generated depends upon the specific quadric rendered. See external documentation.scaleImage(Format,WIn,HIn,TypeIn,DataIn,WOut,HOut,TypeOut,DataOut)->integer()Types: Format = enum() WIn = integer() HIn = integer() TypeIn = enum() DataIn = binary() WOut = integer() HOut = integer() TypeOut = enum() DataOut = mem() Scale an image to an arbitrary sizeglu:scaleImagescales a pixel image using the appropriate pixel store modes to unpack data from the source image and pack data into the destination image. When shrinking an image,glu:scaleImageuses 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. A return value of zero indicates success, otherwise a GLU error code is returned (seeglu:errorString/1). See thegl:readPixels/7reference page for a description of the acceptable values for theFormat,TypeIn, andTypeOutparameters. See external documentation.sphere(Quad,Radius,Slices,Stacks)->okTypes: Quad = integer() Radius = float() Slices = integer() Stacks = integer() Draw a sphereglu:spheredraws a sphere of the given radius centered around the origin. The sphere is subdivided around thezaxis into slices and along thezaxis into stacks (similar to lines of longitude and latitude). If the orientation is set to?GLU_OUTSIDE(withglu:quadricOrientation/2), then any normals generated point away from the center of the sphere. Otherwise, they point toward the center of the sphere. If texturing is turned on (withglu:quadricTexture/2), then texture coordinates are generated so thattranges from 0.0 at z=-radius to 1.0 at z=radius (tincreases linearly along longitudinal lines), andsranges from 0.0 at the +yaxis, to 0.25 at the +xaxis, to 0.5 at the -yaxis, to 0.75 at the -xaxis, and back to 1.0 at the +yaxis. See external documentation.unProject(WinX,WinY,WinZ,Model,Proj,View)->{integer(),ObjX::float(),ObjY::float(),ObjZ::float()}Types: WinX = float() WinY = float() WinZ = float() Model = matrix() Proj = matrix() View = {integer(), integer(), integer(), integer()} Map window coordinates to object coordinatesglu:unProjectmaps the specified window coordinates into object coordinates usingModel,Proj, andView. The result is stored inObjX,ObjY, andObjZ. A return value of?GLU_TRUEindicates success; a return value of?GLU_FALSEindicates failure. To compute the coordinates (objX objY objZ),glu:unProjectmultiplies the normalized device coordinates by the inverse ofModel*Projas follows: (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. See external documentation.unProject4(WinX,WinY,WinZ,ClipW,Model,Proj,View,NearVal,FarVal)->{integer(),ObjX::float(),ObjY::float(),ObjZ::float(),ObjW::float()}Types: WinX = float() WinY = float() WinZ = float() ClipW = float() Model = matrix() Proj = matrix() View = {integer(), integer(), integer(), integer()} NearVal = float() FarVal = float() SeeunProject/6

**AUTHORS**

<>wx 1.1.1 glu(3erl)