CN103617220A - Method and device for implementing mobile terminal 3D (three dimensional) model - Google Patents

Method and device for implementing mobile terminal 3D (three dimensional) model Download PDF

Info

Publication number
CN103617220A
CN103617220A CN201310598189.4A CN201310598189A CN103617220A CN 103617220 A CN103617220 A CN 103617220A CN 201310598189 A CN201310598189 A CN 201310598189A CN 103617220 A CN103617220 A CN 103617220A
Authority
CN
China
Prior art keywords
axis
axle
coordinate
texture
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201310598189.4A
Other languages
Chinese (zh)
Other versions
CN103617220B (en
Inventor
陈轶
吴远青
王玮
潘腾
郭伟
王旭东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zhang Kuo Mobile Media Science And Technology Ltd
Original Assignee
Beijing Zhang Kuo Mobile Media Science And Technology Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zhang Kuo Mobile Media Science And Technology Ltd filed Critical Beijing Zhang Kuo Mobile Media Science And Technology Ltd
Priority to CN201310598189.4A priority Critical patent/CN103617220B/en
Publication of CN103617220A publication Critical patent/CN103617220A/en
Application granted granted Critical
Publication of CN103617220B publication Critical patent/CN103617220B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures

Abstract

The invention discloses a method and a device for implementing a mobile terminal 3D (three dimensional) model. The method includes: allowing a terminal parser to acquire and parse a 3D description file, wherein the 3D description file comprises maximum and minimum values, total number of vertex coordinates, the vertex coordinates, texture coordinates and texture image information of an x-axis, a y-axis and a z-axis of material information; reading the maximum and minimum values of the x-axis, the y-axis and the z-axis; reading the total numbers of the vertex coordinates, distributing cache spaces according to the total number of the vertexes and storing the specific vertex coordinates and the texture coordinates information into the cache spaces; based on the maximum and minimum values of the x-axis, the y-axis and the z-axis, initializing a renderer; querying the 3D description file and judging whether a triangular drawing mode exists or not, and if yes, drawing the corresponding 3D model based on the triangular drawing mode and the total number of the vertex coordinates, the vertex coordinates, the texture coordinates and texture image information.

Description

A kind of mobile terminal 3D model implementation method and device
Technical field
The invention belongs to field of mobile terminals, relate to a kind of 3D model implementation method and device being applied in field of mobile terminals.
Background technology
Along with prevailing of iPhone in 2007, smart mobile phone heat has been risen in the whole world now.People in daily life, can, by surfing the Net on smart mobile phone, play various application.According to some survey institute, observe, maximum application type that people use on smart mobile phone is game class application.And along with the performance of smart mobile phone processor promotes day by day, a lot of game all start 3D and changed, and the adline that some well-known moving advertising platforms are also prepared to release based on 3D model display to carry out interaction with user.Therefore, on handheld mobile device, show that 3D model has been an inevitable trend.
Yet, although the performance of mobile device processor is progressively being strengthened, consider the factors such as cruising time, power consumption, heating of mobile device overriding concern, they must be so powerful as desktop computer processor performance.And at present on the market general for the 3D-OBJ file of describing 3D object model originally for desktop computer processor is developed customization, and be adapted to old, too fat to move OpenGL standard.And graphic process unit in handheld device is only supported the OpenGL standard of lightweight, i.e. OpenGL ES.Therefore, provide a kind of 3D model description form that is applicable to mobile device end here.
Existing 3D-OBJ file has following three significant deficiency:
1, when equipment end is resolved this form, memory source consumption is serious.Owing to not listing model vertices number, normal number, texture coordinate number and vertex index number in file layout, so equipment end be when will resolve, or very large internal memory of first to file, the memory block that so much sub-distribution is little.For the former mode, this itself is exactly the waste to memory source.Consider order
The internal memory of front most of mobile device is all below 512MB, and the memory headroom of distributing to each application often connect 50MB less than, therefore when the summit element described in background application more than one and current 3D-OBJ file is more than one, be easy to occur making because of low memory the phenomenon of current application collapse.And if employing the latter's mode can make the memory pool of system there will be many rubbish fragments because too much internal memory is done to dynamic assignment, this problem is particularly outstanding for Android system.This format specification is by clearly listing apex coordinate number, texture coordinate number in file beginning, make equipment end can just distribute the needed memory source of depositing vertex coordinates data and texture coordinate data in current description document, can not cause the waste of memory source.
2, form itself redundancy too.Because the corresponding corresponding sign in each provisional capital of current 3D-OBJ description document is apex coordinate or method line coordinates or texture coordinate etc. to distinguish.This not only can strengthen the size of description document, and brings extra burden can to the parsing of equipment end.This format specification removes unnecessary minute quasiprefix by added once sign before a certain category information, and file size is greatly reduced.Can pass through quickly 2G or 3G network download file like this, and equipment end also can be removed resolution file quickly.
3 and be not suitable for the OpenGL ES standard of mobile device end.Because current 3D-OBJ description document is to describe based on too fat to move old OpenGL standard, therefore there is the unwanted attribute of a lot of OpenGL ES standard.
Summary of the invention
Technical matters to be solved by this invention is overcome old OpenGL standard and be not suitable for mobile terminal, for this reason, provides a kind of new 3D description document, and mobile terminal 3D model implementation method and the device based on described 3D description document is provided accordingly.
It is as follows that the present invention solves the problems of the technologies described above taked technical scheme:
A mobile terminal 3D model implementation method, comprising:
Terminal parses device obtains and resolves 3D description document, and described 3D description document comprises:
The minimum and maximum value of the material information of 3D model, x axle, y axle, z axle, apex coordinate sum, apex coordinate, texture coordinate and texture picture information;
Read the minimum and maximum value of x-axis, y-axis and z-axis;
Read apex coordinate sum, according to summit sum, distribute spatial cache, and concrete apex coordinate and texture coordinate information are put among described spatial cache;
Minimum and maximum value initialization renderer based on described x axle, y axle, z axle;
Whether inquiry 3D description document judgement wherein comprise triangle drawing mode, when getting triangle drawing mode, the sum based on described leg-of-mutton drawing mode and apex coordinate, apex coordinate, texture coordinate information and texture picture are drawn corresponding 3D model.
Wherein, described initialization renderer, comprising:
According to mobile phone screen size, create and distribute viewport big or small; According to the minimum and maximum value of x-axis, y-axis and z-axis, rectangular projection conversion is set.
Wherein, according to the minimum and maximum value of x-axis, y-axis and z-axis, rectangular projection conversion is set, comprises:
Obtain object at the total length of x-axis, y-axis and z-axis, and the total length based on separately creates the two ends coordinate of corresponding x axle, y axle, z axle respectively.
Wherein, in described 3D description document, based on an identifier, defining follow-up numeral is respectively vertex information, apex coordinate information and texture coordinate information.
Wherein, the number of described texture coordinate and apex coordinate is corresponding with order, and in described spatial cache, the mode based on linear memory is stored described texture coordinate and apex coordinate information.
Wherein, described 3D descriptive model generates the conversion of 3D-OBJ file and the filtration of Blender3D by filtrator, comprising:
Read the vertex coordinates data in 3D-OBJ file, and add up the minimum and maximum value of its sum and x-axis, y-axis and z-axis;
Read texture coordinate data and index data in 3D-OBJ file, and generate the texture coordinate data corresponding with described apex coordinate order according to the order of index data and vertex coordinates data;
Output packet is containing the 3D description document of the minimum and maximum value of apex coordinate sum, x-axis, y-axis and z-axis, coordinate data, vertex coordinates data.
When obtaining less than triangle Graphics Mode from described 3D description document, enable the triangle Graphics Mode of acquiescence and draw.
A mobile terminal 3D model realization device, comprising: terminal parses device, for terminal parses device, obtain and resolve 3D description document, and described 3D description document comprises:
The minimum and maximum value of the material information of 3D model, triangle drawing mode, x axle, y axle, z axle, apex coordinate sum, apex coordinate, texture coordinate and texture picture information;
Read the minimum and maximum value of described x-axis, y-axis and z-axis;
Read apex coordinate sum, according to summit sum, distribute spatial cache, and concrete apex coordinate and texture coordinate information are put among described spatial cache;
Renderer, for the minimum and maximum value initialization based on described x axle, y axle, z axle;
Drafting module, be used for inquiring about 3D description document and judge and wherein whether comprise triangle drawing mode, when getting triangle drawing mode, the sum based on described leg-of-mutton drawing mode and apex coordinate, apex coordinate, texture coordinate information and texture picture are drawn corresponding 3D model.
Wherein, described renderer is further used for creating and distributing viewport big or small according to mobile phone screen size; According to the minimum and maximum value of x-axis, y-axis and z-axis, rectangular projection conversion is set.
Wherein, described renderer, arranges rectangular projection conversion according to the minimum and maximum value of x-axis, y-axis and z-axis, comprising:
Obtain object at the total length of x-axis, y-axis and z-axis, and the total length based on separately creates the two ends coordinate of corresponding x axle, y axle, z axle respectively.
The present invention has taked technique scheme to have following technique effect:
The present invention has overcome in 3D description document does not originally have number of vertices total, therefore client can only be added up by resolving line by line each summit the shortcoming of summit sum, thus, the consistance linear memory that it can be based on apex coordinate and texture coordinate has utilized memory headroom maximumly.
In addition,, in new 3D description document, provide maximal value and the minimum value of x axle, y axle and z axle.Therefore need to when client is resolved apex coordinate, not add up, and can determine needed viewport Aspect Ratio and the needed parameters of orthogonal transformation of corresponding 3D model quickly.
In addition, reserving at the beginning the analytics engine that apex coordinate number also makes client does not need to add up apex coordinate number, and writes data by linear memory space, promotes memory access efficiency, thereby has promoted the treatment effeciency of processor yet.
Other features and advantages of the present invention will be set forth in the following description, and, partly from instructions, become apparent, or understand by implementing the present invention.Object of the present invention and other advantages can be realized and be obtained by specifically noted structure in the instructions write, claims and accompanying drawing.
Accompanying drawing explanation
Below in conjunction with accompanying drawing, the present invention is described in detail, so that above-mentioned advantage of the present invention is clearer and more definite.Wherein,
Fig. 1 is the schematic flow sheet of mobile terminal 3D model implementation method of the present invention;
Fig. 2 is the schematic diagram of the first Graphics Mode in the 3D description document in mobile terminal 3D model implementation method of the present invention;
Fig. 3 is the schematic diagram of the first Graphics Mode in the 3D description document in mobile terminal 3D model implementation method of the present invention;
Fig. 4 is the schematic diagram of the first Graphics Mode in the 3D description document in mobile terminal 3D model implementation method of the present invention;
Fig. 5 is the schematic diagram of the analytic method of mobile terminal 3D model implementation method of the present invention;
Fig. 6 is the example model figure of mobile terminal 3D model implementation method of the present invention;
Fig. 7 is the structural representation of mobile terminal 3D model realization device of the present invention.
Embodiment
Below with reference to drawings and Examples, describe embodiments of the present invention in detail, to the present invention, how application technology means solve technical matters whereby, and the implementation procedure of reaching technique effect can fully understand and implement according to this.It should be noted that, only otherwise form conflict, each embodiment in the present invention and each feature in each embodiment can mutually combine, and formed technical scheme is all within protection scope of the present invention.
In addition, in the step shown in the process flow diagram of accompanying drawing, can in the computer system such as one group of computer executable instructions, carry out, and, although there is shown logical order in flow process, but in some cases, can carry out shown or described step with the order being different from herein.
Wherein, OpenGL: open GL;
OpenGL ES: for the lightweight OpenGL standard of handheld mobile device graphic process unit;
3D-OBJ file: a kind of description can be processed by computing machine the file layout of the three-dimensional object model displaying;
ASCII: American National Standard permutation code;
UTF-8 is a kind of variable-length encoding for international uniform coding.For the binary coding of a plurality of bytes is mapped to our conventional linguistic notation.
The triangle drawing mode defining in OpenGL (ES) standard has two kinds of GL_TRIANGLES and GL_TRIANGLE_STRIP.GL_TRIANGLES is plotted as a triangle to every three summits.GL_TRIANGLE_STRIP: has drawn after a triangle on first three summit, the adjacent side that the 4th summit forms along the first two summit reconstructs a new triangle.
Wherein, the present invention is directed to the shortcoming of existing 3D-OBJ file, a kind of new format specification is provided, and it is applicable to the OpenGL ES standard that graphic process unit that handheld mobile device end adopts is supported completely, and method line coordinates and vertex index part are rejected completely.Make like this description document size further reduce again, and make the resolution speed of equipment end faster, more power saving.
Just introduce the 3D-OBJ file layout definition that is adapted to mobile device end below.
First, this 3D-OBJ file is a text.It can use common text editor to open to check the content of its inside in any operating system, and character code generally adopts ASCII or UTF-8 coding.Below this 3D-OBJ file is called to description document simply.
Then, this description document does not need to define method line coordinates.Therefore, the order of given apex coordinate should meet renderer and will using the counterclockwise spiral of right hand order as drawing triangle requirement sequentially.Because OpenGL ES standard is not supported tetragonal drafting, so the drawing mode of apex coordinate must be triangle drawing mode (being GL_TRIANGLES or GL_TRIANGLE_STRIP).
Wherein, description document is comprised of following element:
1, annotation: annotation represents with pound sign symbol #.# is often immediately following after a newline.Annotation stays a little promptings only to the people who sees, does not contain any significant information for the content that will resolve.Such as:
The copyright Jin Wei XXX company of this 3D of # model is all
After being resolved to # character, neglect its all characters below, until meet a newline.This description document regulation and stipulation, before annotation symbol # or be newline (n), or is space character or tab (tab, t), if other character, # forms other Word message together with these Connection operators.Resolver runs into this situation also can end the parsing to this description document.
2, identifier: identifier is also often immediately following after a newline.This has described normalized definition some fixing identifiers, they represent the implication that the word of following after it or numeral are endowed.Such as: minx represents the minimum value in all x axial coordinates of the described 3D model of this description document; Cv represents the sum of all number of vertices in 3D model.The spelling of identifier must be in strict accordance with the defined appearance of standard.Identifier is the same with annotation symbol, must only follow after carriage return character, space character or tab.If have other character before identifier, this character be connected with identifier, as other Word message.When encountering this situation, resolver can stop the parsing to this description document.If with having word or numerical information, must separate with space character between identifier and these information so after identifier, certainly also allow a plurality of space characters of use (such as:
Minx10.1 or minx 10.1 are legal).
3, numeral: numeral conventionally by-,+. and 0~9 arabic numeral form.A complete number (comprising decimal) is followed conventionally after newline, space character, tab.If there is other character before numeral, so this numeral should with together with Connection operator above as other Word message.And-with+number must be as number prefix.If resolver resolves to forbidden digit (such as: 1.23+456), central unallowable instruction digit can be neglected so to (such as that number is just now resolved to 1.23456), or also can directly end to resolve.
Introduce in detail the identifier of description document below.
1, mtllib---this identifier represents that the information of following is a material template base filename below.The directory path at material template base file place should be identical with the directory path at current description document place.Therefore, by the Word message after mtllib, just can find corresponding material template base file.Material template base file is deferred to the standard described in original 3D-OBJ standard.Specifically can reference: http://en.wikipedia.org/wiki/Wavefront_.obj_file#Material_templ ate_library.This identifier with between Word message, should separate with one or more space characters below.Such as: mtllib face.mtl
2, trgs---the renderer that represents client is used GL_TRIANGLES pattern to draw the summit of 3D model.After this identifier, do not need, with out of Memory, can directly follow newline.
3, trsp---the renderer that represents client is used GL_TRIANGLE_STRIP pattern to draw the summit of 3D model.And after this identifier, do not need, with out of Memory, can directly follow newline.If it is found that identifier trgs or trsp do not have in whole description document, adopting the render mode of acquiescence is so GL_TRIANGLES pattern.
Wherein, the difference of these two patterns is shown in shown in Fig. 2 and Fig. 3:
Here, Fig. 2 uses is that of GL_TRIANGLES drawing mode being comprised of three triangles of drawing is trapezoidal, and one has shared 9 summits.Summit BAC has formed first blue triangle; Summit DEF has formed second pink colour triangle; Summit HGI has formed the 3rd yellow triangle.And Fig. 3 uses, be GL_TRIANGLE_STRIP drawing mode, be equally also by three triangles formed one trapezoidal.But, just used altogether 5 summits here, than Fig. 2 few, nearly used half.Summit BAC has formed first blue triangle; And the 4th summit D afterwards formed second pink colour triangle with blue leg-of-mutton adjacent side BC above; And the leg-of-mutton adjacent side DC of the 5th summit E and previous pink colour has formed the 3rd yellow triangle.Visible, for drawing a same object, adopt GL_TRIANGLE_STRIP pattern can save a lot of summits.And if draw two independent figures, in OpenGL ES, there is so new pattern to adopt, as shown in Figure 4.
In upper figure, drawn two separated trapezoidal.Here, only previous last trapezoidal summit need to be copied to one, then rear first trapezoidal summit be copied to one, so just can draw out easily two separated trapezoidal.Do like this with respect to adopting GL_TRIANGLES drawing mode and can save a lot of summits equally.
Minimum value in all apex coordinates of the number expression 3D model that 4, minx---minx follows below on x axle.
Maximal value in all apex coordinates of the number expression 3D model that 5, maxx---maxx follows below on x axle.
Minimum value in all apex coordinates of the number expression 3D model that 6, miny---miny follows below on y axle.
Maximal value in all apex coordinates of the number expression 3D model that 7, maxy---maxy follows below on y axle.
Minimum value in all apex coordinates of the number expression 3D model that 8, minz---minz follows below on z axle.
Maximal value in all apex coordinates of the number expression 3D model that 9, maxz---maxz follows below on z axle.
The summit sum of 10, cv---3D model.
11, v---apex coordinate.This regulation and stipulation is described an apex coordinate by three components, formed, from left to right with this, represent value on the x axle of summit, value on y axle and the value on z axle.Between each component, with space character, separate (can have a plurality of).Between adjacent two summits, by newline (n), separated.Such as:
v
10.01?27.15-20.69
18.97?20.35-20.24
15.31?24.00-18.45
Above-mentioned example has been described a triangle consisting of three summits.Wherein the coordinate on first summit is (10.01,27.15 ,-20.69); The coordinate on last summit is (15.31,24.00 ,-18.45).
12, t---texture coordinate.This regulation and stipulation is described a texture coordinate by two components, formed, from left to right with this, represent value on texture x axle and the value on y axle.Between each component, with space character, separate (can have a plurality of).Between each texture coordinate, with newline (n), separate.Texture coordinate value, according to traditional standard, should be normalized in [0,1] scope.Such as:
t
0.38?0.19
0.43?0.16
0.39?0.19
Above example has been described corresponding to leg-of-mutton 3 texture coordinates.First texture coordinate correspondence first summit; Last texture coordinate correspondence last summit.Therefore there are how many apex coordinates just to have how many texture coordinates.
With a comparatively complete example, this 3D description document is once described below:
#Blender3D?v249OBJ?File:
#www.blender3d.org
mtllib?face.mtl
trgs
minx?141.467346
maxx?148.977325
miny?23.974377
maxy?29.108953
minz?-32.562725
maxz?-29.678705
cv?6
v
144.001602?27.246269-32.562725
148.977325?23.974377-32.245533
145.471344?26.611320-29.678705
144.001602?27.246269-32.562725
145.471344?26.611320-29.678705
141.467346?29.108953-30.494118
t
0.385269?0.197682
0.434844?0.168615
0.399913?0.192041
0.385269?0.197682
0.399913?0.192041
0.360020?0.214230
It is exactly more than the introduction to this 3D description file format.
Introduce equipment end below and how this description document is resolved, because the order of the descriptor of above-mentioned information is removable, so resolver should carry out document analysis by state machine mechanism.State machine diagram is as shown in Figure 6:
Wherein, upper figure has described annotation symbol (#) and the parse state flow process to material file name identifier.Other identifier can the rest may be inferred.Parsing and other abnormality processing to space-separated symbol omitted in this constitutional diagram.Developer can and apply adaptable situation and do respective handling according to the previous described rule of this standard.
After resolver has successfully been resolved description document, just can obtain material information, triangle drawing mode, the maximin of x axle, the maximin of the maximin of y axle, z axle, summit sum, apex coordinate and these information of texture coordinate of 3D model.Renderer can be determined viewport (view port) size by the maximin of x, y axle; And can determine that by the maximin of x, y and z axle orthogonal view converts needed parameter.Resolver is before obtaining apex coordinate and texture coordinate, by distributing according to need and deposit apex coordinate and the needed cache size of texture coordinate after cv identifier acquisition number of vertices.Therefore, this 3D model description file greatly facilitates the processing of resolver and renderer, has reduced the parsing of many extra judgements and redundant information.
Specifically, as shown in Figure 1, described mobile terminal 3D model implementation method, specifically comprises:
Step 1: terminal parses device obtains and resolve 3D description document, described 3D description document comprises:
The minimum and maximum value of the material information of 3D model, x axle, y axle, z axle, apex coordinate sum, apex coordinate, texture coordinate and texture picture information;
Step 2: the minimum and maximum value that reads x-axis, y-axis and z-axis;
Step 3: read apex coordinate sum, distribute spatial cache according to summit sum, and concrete apex coordinate and texture coordinate information are put among described spatial cache;
Step 4: the minimum and maximum value initialization renderer based on described x axle, y axle, z axle, wherein, comprising:
According to mobile phone screen size, create and distribute viewport big or small; According to the minimum and maximum value of x axle, y axle and y axle, rectangular projection conversion is set, for example, obtains object at the total length of x-axis, y-axis and z-axis, and the total length based on separately creates the two ends coordinate of corresponding x axle, y axle, z axle respectively.
Step 5: whether inquiry 3D description document judgement wherein comprise triangle drawing mode, when getting triangle drawing mode, the sum based on described leg-of-mutton drawing mode and apex coordinate, apex coordinate, texture coordinate information and texture picture are drawn corresponding 3D model.
In an embodiment, the order of apex coordinate should meet renderer and will using the counterclockwise spiral of right hand order as drawing triangle requirement sequentially.
Wherein, according to above-mentioned standard, in an embodiment, in described 3D description document, based on an identifier, defining follow-up numeral is respectively vertex information, apex coordinate information and texture coordinate information, thus, has omitted the identifier before existing apex coordinate information and texture coordinate information, saved the size of this description document, facilitated data transmission and read.
Wherein, according to the description of above-mentioned standard, the number of described texture coordinate and apex coordinate is corresponding with order, and in described spatial cache, based on linear memory mode, stores described texture coordinate and apex coordinate information, and thus, it has reduced the generation of fragment.
Below by introducing an example, introduce this 3D description from being generated to last 3D graphic plotting process out.
First, can download to the 3D-OBJ file of traditional standard on the net, what this document was described is the 3D model of people's face, is below partial data content:
#Blender3D?v249OBJ?File:
#www.blender3d.org
mtllib?face.mtl
v?148.977325?23.974377-32.245533
v?145.471344?26.611320-29.678705
v?144.001602?27.246269-32.562725
v?141.467346?29.108953-30.494118
(omitting below)
vt?0.385269?0.197682
vt?0.434844?0.168615
vt?0.399913?0.192041
vt?0.360020?0.214230
(omitting below)
usemtl?ID5_texture0.jpg
s?off
f?3/1?1/2?2/3
f?3/1?2/3?4/4
f?5/5?1/2?3/1
f?2/3?1/2?6/6
(omitting below)
In an embodiment, described 3D descriptive model generates the conversion of 3D-OBJ file and the filtration of Blender3D by filtrator, comprising:
Read the vertex coordinates data in 3D-OBJ file, and add up the minimum and maximum value of its sum and x-axis, y-axis and z-axis;
Read texture coordinate data and index data in 3D-OBJ file, and generate the texture coordinate data corresponding with described apex coordinate order according to the order of index data and vertex coordinates data;
Output packet is containing the 3D description document of minimum and maximum value, coordinate data, vertex coordinates data and the triangle Graphics Mode of apex coordinate sum, x-axis, y-axis and z-axis.
For example, we write a filtrator on Mac or PC, transfer this traditional 3D description document to our defined 3D description document.
First, resolve the data with v.These represent apex coordinate, after the maximin of its sum and x axle, y axle and z axle is come out, first save.
Then resolve vt data, these represent texture coordinate data, but are noted that these texture coordinates and apex coordinate are not one to one here, therefore also need by resolving f data, index data is determined the corresponding relation of texture coordinate and apex coordinate.
Such as the f 3/1 1/2 2/3 of f data the first row, represent that the 3rd apex coordinate is corresponding with the 1st texture coordinate; 1/2 represents that the 1st apex coordinate is corresponding with second texture coordinate; 2/3 represents that the 2nd apex coordinate is corresponding with the 3rd texture coordinate.And this group index is owing to being the first row, therefore just in time corresponding vertex order is 1,2,3.
The form of the 3D description document that we just can define according to us after apex coordinate and texture coordinate having been added up by above step be exported, and is below partial data content:
#?Blender3D?v249?OBJ?File:
#?www.blender3d.org
mtllib?face.mtl
trgs
minx?116.051117
maxx?195.929230
miny?-0.000001
maxy?113.865570
minz?-50.442886
maxz?3.899105
cv?27837
v
144.001602?27.246269?-32.562725
148.977325?23.974377?-32.245533
145.471344?26.611320?-29.678705
144.001602?27.246269?-32.562725
(omitting below remaining apex coordinate information)
t
0.385269?0.197682
0.434844?0.168615
0.399913?0.192041
0.385269?0.197682
(omitting below remaining texture coordinate information)
Like this, we just can be applied in this 3D description document on our mobile device, thus, after equipment end obtains this description document, start it to resolve.
We first inquire about triangle drawing mode from 3D description document, and the maximin of x-axis, y-axis and z-axis, wherein, when not obtaining, enable the triangle Graphics Mode of acquiescence.
Then, when we are resolved to apex coordinate sum, resolver will distribute the storage space of corresponding size to deposit apex coordinate and texture coordinate.Here one having 27837 summits, will be therefore memory allocation 27837*3*4 byte of apex coordinate.Apex coordinate of 3 expressions here has 3 components, represents respectively the information of x axle, y axle and z axle; The 4 expression one-component data are here represented by a single-precision floating point, take 4 bytes.And the storage space of texture coordinate need to distribute 27837*2*4 byte, because texture coordinate only needs 2 components, represent respectively the axial coordinate of x axle and y.Subsequently, we just can be respectively put concrete apex coordinate and texture coordinate into just now distributed storage space and have suffered.
Finally, after the complete needed data of resolver resolves, just can initialization renderer.At first, distribute viewport (view port) size, according to mobile phone screen size, create here.
Subsequently, we arrange rectangular projection conversion according to the maximin of x axle and y axle.Here object is (195.929230-116.051117) at the axial total length of x, therefore leftmost coordinate can be set to-(195.929230-116.051117), rightmost coordinate can be set to (195.929230-116.051117).The axial length of y is (113.865570--0.000001), thus the coordinate of bottommost can be set to-(113.865570--0.000001), the coordinate of top can be set to (113.865570--0.000001).The degree of depth is (3.899105--50.442886).Therefore, coordinate can be set to 1.0 recently, and coordinate can be set to (3.899105--50.442886-1) farthest.
After completing these, our number by apex coordinate and apex coordinate and the specifying information of texture coordinate, according to leg-of-mutton drawing mode and needed texture picture by 3D modeling rendering out, thus, the model of having drawn can do according to application self-demand rotate, the conversion such as translation.
Wherein, because 3D description document originally contains bulk redundancy information, such as the normal line vector information there is no need, before each apex coordinate and texture coordinate, to add identifier, can make in addition client resolve the face index information that becomes and bother very much.After these information are all removed, descriptor file is can be little a lot, especially when time during GL_TRIANGLE_STRIP pattern.Description document one is little, if the needed flow of words of downloading from network will reduce, download time also can shorten.
In addition, it is large that the method has also reduced the required memory headroom of client, and owing to there is no number of vertices sum in 3D description document originally, so client can only add up summit sum by resolving line by line each summit.Now, generally adopt linked list data structure to deposit vertex information, if summit more than, the little Memory Allocation of thousands of times can cause many memory fragmentations, and memory usage is reduced greatly.And new description document provides summit sum, and stipulations the consistance of apex coordinate and texture coordinate.Therefore, the linear memory headroom of only need to distributing according to need at the beginning can have been deposited vertex coordinates data and texture coordinate data.Such memory headroom that utilized maximumly.
And the method is accelerated the parsing time of equipment end, as this description document previously just provided maximal value and the minimum value of x axle, y axle and z axle.Therefore need to when client is resolved apex coordinate, not add up, and can determine needed viewport Aspect Ratio and the needed parameters of orthogonal transformation of corresponding 3D model quickly.In addition, reserving at the beginning the analytics engine that apex coordinate number also makes client does not need to add up apex coordinate number, and writes data by linear memory space, promotes memory access efficiency, thereby has promoted the treatment effeciency of processor yet.
In addition, it should be noted that among this method, the identifier that description document provides, separator etc. are only samples.Developer can define the separator between identifier and each element according to own demand.Meanwhile, identifier except apex coordinate information identifier (v) with texture coordinate information identifier (t) must appear at summit sum identifier (cv) afterwards, other identifier is switch mutually.
Corresponding with the inventive method, the present invention also provides a kind of mobile terminal 3D model realization device, and corresponding with method, as shown in Figure 7, it comprises:
Terminal parses device, obtains and resolves 3D description document for terminal parses device, and described 3D description document comprises:
The minimum and maximum value of the material information of 3D model, triangle drawing mode, x axle, y axle, z axle, apex coordinate sum, apex coordinate, texture coordinate and texture picture information;
Read the minimum and maximum value of described x-axis, y-axis and z-axis;
Read apex coordinate sum, according to summit sum, distribute spatial cache, and concrete apex coordinate and texture coordinate information are put among described spatial cache;
Renderer, for the minimum and maximum value initialization based on described x axle, y axle, z axle;
Drafting module, be used for inquiring about 3D description document and judge and wherein whether comprise triangle drawing mode, when getting triangle drawing mode, the sum based on described leg-of-mutton drawing mode and apex coordinate, apex coordinate, texture coordinate information and texture picture are drawn corresponding 3D model.
Wherein, described renderer is further used for creating and distributing viewport big or small according to mobile phone screen size; According to the minimum and maximum value of x-axis, y-axis and z-axis, rectangular projection conversion is set.
Wherein, described renderer, arranges rectangular projection conversion according to the minimum and maximum value of x-axis, y-axis and z-axis, comprising:
Obtain object at the total length of x-axis, y-axis and z-axis, and the total length based on separately creates the two ends coordinate of corresponding x axle, y axle, z axle respectively.
Apparatus of the present invention have the effect that said method embodiment is identical, be that the present invention has overcome and in 3D description document, there is no number of vertices sum originally, therefore client can only be added up by resolving line by line each summit the shortcoming of summit sum, thus, its can be based on apex coordinate and texture coordinate consistance linear memory, utilized memory headroom maximumly.
In addition,, in new 3D description document, provide maximal value and the minimum value of x axle, y axle and z axle.Therefore need to when client is resolved apex coordinate, not add up, and can determine needed viewport Aspect Ratio and the needed parameters of orthogonal transformation of corresponding 3D model quickly.
It should be noted that, for said method embodiment, for simple description, therefore it is all expressed as to a series of combination of actions, but those skilled in the art should know, the application is not subject to the restriction of described sequence of movement, because according to the application, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in instructions all belongs to preferred embodiment, and related action and module might not be that the application is necessary.
Those skilled in the art should understand, the application's embodiment can be provided as method, system or computer program.Therefore, the application can adopt complete hardware implementation example, implement software example or in conjunction with the form of the embodiment of software and hardware aspect completely.
And the application can adopt the form that wherein includes the upper computer program of implementing of computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) of computer usable program code one or more.
Finally it should be noted that: the foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, although the present invention is had been described in detail with reference to previous embodiment, for a person skilled in the art, its technical scheme that still can record aforementioned each embodiment is modified, or part technical characterictic is wherein equal to replacement.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.

Claims (10)

1. a mobile terminal 3D model implementation method, is characterized in that, comprising:
Terminal parses device obtains and resolves 3D description document, and described 3D description document comprises:
The minimum and maximum value of the material information x axle of 3D model, y axle, z axle, apex coordinate sum, apex coordinate, texture coordinate and texture picture information;
Read the minimum and maximum value of x-axis, y-axis and z-axis;
Read apex coordinate sum, according to summit sum, distribute spatial cache, and concrete apex coordinate and texture coordinate information are put among described spatial cache;
Minimum and maximum value initialization renderer based on described x axle, y axle, z axle;
Whether inquiry 3D description document judgement wherein comprise triangle drawing mode, when getting triangle drawing mode, the sum based on described leg-of-mutton drawing mode and apex coordinate, apex coordinate, texture coordinate information and texture picture are drawn corresponding 3D model.
2. mobile terminal 3D model implementation method according to claim 1, is characterized in that, described initialization renderer, comprising:
According to mobile phone screen size, create and distribute viewport big or small; According to the minimum and maximum value of x-axis, y-axis and z-axis, rectangular projection conversion is set.
3. mobile terminal 3D model implementation method according to claim 2, is characterized in that, according to the minimum and maximum value of x-axis, y-axis and z-axis, rectangular projection conversion is set, and comprising:
Obtain object at the total length of x-axis, y-axis and z-axis, and the total length based on separately creates the two ends coordinate of corresponding x axle, y axle, z axle respectively.
4. mobile terminal 3D model implementation method according to claim 1 and 2, is characterized in that, in described 3D description document, based on an identifier, defining follow-up numeral is respectively vertex information, apex coordinate information and texture coordinate information.
5. mobile terminal 3D model implementation method according to claim 1 and 2, it is characterized in that, the number of described texture coordinate and apex coordinate is corresponding with order, and in described spatial cache, the mode based on linear memory is stored described texture coordinate and apex coordinate information.
6. mobile terminal 3D model implementation method according to claim 1, is characterized in that, described 3D descriptive model generates the conversion of 3D-OBJ file and the filtration of Blender3D by filtrator, comprising:
Read the vertex coordinates data in 3D-OBJ file, and add up the minimum and maximum value of its sum and x-axis, y-axis and z-axis;
Read texture coordinate data and index data in 3D-OBJ file, and generate the texture coordinate data corresponding with described apex coordinate order according to the order of index data and vertex coordinates data;
Output packet is containing the 3D description document of the minimum and maximum value of apex coordinate sum, x-axis, y-axis and z-axis, coordinate data, vertex coordinates data.
7. mobile terminal 3D model implementation method according to claim 1, is characterized in that, when obtaining less than triangle Graphics Mode from described 3D description document, enables the triangle Graphics Mode of acquiescence and draws.
8. a mobile terminal 3D model realization device, is characterized in that, comprising: terminal parses device, for terminal parses device, obtain and resolve 3D description document, and described 3D description document comprises:
The minimum and maximum value of the material information of 3D model, x axle, y axle, z axle, apex coordinate sum, apex coordinate, texture coordinate and texture picture information;
Read the minimum and maximum value of x-axis, y-axis and z-axis;
Read apex coordinate sum, according to summit sum, distribute spatial cache, and concrete apex coordinate and texture coordinate information are put among described spatial cache;
Renderer, for the minimum and maximum value initialization based on described x axle, y axle, z axle;
Drafting module, be used for inquiring about 3D description document and judge and wherein whether comprise triangle drawing mode, when getting triangle drawing mode, the sum based on described leg-of-mutton drawing mode and apex coordinate, apex coordinate, texture coordinate information and texture picture are drawn corresponding 3D model.
9. mobile terminal 3D model realization device according to claim 8, is characterized in that, described renderer is further used for creating and distributing viewport big or small according to mobile phone screen size; According to the minimum and maximum value of x-axis, y-axis and z-axis, rectangular projection conversion is set.
10. mobile terminal 3D model realization device according to claim 8 or claim 9, is characterized in that, described renderer arranges rectangular projection conversion according to the minimum and maximum value of x-axis, y-axis and z-axis, comprising:
Obtain object at the total length of x-axis, y-axis and z-axis, and the total length based on separately creates the two ends coordinate of corresponding x axle, y axle, z axle respectively.
CN201310598189.4A 2013-11-22 2013-11-22 Method and device for implementing mobile terminal 3D (three dimensional) model Active CN103617220B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310598189.4A CN103617220B (en) 2013-11-22 2013-11-22 Method and device for implementing mobile terminal 3D (three dimensional) model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310598189.4A CN103617220B (en) 2013-11-22 2013-11-22 Method and device for implementing mobile terminal 3D (three dimensional) model

Publications (2)

Publication Number Publication Date
CN103617220A true CN103617220A (en) 2014-03-05
CN103617220B CN103617220B (en) 2017-01-18

Family

ID=50167923

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310598189.4A Active CN103617220B (en) 2013-11-22 2013-11-22 Method and device for implementing mobile terminal 3D (three dimensional) model

Country Status (1)

Country Link
CN (1) CN103617220B (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104657094A (en) * 2015-01-30 2015-05-27 深圳市亿思达科技集团有限公司 3D (three dimensional) printing method and 3D printing system
CN104679458A (en) * 2015-01-30 2015-06-03 深圳市亿思达科技集团有限公司 3D (three-dimensional) model forming method and terminal equipment
CN104731535A (en) * 2015-01-30 2015-06-24 深圳市亿思达科技集团有限公司 Manufacturing method of geometric object and 3D printing system
CN105094718A (en) * 2015-07-30 2015-11-25 广州海葳特电脑科技有限公司 Method for 3D model adjustment based on mobile terminal and mobile terminal
CN105988745A (en) * 2015-01-30 2016-10-05 深圳市亿思达科技集团有限公司 Method and electronic device for printing three-dimensional articles
CN105988744A (en) * 2015-01-30 2016-10-05 深圳市亿思达科技集团有限公司 Method and equipment for manufacturing three-dimensional articles
CN105988743A (en) * 2015-01-30 2016-10-05 深圳市亿思达科技集团有限公司 Method for forming 3D (three-dimensional) models and 3D printing system
CN106815320A (en) * 2016-12-27 2017-06-09 华南师范大学 Based on the investigation big data visual modeling method and system of expanding stereogram
CN106959808A (en) * 2017-03-29 2017-07-18 王征 A kind of system and method based on gesture control 3D models
CN108460826A (en) * 2017-12-28 2018-08-28 深圳市创梦天地科技股份有限公司 A kind of processing method and terminal of 3D models
CN108876887A (en) * 2017-05-16 2018-11-23 北京京东尚科信息技术有限公司 rendering method and device
CN109215103A (en) * 2018-08-30 2019-01-15 西安恒歌数码科技有限责任公司 A kind of high-volume text rendering method based on OSG
CN109308734A (en) * 2017-07-27 2019-02-05 腾讯科技(深圳)有限公司 The generation method and its device of 3D text, equipment, storage medium
CN110784773A (en) * 2019-11-26 2020-02-11 北京奇艺世纪科技有限公司 Bullet screen generation method and device, electronic equipment and storage medium
US10997778B2 (en) 2016-11-26 2021-05-04 Huawei Technologies Co., Ltd. Method for generating three-dimensional model, and terminal device
CN113240786A (en) * 2021-05-10 2021-08-10 北京奇艺世纪科技有限公司 Video point cloud rendering method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102420839A (en) * 2010-09-27 2012-04-18 中国电信股份有限公司 Method and system for realizing browse of 3D (three-dimensional) model as well as server
US20120206572A1 (en) * 2011-02-10 2012-08-16 You I Labs, Inc. Method of calculating 3d object data within controllable constraints for fast software processing on 32 bit risc cpus
CN102693250A (en) * 2011-08-29 2012-09-26 新奥特(北京)视频技术有限公司 3D (three-dimensional) model file importing method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102420839A (en) * 2010-09-27 2012-04-18 中国电信股份有限公司 Method and system for realizing browse of 3D (three-dimensional) model as well as server
US20120206572A1 (en) * 2011-02-10 2012-08-16 You I Labs, Inc. Method of calculating 3d object data within controllable constraints for fast software processing on 32 bit risc cpus
CN102693250A (en) * 2011-08-29 2012-09-26 新奥特(北京)视频技术有限公司 3D (three-dimensional) model file importing method and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
李昂 等: "基于PDA的三维地形数据实时绘制方法研究", 《测绘科学》, vol. 34, no. 5, 30 September 2009 (2009-09-30), pages 78 - 80 *
许家帅: "三维地形表面的可视化实现", 《水道港口》, vol. 24, no. 1, 31 March 2003 (2003-03-31) *

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104657094A (en) * 2015-01-30 2015-05-27 深圳市亿思达科技集团有限公司 3D (three dimensional) printing method and 3D printing system
CN104679458A (en) * 2015-01-30 2015-06-03 深圳市亿思达科技集团有限公司 3D (three-dimensional) model forming method and terminal equipment
CN104731535A (en) * 2015-01-30 2015-06-24 深圳市亿思达科技集团有限公司 Manufacturing method of geometric object and 3D printing system
CN105988745A (en) * 2015-01-30 2016-10-05 深圳市亿思达科技集团有限公司 Method and electronic device for printing three-dimensional articles
CN105988744A (en) * 2015-01-30 2016-10-05 深圳市亿思达科技集团有限公司 Method and equipment for manufacturing three-dimensional articles
CN105988743A (en) * 2015-01-30 2016-10-05 深圳市亿思达科技集团有限公司 Method for forming 3D (three-dimensional) models and 3D printing system
CN105094718A (en) * 2015-07-30 2015-11-25 广州海葳特电脑科技有限公司 Method for 3D model adjustment based on mobile terminal and mobile terminal
US10997778B2 (en) 2016-11-26 2021-05-04 Huawei Technologies Co., Ltd. Method for generating three-dimensional model, and terminal device
CN106815320B (en) * 2016-12-27 2020-03-17 华南师范大学 Investigation big data visual modeling method and system based on expanded three-dimensional histogram
CN106815320A (en) * 2016-12-27 2017-06-09 华南师范大学 Based on the investigation big data visual modeling method and system of expanding stereogram
CN106959808A (en) * 2017-03-29 2017-07-18 王征 A kind of system and method based on gesture control 3D models
CN108876887A (en) * 2017-05-16 2018-11-23 北京京东尚科信息技术有限公司 rendering method and device
CN108876887B (en) * 2017-05-16 2021-12-14 北京京东尚科信息技术有限公司 Rendering method and device
CN109308734A (en) * 2017-07-27 2019-02-05 腾讯科技(深圳)有限公司 The generation method and its device of 3D text, equipment, storage medium
CN108460826A (en) * 2017-12-28 2018-08-28 深圳市创梦天地科技股份有限公司 A kind of processing method and terminal of 3D models
CN108460826B (en) * 2017-12-28 2022-04-15 深圳市创梦天地科技有限公司 3D model processing method and terminal
CN109215103A (en) * 2018-08-30 2019-01-15 西安恒歌数码科技有限责任公司 A kind of high-volume text rendering method based on OSG
CN110784773A (en) * 2019-11-26 2020-02-11 北京奇艺世纪科技有限公司 Bullet screen generation method and device, electronic equipment and storage medium
CN113240786A (en) * 2021-05-10 2021-08-10 北京奇艺世纪科技有限公司 Video point cloud rendering method and device, electronic equipment and storage medium
CN113240786B (en) * 2021-05-10 2023-06-13 北京奇艺世纪科技有限公司 Video point cloud rendering method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN103617220B (en) 2017-01-18

Similar Documents

Publication Publication Date Title
CN103617220A (en) Method and device for implementing mobile terminal 3D (three dimensional) model
CN104216691B (en) A kind of method and device for creating application
WO2022116759A1 (en) Image rendering method and apparatus, and computer device and storage medium
CN107154063A (en) The shape method to set up and device in image shows region
CN102708533B (en) Graphics process
CN101853162B (en) Method for rendering editable webpage three-dimensional (Web3D) geometric modeling
CN108205960B (en) Method and device for rendering characters, electronic map making system and navigation system
US10997778B2 (en) Method for generating three-dimensional model, and terminal device
US20180357776A1 (en) Vector graphics handling processes for user applications
CN109472847A (en) A kind of image processing method, system and terminal device
CN115328588A (en) Method and system for rendering OFD (office file) based on browser front end
CN114494024B (en) Image rendering method, device and equipment and storage medium
CN111737618A (en) Vector diagram display method and device for Web end and computer equipment
CN111190519A (en) File and control processing method, device, equipment and storage medium thereof
CN109634611B (en) Mobile terminal three-dimensional model ply file analysis and display method based on OpenGL
CN113553635A (en) Method and device for configuring graph base primitive, electronic equipment and storage medium
CN112614210A (en) Engineering drawing display method, system and related device
CN108733441A (en) A kind of rendering method for visualizing and system suitable for large scale electric network symbolic device
CN107391175A (en) Control data collocation method and computer-readable recording medium
CN115713572A (en) Text image generation method and device, electronic equipment and readable storage medium
CN115994517A (en) Information processing method, apparatus, storage medium, device, and program product
JP2022553251A (en) IMAGE PROCESSING METHOD, IMAGE PROCESSING APPARATUS, COMPUTER PROGRAM, AND ELECTRONIC DEVICE
CN113487708B (en) Flow animation implementation method based on graphics, storage medium and terminal equipment
KR102131190B1 (en) System for providing a 3d model in on-line
CN103838743A (en) Method, system and equipment for reading format documents online

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: 100026 Beijing city Chaoyang District River South Street No. 1102, the quintessence of yuan A block 3 layer 3078-3085

Patentee after: Beijing Zhang Kuo mobile media Science and Technology Ltd.

Address before: 100026 Guanghua Road, Beijing, Chaoyang District, No. 8 and Joe building, block A, 508

Patentee before: Beijing Zhang Kuo mobile media Science and Technology Ltd.