OpenGL ES 在 Android 中对 GLU 的原生支持-阿里云开发者社区

开发者社区> 开发与运维> 正文
登录阅读全文

OpenGL ES 在 Android 中对 GLU 的原生支持

简介: OpenGL ES 在 Android 中对 GLU 的原生支持 太阳火神的美丽人生 (http://blog.csdn.net/opengl_es) 本文遵循“署名-非商业用途-保持一致”创作公用协议 转载请保留此句:太阳火神的美丽人生 -  本博客专注于 敏捷开发及移动和物联设备研究:iOS、Android、Html5、Arduino、pcDuino,否则,出自本博客的文章拒绝转载或再转载,谢谢合作。

OpenGL ES 在 Android 中对 GLU 的原生支持

太阳火神的美丽人生 (http://blog.csdn.net/opengl_es)

本文遵循“署名-非商业用途-保持一致”创作公用协议

转载请保留此句:太阳火神的美丽人生 -  本博客专注于 敏捷开发及移动和物联设备研究:iOS、Android、Html5、Arduino、pcDuino否则,出自本博客的文章拒绝转载或再转载,谢谢合作。




注:

我总是喜欢多了解些语言,比如英文、法文、俄语、德文、日文、韩文、藏语、蒙古语、梵文......

当然啦,汉语和中文一定是要了解的,但汉语和中文具体啥区别,我还是没搞清楚!

了解的意思,其实也很简单,就是看到一篇文章,我知道是用哪一种语言写的,

但真具体到,里面写的是什么,那就得借助翻译工具,全文翻译来大概猜了,

真要让我看的话,我只能看懂中文和英文,英文还得配合着有道划词取词功能。

很多资料,实现找不到的时侯,就饥不择食,连日文也敢偿试着去看,当然不是看原文了,用全文翻译,哈哈哈


计算机也一样,

我也总是喜欢多了解些语言,比如Java、C#、Pascal、JavaScript、bash、还有哪些不太记得了,

当然啦,C和C++还有Objective-C是一定要了解的,而且清楚地知道他们之间的差异,但实际用起来,C++在Objective-C中的混和使用,太高深的还是不太了解,

至于什么样算是高深的,暂时还没遇到过,一是可能确实不太难,二是我用的不太多。

尤如 OpenGL 这种专业性很强的技术,用哪种语言说,看哪种语言的资料,当然也和上面一样,

C和C++的是必须的,Objective-C 做苹果开发,那是母语来着,

实在没有可看的资料,见着有这关键字的,管它什么语言写的,拿来就是看,领悟其中的一些道理是至关重要的,以便找到思路。


归根结底,语言只是一种表达方式,关键在于我们要传达的内容。


下面的内容先转下来,后续有时间一点点翻译。


原文地址:http://developer.android.com/reference/android/opengl/GLU.html

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 - a GL or GLU error code.
Returns
  • 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 a GL10 interface
eyeX eye point X
eyeY eye point Y
eyeZ eye point Z
centerX center of view X
centerY center of view Y
centerZ center of view Z
upX up vector X
upY up vector Y
upZ 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 a GL10 interface
fovy specifies the field of view angle, in degrees, in the Y direction.
aspect 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 specifies the distance from the viewer to the near clipping plane (always positive).
zFar 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 object coordinates X
objY object coordinates Y
objZ object coordinates Z
model the current modelview matrix
modelOffset the offset into the model array where the modelview maxtrix data starts.
project the current projection matrix
projectOffset the offset into the project array where the project matrix data starts.
view the current view, {x, y, width, height}
viewOffset the offset into the view array where the view vector data starts.
win the output vector {winX, winY, winZ}, that returns the computed window coordinates.
winOffset the offset into the win array where the win vector data starts.
Returns
  • 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 window coordinates X
winY window coordinates Y
winZ window coordinates Z
model the current modelview matrix
modelOffset the offset into the model array where the modelview maxtrix data starts.
project the current projection matrix
projectOffset the offset into the project array where the project matrix data starts.
view the current view, {x, y, width, height}
viewOffset the offset into the view array where the view vector data starts.
obj the output vector {objX, objY, objZ}, that returns the computed object coordinates.
objOffset the offset into the obj array where the obj vector data starts.
Returns
  • A return value of GL10.GL_TRUE indicates success, a return value of GL10.GL_FALSE indicates failure.
Except as noted, this content is licensed under Apache 2.0. For details and restrictions, see the Content License.
Android 4.4 r1 — 19 Dec 2013 22:18

About Android  |  Legal  |  Support




版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

分享:
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

其他文章
最新文章
相关文章