public class GLU
extends Object
java.lang.Object | |
↳ | android.opengl.GLU |
一系列GL实用程序受OpenGL Utility Toolkit的启发。
Public constructors |
|
---|---|
GLU() |
Public methods |
|
---|---|
static String |
gluErrorString(int error) 从GL或GLU错误代码中返回错误字符串。 |
static void |
gluLookAt(GL10 gl, float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ) 根据视点,视角和向上方向定义视图变换。 |
static void |
gluOrtho2D(GL10 gl, float left, float right, float bottom, float top) 建立二维正交投影矩阵 |
static void |
gluPerspective(GL10 gl, float fovy, float aspect, float zNear, float zFar) 建立一个透视投影矩阵 |
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) 将对象坐标映射到窗口坐标。 |
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) 将窗口坐标映射到对象坐标。 |
Inherited methods |
|
---|---|
From class java.lang.Object
|
String gluErrorString (int error)
从GL或GLU错误代码中返回错误字符串。
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. |
void gluLookAt (GL10 gl, float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ)
根据视点,视角和向上方向定义视图变换。
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 |
void gluOrtho2D (GL10 gl, float left, float right, float bottom, float top)
建立二维正交投影矩阵
void gluPerspective (GL10 gl, float fovy, float aspect, float zNear, float zFar)
建立一个透视投影矩阵
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). |
int gluProject (float objX, float objY, float objZ, float[] model, int modelOffset, float[] project, int projectOffset, int[] view, int viewOffset, float[] win, int winOffset)
将对象坐标映射到窗口坐标。 gluProject使用model,proj和view将指定的对象坐标转换为窗口坐标。 结果存储在win中。
请注意,您可以使用OES_matrix_get扩展(如果存在)来获取当前的模型视图和投影矩阵。
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. |
int gluUnProject (float winX, float winY, float winZ, float[] model, int modelOffset, float[] project, int projectOffset, int[] view, int viewOffset, float[] obj, int objOffset)
将窗口坐标映射到对象坐标。 gluUnProject使用model,proj和view将指定的窗口坐标映射到对象坐标。 结果存储在obj中。
请注意,您可以使用OES_matrix_get扩展(如果存在)来获取当前的模型视图和投影矩阵。
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. |