Android APIs
public class

GLU

extends Object
java.lang.Object
   ↳ android.opengl.GLU

Class Overview

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

Summary

Public Constructors
GLU()
Public Methods
static String gluErrorString(int error)
Return an error string from a GL or GLU error code.
static void gluLookAt(GL10 gl, float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ)
Define a viewing transformation in terms of an eye point, a center of view, and an up vector.
static void gluOrtho2D(GL10 gl, float left, float right, float bottom, float top)
Set up a 2D orthographic projection matrix
static void gluPerspective(GL10 gl, float fovy, float aspect, float zNear, float zFar)
Set up a perspective projection matrix
static int gluProject(float objX, float objY, float objZ, float[] model, int modelOffset, float[] project, int projectOffset, int[] view, int viewOffset, float[] win, int winOffset)
Map object coordinates into window coordinates.
static int gluUnProject(float winX, float winY, float winZ, float[] model, int modelOffset, float[] project, int projectOffset, int[] view, int viewOffset, float[] obj, int objOffset)
Map window coordinates to object coordinates.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public GLU ()

Added in API level 1

Public Methods

public static String gluErrorString (int error)

Added in API level 1

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

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

public static void gluLookAt (GL10 gl, float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ)

Added in API level 1

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

public static void gluOrtho2D (GL10 gl, float left, float right, float bottom, float top)

Added in API level 1

Set up a 2D orthographic projection matrix

public static void gluPerspective (GL10 gl, float fovy, float aspect, float zNear, float zFar)

Added in API level 1

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).

public static int gluProject (float objX, float objY, float objZ, float[] model, int modelOffset, float[] project, int projectOffset, int[] view, int viewOffset, float[] win, int winOffset)

Added in API level 1

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 float: the current modelview matrix
modelOffset int: the offset into the model array where the modelview maxtrix data starts.
project float: the current projection matrix
projectOffset int: the offset into the project array where the project matrix data starts.
view int: the current view, {x, y, width, height}
viewOffset int: the offset into the view array where the view vector data starts.
win float: 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.
Returns
int A return value of GL_TRUE indicates success, a return value of GL_FALSE indicates failure.

public static int gluUnProject (float winX, float winY, float winZ, float[] model, int modelOffset, float[] project, int projectOffset, int[] view, int viewOffset, float[] obj, int objOffset)

Added in API level 1

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 float: the current modelview matrix
modelOffset int: the offset into the model array where the modelview maxtrix data starts.
project float: the current projection matrix
projectOffset int: the offset into the project array where the project matrix data starts.
view int: the current view, {x, y, width, height}
viewOffset int: the offset into the view array where the view vector data starts.
obj float: the output vector {objX, objY, objZ}, that returns the computed object coordinates.
objOffset int: the offset into the obj array where the obj vector data starts.
Returns
int A return value of GL10.GL_TRUE indicates success, a return value of GL10.GL_FALSE indicates failure.