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.



目录
相关文章
|
3月前
|
开发框架 前端开发 Android开发
Flutter 与原生模块(Android 和 iOS)之间的通信机制,包括方法调用、事件传递等,分析了通信的必要性、主要方式、数据传递、性能优化及错误处理,并通过实际案例展示了其应用效果,展望了未来的发展趋势
本文深入探讨了 Flutter 与原生模块(Android 和 iOS)之间的通信机制,包括方法调用、事件传递等,分析了通信的必要性、主要方式、数据传递、性能优化及错误处理,并通过实际案例展示了其应用效果,展望了未来的发展趋势。这对于实现高效的跨平台移动应用开发具有重要指导意义。
362 4
|
9月前
|
数据采集 小程序 数据可视化
智慧校园电子班牌管理系统源码 Java Android原生
家长通过家长小程序端随时了解孩子在校的情况,实时接收学生的出勤情况,学生到校、离校时间。随时了解学生在校的表现、学生成绩排名,及时与教师沟通,关注孩子的健康成长。
90 0
智慧校园电子班牌管理系统源码 Java Android原生
|
6月前
|
Android开发
错误记录:调用原生TvSettings 的 com.android.tv.settings.device.storage.ResetActivity 无法启动
本文记录了一个Android TV设置中由于未设置`android:exported="true"`导致`com.android.tv.settings.device.storage.ResetActivity`无法被第三方app启动的错误,并通过添加该属性成功解决了问题。
98 1
|
8月前
|
Linux API 图形学
OpenGL生态中的GL, GLU, GLUT, GLX, GLEW, GLEE和GLEXT详解
该文介绍了OpenGL生态系统中的关键组件,包括GL(基础绘图API)、GLU(提供辅助函数)、GLUT(窗口管理和事件处理)、GLX(X Window系统上的OpenGL扩展)、GLEW和GLEE(动态查询和封装OpenGL扩展)以及GLEXT(OpenGL扩展集合)。这些库和工具协同工作,帮助开发者构建跨平台的图形应用程序,提升兼容性与功能。理解它们的作用对优化OpenGL编程至关重要。
|
9月前
|
API 开发工具 Android开发
调用Android原生@SystemApi、@Hide方法
调用Android原生@SystemApi、@Hide方法
696 1
|
9月前
|
Java Android开发
Android开发之使用OpenGL实现翻书动画
本文讲述了如何使用OpenGL实现更平滑、逼真的电子书翻页动画,以解决传统贝塞尔曲线方法存在的卡顿和阴影问题。作者分享了一个改造后的外国代码示例,提供了从前往后和从后往前的翻页效果动图。文章附带了`GlTurnActivity`的Java代码片段,展示如何加载和显示书籍图片。完整工程代码可在作者的GitHub找到:https://github.com/aqi00/note/tree/master/ExmOpenGL。
210 1
|
9月前
|
Android开发 开发者
Android开发之OpenGL的画笔工具GL10
这篇文章简述了OpenGL通过GL10进行三维图形绘制,强调颜色取值范围为0.0到1.0,背景和画笔颜色设置方法;介绍了三维坐标系及与之相关的旋转、平移和缩放操作;最后探讨了坐标矩阵变换,包括设置绘图区域、调整镜头参数和改变观测方位。示例代码展示了如何使用这些方法创建简单的三维立方体。
109 1
Android开发之OpenGL的画笔工具GL10
|
9月前
|
前端开发 API vr&ar
Android开发之OpenGL绘制三维图形的流程
即将连载的系列文章将探索Android上的OpenGL开发,这是一种用于创建3D图形和动画的技术。OpenGL是跨平台的图形库,Android已集成其API。文章以2D绘图为例,解释了OpenGL的3个核心元素:GLSurfaceView(对应View)、GLSurfaceView.Renderer(类似Canvas)和GL10(类似Paint)。通过将这些结合,Android能实现3D图形渲染。文章介绍了Renderer接口的三个方法,分别对应2D绘图的构造、测量布局和绘制过程。示例代码展示了如何在布局中添加GLSurfaceView并注册渲染器。
247 1
Android开发之OpenGL绘制三维图形的流程
|
9月前
|
数据采集 小程序 数据可视化
Java Android原生智慧校园管理系统源码
对班牌的考试模式、班牌模式上课模式进行设置及管理,设置成功后,班牌端将同步应用。
93 0
|
9月前
|
XML 前端开发 Java
【Android App】三维处理中三维投影OpenGL功能的讲解及实战(附源码和演示 超详细必看)
【Android App】三维处理中三维投影OpenGL功能的讲解及实战(附源码和演示 超详细必看)
146 1

热门文章

最新文章

  • 1
    如何修复 Android 和 Windows 不支持视频编解码器的问题?
  • 2
    Android历史版本与APK文件结构
  • 3
    【08】flutter完成屏幕适配-重建Android,增加GetX路由,屏幕适配,基础导航栏-多版本SDK以及gradle造成的关于fvm的使用(flutter version manage)-卓伊凡换人优雅草Alex-开发完整的社交APP-前端客户端开发+数据联调|以优雅草商业项目为例做开发-flutter开发-全流程-商业应用级实战开发-优雅草Alex
  • 4
    当flutter react native 等混开框架-并且用vscode-idea等编译器无法打包apk,打包安卓不成功怎么办-直接用android studio如何打包安卓apk -重要-优雅草卓伊凡
  • 5
    APP-国内主流安卓商店-应用市场-鸿蒙商店上架之必备前提·全国公安安全信息评估报告如何申请-需要安全评估报告的资料是哪些-优雅草卓伊凡全程操作
  • 6
    【09】flutter首页进行了完善-采用android studio 进行真机调试开发-增加了直播间列表和短视频人物列表-增加了用户中心-卓伊凡换人优雅草Alex-开发完整的社交APP-前端客户端开发+数据联调|以优雅草商业项目为例做开发-flutter开发-全流程-商业应用级实战开发-优雅草Alex
  • 7
    【03】仿站技术之python技术,看完学会再也不用去购买收费工具了-修改整体页面做好安卓下载发给客户-并且开始提交网站公安备案-作为APP下载落地页文娱产品一定要备案-包括安卓android下载(简单)-ios苹果plist下载(稍微麻烦一丢丢)-优雅草卓伊凡
  • 8
    【02】仿站技术之python技术,看完学会再也不用去购买收费工具了-本次找了小影-感觉页面很好看-本次是爬取vue需要用到Puppeteer库用node.js扒一个app下载落地页-包括安卓android下载(简单)-ios苹果plist下载(稍微麻烦一丢丢)-优雅草卓伊凡
  • 9
    Android经典面试题之Kotlin中Lambda表达式和匿名函数的区别
  • 10
    Cellebrite UFED 4PC 7.71 (Windows) - Android 和 iOS 移动设备取证软件
  • 1
    escrcpy:【技术党必看】Android开发,Escrcpy 让你无线投屏新体验!图形界面掌控 Android,30-120fps 超流畅!🔥
    25
  • 2
    【01】噩梦终结flutter配安卓android鸿蒙harmonyOS 以及next调试环境配鸿蒙和ios真机调试环境-flutter项目安卓环境配置-gradle-agp-ndkVersion模拟器运行真机测试环境-本地环境搭建-如何快速搭建android本地运行环境-优雅草卓伊凡-很多人在这步就被难倒了
    28
  • 3
    Cellebrite UFED 4PC 7.71 (Windows) - Android 和 iOS 移动设备取证软件
    29
  • 4
    【03】仿站技术之python技术,看完学会再也不用去购买收费工具了-修改整体页面做好安卓下载发给客户-并且开始提交网站公安备案-作为APP下载落地页文娱产品一定要备案-包括安卓android下载(简单)-ios苹果plist下载(稍微麻烦一丢丢)-优雅草卓伊凡
    40
  • 5
    Android历史版本与APK文件结构
    126
  • 6
    【02】仿站技术之python技术,看完学会再也不用去购买收费工具了-本次找了小影-感觉页面很好看-本次是爬取vue需要用到Puppeteer库用node.js扒一个app下载落地页-包括安卓android下载(简单)-ios苹果plist下载(稍微麻烦一丢丢)-优雅草卓伊凡
    34
  • 7
    【01】仿站技术之python技术,看完学会再也不用去购买收费工具了-用python扒一个app下载落地页-包括安卓android下载(简单)-ios苹果plist下载(稍微麻烦一丢丢)-客户的麻将软件需要下载落地页并且要做搜索引擎推广-本文用python语言快速开发爬取落地页下载-优雅草卓伊凡
    27
  • 8
    APP-国内主流安卓商店-应用市场-鸿蒙商店上架之必备前提·全国公安安全信息评估报告如何申请-需要安全评估报告的资料是哪些-优雅草卓伊凡全程操作
    60
  • 9
    【09】flutter首页进行了完善-采用android studio 进行真机调试开发-增加了直播间列表和短视频人物列表-增加了用户中心-卓伊凡换人优雅草Alex-开发完整的社交APP-前端客户端开发+数据联调|以优雅草商业项目为例做开发-flutter开发-全流程-商业应用级实战开发-优雅草Alex
    38
  • 10
    当flutter react native 等混开框架-并且用vscode-idea等编译器无法打包apk,打包安卓不成功怎么办-直接用android studio如何打包安卓apk -重要-优雅草卓伊凡
    73