3D rendering display methods based on Android

文档序号:1773233 发布日期:2019-12-03 浏览:23次 中文

阅读说明:本技术 基于Android的3D图像显示方法 (3D rendering display methods based on Android ) 是由 林琳 于 2018-05-25 设计创作,主要内容包括:本发明主要在Android手机操作系统应用OpenGL以及相关技术,来实现图形的3D建模和展示工作。说明了利用OpenGL ES实现三维图形绘制的最基本的编程框架及方法,以及OpenGL中的投影、光照、材料等最重要的技术的应用方法。本发明实现了3D图像显示和渲染处理。(The present invention is mainly in Android phone operating system application OpenGL and the relevant technologies, the 3D modeling and displaying work of Lai Shixian figure.Illustrate the application method using most important technologies such as the OpenGL ES most basic programming framework and method for realizing 3 D image drawing and projection, illumination, materials in OpenGL.The present invention realize 3D rendering show and rendering processing.)

1. a kind of 3D rendering display methods based on Android, it is characterised in that the following steps are included:

Step 1:Android exploitation environment is built.

Step 2: modeling procedure and used knowledge.

The application of step 3:OpenGL, the specific drafting of figure.Here building for day empty packet is mainly realized with SkyBox class It makes and draws.

Step 4: figure rendering processing.It, be to these solid figures after the drafting for completing fundamental figure on OpenGL ES It is rendered.Firstly, to increase light source, because any color only can just be connect in the case where there is illumination by our eyes It receives.So to carry out adding light to entire 3D figure.Then stick picture disposing is carried out to its surrounding.It chooses figure in kind and wakes up with a start patch Figure.But lake needs the appearance to ripple, so directly directly right with the knowledge in OpenGL without textures It is handled.Lighting process, texture mapping processing, the processing of normal vector.

Step 5: construction textures.GLImage.java class is mainly the patch built a series of static variable and be used to initialize us Figure information, that is to say, that the referencing operation of the picture to 3D model is encapsulated in this class by we, among the programming in later period We call directly the mode of the static variable of this class to read the pictorial information of our needs, and such encapsulation can save A large amount of code repeats, and code readability can be allowed to greatly improve.

Technical field

It is a kind of based on Android phone system 3D rendering display methods the invention belongs to computer graphics techniques field.

Background technique

Usually said is presented 3-D graphic in computer, refers to the three-dimensional effect that figure is presented under the 2D environment of plane Fruit.Unlike in we usually life, in the three-dimensional space of reality, there are true distance, space sense.However it is counting In calculation machine, we only accomplished generally as true three-dimensional world, so the 3D figure that basically computer is realized Shape is only to allow in people's visual effect experience and true identical.The maximum feature of human eye is exactly to see that scene is close big remote It is small, so as to form three-dimensional feeling.Effect is presented by (2D) of plane in computer, but why we are it can be seen that like true Outdoor scene is because the color gray scale difference being shown on computer display screen is to allow the eyes of people to make as identical 3-D effect At the illusion on material object, so that two-dimensional computer display screen perception be allowed to show as three-dimensional image.

3D rendering stereo technology has powerful vitality.The market space that can infinitely open up, manufacturing technology are wide Market prospects, mature complete technology, digitized application technology make stereo-picture product have powerful unlimited life Power.We are it is contemplated that its market prospects is very wide.But the high-tech industry opposite as one, stereoscopic imaging technology It is a kind of interleaving techniques of synthesis.It will integrate the science and technology of multiple material, and it is more difficult to operate, and technology is also special difficulty. So the beginning of its finished product at home also only just.

Summary of the invention

It is an object of the invention to cut the OpenGL ES of customization using OpenGL based under android system, To realize the drafting and display of 3D rendering.

To achieve the above object, the technical scheme is that the 3D rendering display methods based on Android, including with Lower step:

Step 1: building Android exploitation environment.

Step 2: modeling procedure.Among this secondary design, we are intended to reproduce solid using Android3D drawing technique Image, so the form showed be exactly first draw a cube box, then sticked on the inner wall of the inside of cube The scene picture of institute's surrounding, after having drawn the box of cube, we take up to draw rectangular in the inside of cube The teaching building of body, the water surface and the ancient cooking vessel before teaching building of glistening light of waves Ling Ling, this three big scenery is all plotted in the inside of box by we, Teaching building and ancient cooking vessel were placed on the upper surface of water surface before this by us, then floating on water box in midair among, the purpose that does so Consider also for the depth of field of image, in order to preferably allow view to have 3D sense, then all sticks phase in the outer wall of each scenery The textures answered.

Step 3: modeling used knowledge.It is the rotation of figure first, we will use rotation transformation here, that is, A figure is allowed to realize a kind of process of rotation in our specific spaces.Here we are a little appreciated that the clockwise, inverse time The rotation of needle, because we will particularly pay attention to angle problem.But we do not need particularly to worry, meeting in OpenGL ES There is corresponding function to help us to realize.Followed by the scale transformation of figure, that is, allow the directly proportional zoom of figure, Because we need demonstrated on prototype, and now is all touch-screen mobile phone, so we can obtain over the display it is more In two sense of touch points.So we can amplify and reduce to picture completely.It is finally the relative position between figure Relationship first has to one suitable object of reference of selection to determine the origin of space coordinates.It is corresponding we in OpenGL ES Determine also that coordinate origin, there are also the directions of whole figure.

Step 4: the specific drafting of figure.The construction and drawing of day empty packet are realized with SkyBox class.Its empty packet The graphics plane data object in six faces initialized.Here the selection of the size of plane and texture picture is all carried out Specific setting.In this way we will six planes to box, then we are translating and are revolving to six planes Turn to can be obtained by complete day empty packet.

Step 5: figure rendering processing.It, be to these solids after the drafting for completing fundamental figure on OpenGL ES Figure is rendered.Firstly, we will increase light source, because any color only has us just can be by me in the case where there is illumination Eyes receive.So we to carry out to entire 3D figure plus light.Then we will carry out stick picture disposing to its surrounding.I Choose figure in kind and wake up with a start textures.

Step 6: construction textures.

The advantages and positive effects of the present invention are:

Compared to the existing 3D image display method based on Android, beneficial effects of the present invention: the work of embedded device It is severe for making environment largely, wherein can all have high requirement to vibration, temperature, impact, humidity, acid and alkali corrosion degree.And Version of the OpenGL ES as the embedded system of OpenGL, it mainly applies to mobile phone, console game machine, plate electricity OpenGL version in the types such as brain.It by OpenGL cut out from and OpenGL comparison, opposite simplification and without Some more complicated characteristics in OpenGL.Interface alternation is completed so as to effect taller in the case where saving electric energy as far as possible Work.

Detailed description of the invention

Fig. 1 is modeling procedure figure.

Fig. 2 is rendering flow chart.

Specific embodiment

The embodiment of the present invention is further described below in conjunction with attached drawing:

A kind of 3D rendering display methods based on Android, comprising the following steps:

Related definition:

(1)OpenGL.It is an advanced three-dimensional computer graphics model library, is initially developed by SGI company, the U.S., purpose It is that powerful 3-D graphic mechanism is provided for graphics workstation.

(2)OpenGL ES(OpenGL for Embedded Systems).It is the subset of OpenGL 3-D graphic API, It is designed for embedded devices such as mobile phone, PDA and game hosts.OpenGL ES is come from the customization that OpenGL is cut, GlBegin/glEnd is eliminated, complexity pel such as quadrangle (GL_QUADS), polygon (GL_POLYGONS) etc. is many non-exhausted To necessary characteristic.

Step 1: building Android exploitation environment.

Step 2: modeling procedure.It is BOX module first;Followed by the 3D water surface module that gleams of light are reflecting on waves in the river;Followed by teaching building Cuboid 3D scenery module;It is finally the drafting module of 3D ancient cooking vessel module.

Step 3: modeling used knowledge.The rotation of figure.The scaling of figure.Relative positional relationship between figure.

Step 4: the specific drafting of figure.

Step 5: figure rendering processing.In GLRender.java, light source is carried out using initLight0 () method Initialization, renders figure,

Lighting process.LED to seem more solid object.If without light, most of three-dimensional article for building picture Body.Therefore, light is extremely important for three-dimension object.In OpenGL ES, there are two source, the illuminating effect of generation, light guides Positioning.Light corresponds to guide-lighting light source, and all directions of the light guide of unlimited distant positions in space are identical.Corresponding to light A certain position light source light positioning.In addition, when the illuminating effect of your setting, it would be desirable to some light sources, such as face be arranged The attribute of color.Different parameters, GL_DIFFUSE, GL_ is used in combination in three kinds of color GL_AMBIENT of permission of OpenGL ES SPECULAR。

Step 6: construction textures.GLImage.java class has mainly built a series of static variable and has been used to initialize us Textures information, that is to say, that the referencing operation of the picture to 3D model is encapsulated in this class by we, in the programming in later period Among we call directly the mode of the static variable of this class to read the pictorial information of our needs, such encapsulation can be with It saves a large amount of code to repeat, code readability can be allowed to greatly improve.

6页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:环境光信息确定方法、装置、电子设备和存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!