Added in API level 1

GLU


open class GLU
kotlin.Any
   ↳ android.opengl.GLU

A set of GL utilities inspired by the OpenGL Utility Toolkit.

Summary

Public constructors
GLU()

Public methods
open static String!

Return an error string from a GL or GLU error code.

open static Unit
gluLookAt(gl: GL10!, eyeX: Float, eyeY: Float, eyeZ: Float, centerX: Float, centerY: Float, centerZ: Float, upX: Float, upY: Float, upZ: Float)

Define a viewing transformation in terms of an eye point, a center of view, and an up vector.

open static Unit
gluOrtho2D(gl: GL10!, left: Float, right: Float, bottom: Float, top: Float)

Set up a 2D orthographic projection matrix

open static Unit
gluPerspective(gl: GL10!, fovy: Float, aspect: Float, zNear: Float, zFar: Float)

Set up a perspective projection matrix

open static Int
gluProject(objX: Float, objY: Float, objZ: Float, model: FloatArray!, modelOffset: Int, project: FloatArray!, projectOffset: Int, view: IntArray!, viewOffset: Int, win: FloatArray!, winOffset: Int)

Map object coordinates into window coordinates.

open static Int
gluUnProject(winX: Float, winY: Float, winZ: Float, model: FloatArray!, modelOffset: Int, project: FloatArray!, projectOffset: Int, view: IntArray!, viewOffset: Int, obj: FloatArray!, objOffset: Int)

Map window coordinates to object coordinates.

Public constructors

GLU

GLU()

Public methods

gluErrorString

Added in API level 1
open static fun gluErrorString(error: Int): String!

Return an error string from a GL or GLU error code.

Parameters
error Int: - a GL or GLU error code.
Return
String! the error string for the input error code, or NULL if the input was not a valid GL or GLU error code.

gluLookAt

Added in API level 1
open static fun gluLookAt(
    gl: GL10!,
    eyeX: Float,
    eyeY: Float,
    eyeZ: Float,
    centerX: Float,
    centerY: Float,
    centerZ: Float,
    upX: Float,
    upY: Float,
    upZ: Float
): Unit

Define a viewing transformation in terms of an eye point, a center of view, and an up vector.

Parameters
gl GL10!: a GL10 interface
eyeX Float: eye point X
eyeY Float: eye point Y
eyeZ Float: eye point Z
centerX Float: center of view X
centerY Float: center of view Y
centerZ Float: center of view Z
upX Float: up vector X
upY Float: up vector Y
upZ Float: up vector Z

gluOrtho2D

Added in API level 1
open static fun gluOrtho2D(
    gl: GL10!,
    left: Float,
    right: Float,
    bottom: Float,
    top: Float
): Unit

Set up a 2D orthographic projection matrix

Parameters
gl GL10!:
left Float:
right Float:
bottom Float:
top Float:

gluPerspective

Added in API level 1
open static fun gluPerspective(
    gl: GL10!,
    fovy: Float,
    aspect: Float,
    zNear: Float,
    zFar: Float
): Unit

Set up a perspective projection matrix

Parameters
gl GL10!: a GL10 interface
fovy Float: specifies the field of view angle, in degrees, in the Y direction.
aspect Float: specifies the aspect ration that determins the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
zNear Float: specifies the distance from the viewer to the near clipping plane (always positive).
zFar Float: specifies the distance from the viewer to the far clipping plane (always positive).

gluProject

Added in API level 1
open static fun gluProject(
    objX: Float,
    objY: Float,
    objZ: Float,
    model: FloatArray!,
    modelOffset: Int,
    project: FloatArray!,
    projectOffset: Int,
    view: IntArray!,
    viewOffset: Int,
    win: FloatArray!,
    winOffset: Int
): Int

Map object coordinates into window coordinates. gluProject transforms the specified object coordinates into window coordinates using model, proj, and view. The result is stored in win.

Note that you can use the OES_matrix_get extension, if present, to get the current modelView and projection matrices.

Parameters
objX Float: object coordinates X
objY Float: object coordinates Y
objZ Float: object coordinates Z
model FloatArray!: the current modelview matrix
modelOffset Int: the offset into the model array where the modelview maxtrix data starts.
project FloatArray!: the current projection matrix
projectOffset Int: the offset into the project array where the project matrix data starts.
view IntArray!: the current view, {x, y, width, height}
viewOffset Int: the offset into the view array where the view vector data starts.
win FloatArray!: the output vector {winX, winY, winZ}, that returns the computed window coordinates.
winOffset Int: the offset into the win array where the win vector data starts.
Return
Int A return value of GL_TRUE indicates success, a return value of GL_FALSE indicates failure.

gluUnProject

Added in API level 1
open static fun gluUnProject(
    winX: Float,
    winY: Float,
    winZ: Float,
    model: FloatArray!,
    modelOffset: Int,
    project: FloatArray!,
    projectOffset: Int,
    view: IntArray!,
    viewOffset: Int,
    obj: FloatArray!,
    objOffset: Int
): Int

Map window coordinates to object coordinates. gluUnProject maps the specified window coordinates into object coordinates using model, proj, and view. The result is stored in obj.

Note that you can use the OES_matrix_get extension, if present, to get the current modelView and projection matrices.

Parameters
winX Float: window coordinates X
winY Float: window coordinates Y
winZ Float: window coordinates Z
model FloatArray!: the current modelview matrix
modelOffset Int: the offset into the model array where the modelview maxtrix data starts.
project FloatArray!: the current projection matrix
projectOffset Int: the offset into the project array where the project matrix data starts.
view IntArray!: the current view, {x, y, width, height}
viewOffset Int: the offset into the view array where the view vector data starts.
obj FloatArray!: the output vector {objX, objY, objZ, objW}, that returns the computed homogeneous object coordinates.
objOffset Int: the offset into the obj array where the obj vector data starts.
Return
Int A return value of GL10.GL_TRUE indicates success, a return value of GL10.GL_FALSE indicates failure.