CN103955957A - 3D graphics rending method and system - Google Patents

3D graphics rending method and system Download PDF

Info

Publication number
CN103955957A
CN103955957A CN201410164315.XA CN201410164315A CN103955957A CN 103955957 A CN103955957 A CN 103955957A CN 201410164315 A CN201410164315 A CN 201410164315A CN 103955957 A CN103955957 A CN 103955957A
Authority
CN
China
Prior art keywords
coordinate
opaque
opaque section
hightratio
widthratio
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.)
Pending
Application number
CN201410164315.XA
Other languages
Chinese (zh)
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.)
TCL Corp
Original Assignee
TCL Corp
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 TCL Corp filed Critical TCL Corp
Priority to CN201410164315.XA priority Critical patent/CN103955957A/en
Publication of CN103955957A publication Critical patent/CN103955957A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)

Abstract

The invention is applicable to the field of 3D technology and provides a 3D graphics rending method and system. According to the 3D graphics rending method, objects to be rendered are divided into opaque objects and transparent objects, the opaque objects are ranked according to coordinate values of the opaque objects in a z direction in a visual coordinate system from small to large in sequence, rending is performed on the opaque objects according to the rank in sequence, and rending is performed on the same pixel point corresponding to the opaque objects with different z-coordinate values for one time only. Therefore, rending in different depths is performed on the same position for one time only, updating frequency of pixels at the same position is reduced, and rending efficiency is increased.

Description

A kind of 3D method for rendering graph and system
Technical field
The invention belongs to 3D technical field, relate in particular to a kind of 3D method for rendering graph and system.
Background technology
Popular and universal along with iphone, Android development platform, increasing people is enjoying the visual experience that mobile platform brings.Along with the development of OpenGL ES, more 3D (3Dimensions) application App appears in people's life.The 2D that compares, 3D figure has incomparable user to be experienced, but embedded platform resource is very limited, need to be under nervous resource, and develop and respond 3D application rapidly, promote 3D graph rendering efficiency.
Summary of the invention
The object of the present invention is to provide a kind of 3D method for rendering graph, to solve the inefficient problem of existing 3D graph rendering.
The present invention is achieved in that a kind of 3D method for rendering graph, comprising:
Parses scene description document, obtains the object of playing up in scene;
To the described sorting objects of playing up, described in inciting somebody to action, play up object and be divided into opaque article and transparent substance;
According to the ascending described opaque article that sorts successively of coordinate figure of opaque article z direction in visual coordinate system, described opaque article is successively played up successively according to sequence, and same pixel corresponding to the not identical opaque article of z coordinate figure only played up once;
Described transparent substance is played up.
Preferably, described described transparent substance played up and is specially:
Described transparent substance is divided into opaque section and transparent part;
According to the ascending described opaque section that sorts successively of coordinate figure of opaque section z direction in visual coordinate system, described opaque section is successively played up successively according to sequence, and same pixel corresponding to the not identical opaque section of z coordinate figure only played up once;
The descending described transparent part that sorts successively of coordinate figure of the z direction according to transparent part in visual coordinate system, successively plays up according to sequence successively to described transparent part.
The present invention also provides a kind of 3D graph rendering system, comprising:
Resolve acquisition module, for parses scene description document, obtain the object of playing up in scene;
The first sort module, for to the described sorting objects of playing up, plays up object described in inciting somebody to action and is divided into opaque article and transparent substance;
The first rendering module, for the ascending described opaque article that sorts successively of coordinate figure in the visual coordinate z of system direction according to opaque article, described opaque article is successively played up successively according to sequence, and same pixel corresponding to the not identical opaque article of z coordinate figure only played up once;
The second rendering module, for playing up described transparent substance.
Preferably, described the second rendering module also comprises:
The second sort module, for being divided into opaque section and transparent part by described transparent substance;
First plays up submodule, for the ascending described opaque section that sorts successively of coordinate figure in the visual coordinate z of system direction according to opaque section, described opaque section is successively played up successively according to sequence, and same pixel corresponding to the not identical opaque section of z coordinate figure only played up once;
Second plays up submodule, for the descending described transparent part that sorts successively of coordinate figure in the z direction of visual coordinate system according to transparent part, described transparent part is successively played up successively according to sequence.
In the present invention, be divided into opaque article and transparent substance by playing up object, according to the ascending described opaque article that sorts successively of coordinate figure of opaque article z direction in visual coordinate system, opaque article is successively played up successively according to sequence, and the same pixel that the not identical opaque article of z coordinate figure is corresponding is only played up once, guarantee same position different depth is only played up and is carried out once, has reduced same position pixel update times, has improved rendering efficiency.
Brief description of the drawings
Fig. 1 is the realization flow figure of the 3D method for rendering graph that provides of the embodiment of the present invention;
Fig. 2 is that the opaque article front and back layer that the embodiment of the present invention provides is played up schematic diagram;
Fig. 3 is the realization flow figure of the 3D method for rendering graph that provides of further embodiment of this invention;
Fig. 4 is the realization flow figure that is divided into opaque section and transparent part by playing up object that the embodiment of the present invention provides;
Fig. 5 is the schematic diagram of opaque section and transparent part in the preset rending model that provides of the embodiment of the present invention;
Fig. 6 is the structured flowchart of the 3D graph rendering system that provides of the embodiment of the present invention;
Fig. 7 is the structured flowchart of the second sort module in Fig. 6 of providing of the embodiment of the present invention.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
Fig. 1 shows the realization flow of a kind of 3D method for rendering graph that the embodiment of the present invention provides, and details are as follows:
Step 101, parses scene description document, obtain the object of playing up in scene.
In the embodiment of the present invention, first loading scenario is described XML file, and scene description is resolved, obtain that in scene, each is played up object and plays up information, wherein comprise the hierarchical organization structural relation of playing up object, the position of playing up object, material, texture information, plays up grouping information.
Step 102, to playing up sorting objects, will play up object and be divided into opaque article and transparent substance.
In the embodiment of the present invention, play up packets of information and contain texture information owing to playing up in object, texture information has pictorial information, what comprise subsides is the picture of png form, or the picture of jpg form, carries out preliminary classification according to picture format, will play up object and tentatively be divided into opaque article and transparent substance.Such as picture format is png form, the corresponding object of playing up is transparent substance, if the form of picture is jpg form, the corresponding object of playing up is opaque article.In the embodiment of the present invention, system intialization TCL_SOILD (opaque article grouping) and two grouping containers of TCL_TRANSPARENT (transparent substance grouping), according to the type of playing up object, the object of playing up being resolved to is added respectively in two groupings.Opaque article adds TCL_SOILD grouping, and transparent substance adds TCL_TRANSPARENT grouping.
Step 103, according to the ascending opaque article that sorts successively of coordinate figure of opaque article z direction in visual coordinate system, opaque article is successively played up successively according to sequence, and same pixel corresponding to the not identical opaque article of z coordinate figure only played up once.
In the embodiment of the present invention, be that world coordinate system be transformed into visual space coordinate system under by opaque article coordinate by reference frame by model space matrix and visual matrix, according to the ascending opaque article that sorts successively of coordinate figure of opaque article z direction in visual coordinate system, also be before opaque article that coordinate figure is little comes, after the object that coordinate figure is large comes, then opaque article is successively played up successively according to sequence.And each opaque article is played up, its essence is the pixel of opaque article is played up.The same pixel that the not identical opaque article of z coordinate figure is corresponding is only played up once, and same pixel is only once played up.Concrete, can realize same pixel position by the method for depth detection only once plays up, utilize depth detection to judge playing up of same position pixel, first play up the object nearest from eyes, guarantee same position different depth is only played up and is carried out once, if that is to say the same pixel degree of depth different (being also that z coordinate is not identical), what only play up depth value minimum is corresponding z coordinate figure minimum.As shown in Figure 2, first play up anterior layer 1, layer 2 after drawing again, because anterior layer 1 has been filled pixel, pixel replacement operation is not done in rear layer 2 region of playing up at anterior layer, and no longer play up the Ye Ji overlapping region, region that anterior layer 1 is drawn a circle to approve, only play up rear layer 2 with the nonoverlapping region of anterior layer, reduce the number of times that same position pixel is upgraded, and then improve rendering efficiency.
Step 104, transparent substance is played up.
In the embodiment of the present invention, also comprise transparent substance is played up, preferably according to pixel value, transparent substance is further divided into opaque section and transparent part.And then respectively opaque section and transparent part are played up.Transparent substance is further divided into opaque section and transparent part, so more accurately transparent substance is classified, because transparent substance is played up and is calculated more complicated than the consumption of playing up of opaque article, therefore, transparent substance is further split as to opaque section and transparent part, can reduce render time, further improve the efficiency of playing up.
In order in more detailed description step 104, transparent substance to be played up, the embodiment of the present invention 3 shows by reference to the accompanying drawings, does more specifically to describe below:
Step 301, transparent substance is divided into opaque section and transparent part.
The present invention is in example, according to pixel value, transparent substance is further divided into opaque section and transparent part.And then respectively opaque section and transparent part are played up.
Step 302, according to the ascending opaque section that sorts successively of coordinate figure of above-mentioned opaque section z direction in visual coordinate system, opaque section is successively played up successively according to sequence, and same pixel corresponding to the not identical opaque section of z coordinate figure only played up once.
In the rendering intent of the opaque section of transparent substance and step 203, the rendering intent of opaque article is similar, at this, is not repeating.
The descending described transparent part that sorts successively of coordinate figure of step 303, z direction by transparent part in visual coordinate system, successively plays up according to sequence successively to transparent part.
Concrete, by model space matrix and visual matrix, opaque article coordinate is transformed under visual space coordinate system by world coordinate system, according to the descending transparent part that sorts successively of coordinate figure of transparent part z direction in visual coordinate system, also be before object that coordinate figure is large comes, after the object that coordinate figure is little comes, then transparent part is successively played up successively according to sequence.Contrary with opaque section, the same pixel different depth of transparent part need to repeatedly be played up, and like this, can ensure that equally the object of transparent part different layers is all played up, and truly reflects transparent part image effect.
It should be noted that if transparent substance carries out, according to only having transparent part there is no opaque section after pixel value classification, playing up according to transparent part completely, now by skips steps S302.
In the embodiment of the present invention, transparent substance is further divided into opaque section and transparent part, so more accurately transparent substance is classified, because transparent substance is played up and is calculated more complicated than the consumption of playing up of opaque article, therefore, transparent substance is further split as to opaque section and transparent part, can reduces render time, further improve the efficiency of playing up.
Further, in order further to describe in previous embodiment, in step 301, described object to be divided into opaque section and transparent part, the embodiment of the present invention by reference to the accompanying drawings 4,5, the following specifically describes:
Step 401, from left to right scan the row pixel of transparent substance vertical direction, after detecting that number that a row respective pixel value equals 1 pixel exceedes default first threshold and described pixel and is continuous image vegetarian refreshments, stop scanning, and record is when prostatitis number.
Concrete, from left to right scan the row pixel of transparent substance vertical direction, when detecting that the pixel value of the corresponding continuous image vegetarian refreshments of row equals 1 pixel number and exceedes after default first threshold, stop scanning, and record is when prostatitis number.Such as when detecting that number that i row respective pixel value equals 1 pixel exceedes i and is listed as 80% of total pixel, and pixel value is when equaling 1 pixel and being continuous image vegetarian refreshments, stop scanning, and record is as prostatitis i.
Step 402, scan from top to bottom the row pixel of transparent substance horizontal direction, after detecting that number that a line respective pixel value equals 1 pixel exceedes default first threshold and described pixel and is continuous image vegetarian refreshments, stop scanning, and record current line number.
Concrete, scan from top to bottom the row pixel of transparent substance horizontal direction, when detecting that the pixel value of the corresponding continuous image vegetarian refreshments of a line equals 1 number and exceedes after default first threshold, stop scanning, and record current line number.Such as when detecting that the pixel value of the capable corresponding continuous image vegetarian refreshments of j equals 1 pixel number and exceedes 80% of the capable total pixel of j, stop scanning, and record current line number j.
Step 403, calculate mapping ratio according to above-mentioned when prostatitis number and above-mentioned current line number.
Concrete, the current line number obtaining when prostatitis number and step 402 obtaining according to step 401 is calculated mapping ratio, and concrete computing formula is:
HightRatio = ColumnNumber PictureHight ; - - - ( 1 )
WidthRatio = RowNumber PictureWidth ; - - - ( 2 )
Wherein, described HightRatio represents the height ratio of mapping, and described ColumnNumber represents described when prostatitis number, and PictureHight represents the overall height that transparent substance image is corresponding; Described WidthRatio represents the width ratio of mapping, and described RowNumber represents described current line number, and PictureHight represents the overall width that transparent substance image is corresponding.
Step 404, according to the get it right apex coordinate of opaque section in the texture coordinate of answering and preset rending model of above-mentioned mapping ratiometer, obtain opaque section opaque section position in the mapping position of original image and preset rending model.
According to the get it right apex coordinate of opaque section in the texture coordinate of answering and preset rending model of mapping ratiometer, concrete computing formula is:
TextureLeftUpCoord=(WidthRadio,HightRadio); (3)
TextureLeftDownCoord=(WidthRatio,1.0-HightRatio); (4)
TextureRightUpCoord=(1.0-WidthRatio,HightRatio); (5)
TextureRightDownCoord=(1.0-WidthRatio,1.0-HightRatio); (6)
LeftUpCoord=(-1+2*WidthRatio,1-2*HightRatio); (7)
LeftDownCoord=(-1+2*WidthRatio,-1+2*HightRatio); (8)
RightUpCoord=(1-2*WidthRatio,1-2*HightRatio); (9)
RightDownCoord=(1.0-2*WidthRatio,-1.0+2*HightRatio); (10)
Wherein, TextureLeftUpCoord represents the top left corner apex coordinate of texture coordinate, TextureLeftDownCoord represents the lower left corner apex coordinate of texture coordinate, TextureRightUpCoord represents the upper right corner apex coordinate of texture coordinate, and TextureRightDownCoord represents the lower right corner apex coordinate of texture coordinate; LeftUpCoord represents the top left corner apex coordinate of opaque section in preset rending model, LeftDownCoord represents the lower left corner apex coordinate of opaque section in preset rending model, RightUpCoord represents the upper right corner apex coordinate of opaque section in preset rending model, RightDownCoord represents the lower right corner apex coordinate of opaque section in preset rending model, WidthRatio represents the width ratio of mapping, and HightRatio represents the height ratio of mapping.Like this according to formula (3)-(6) thus calculating texture coordinate obtains the mapping position of opaque section at original image, and calculate the apex coordinate of opaque section in preset rending model according to formula (7)-(10), thereby obtain opaque section position in preset rending model.As shown in Figure 5, preset rending model comprises opaque section 51 and transparent part 52, formula (7)-(10) are exactly the apex coordinate in order to calculate transparent substance opaque section opaque section 52 in preset rending model, and then carry out the drafting of opaque section and play up according to the apex coordinate that obtains opaque section opaque section in the mapping position of original image and preset rending model.
Obtain like this after opaque section, the remaining other parts of transparent substance are transparent part.If when step 401,402 does not scan the row and column being consistent certainly, also illustrate that this transparent substance is that transparent object does not exist opaque section completely, so plays up according to transparent part.
It should be noted that, for aforesaid each embodiment of the method, 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 present invention is not subject to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.
Fig. 6 shows the structured flowchart of a kind of 3D graph rendering system that the embodiment of the present invention provides, and this system can realize the described method of preceding method embodiment.For convenience of explanation, only show the part relevant to the present embodiment.With reference to Fig. 6, this 3D graph rendering system, comprising: resolve acquisition module 61, the first sort module 62, the first rendering module 63 and the second rendering module 64.
Resolve acquisition module 61, for parses scene description document, obtain the object of playing up in scene.
The first sort module 62, for to the described sorting objects of playing up, plays up object described in inciting somebody to action and is divided into opaque article and transparent substance.
The first rendering module 63, for the ascending described opaque article that sorts successively of coordinate figure in the visual coordinate z of system direction according to opaque article, described opaque article is successively played up successively according to sequence, and same pixel corresponding to the not identical opaque article of z coordinate figure only played up once.Concrete, can realize same pixel by depth detection and only once play up, utilize depth detection judge playing up of same position pixel, first to play up from the nearest object of eyes like this, guarantee same position different depth is only played up and is carried out once.First play up anterior layer, layer after drawing again, because anterior layer has been filled pixel, pixel replacement operation is not done in the region that rear layer is played up at anterior layer, no longer play up the Ye Ji overlapping region, region that is anterior layer delineation, only play up rear layer with the nonoverlapping region of anterior layer, reduce the number of times that same position pixel is upgraded, and then improve rendering efficiency.
The second rendering module 64, for playing up described transparent substance.Further, this second rendering module 64 also comprises: the second sort module 641, first is played up submodule 642, second and played up submodule 643.The second sort module 641, for being divided into opaque section and transparent part by described transparent substance.First plays up submodule 642, for the ascending described transparent part opaque section that sorts successively of coordinate figure in the visual coordinate z of system direction according to described opaque section, described opaque section is successively played up successively according to sequence, and same pixel corresponding to the not identical opaque section of z coordinate figure only played up once.Second plays up submodule 643, for the descending described transparent part that sorts successively of coordinate figure in the z direction of visual coordinate system by described transparent part, described transparent part is successively played up successively according to sequence.Transparent substance is further divided into opaque section and transparent part, so more accurately transparent substance is classified, because transparent substance is played up and is calculated more complicated than the consumption of playing up of opaque article, therefore, transparent substance is further divided into opaque section and transparent part, can reduce render time, further improve the efficiency of playing up.
The structured flowchart of the second sort module 641 in Fig. 6 that Fig. 7 provides for the embodiment of the present invention, as shown in Figure 7, the second sort module 641 also comprises:
The first scan module 6411, for from left to right scanning the row pixel of transparent substance vertical direction, after detecting that number that a row respective pixel value equals 1 pixel exceedes default first threshold and described pixel and is continuous image vegetarian refreshments, stop scanning, and record is when prostatitis number;
The second scan module 6412, for scanning from top to bottom the row pixel of transparent substance horizontal direction, after detecting that number that a line respective pixel value equals 1 pixel exceedes default first threshold and described pixel and is continuous image vegetarian refreshments, stop scanning, and record current line number.
The first computing module 6413, for calculating mapping ratio according to the described prostatitis number of working as with described current line number.The first computing module 6413 calculates mapping ratio when prostatitis number with described current line number according to described, and its concrete computing formula is:
HightRatio = ColumnNumber PictureHight ;
WidthRatio = RowNumber PictureWidth ;
Wherein, HightRatio represents the height ratio of mapping, and ColumnNumber represents described when prostatitis number, and PictureHight represents the overall height that transparent substance image is corresponding; WidthRatio represents the width ratio of mapping, and RowNumber represents described current line number, and PictureHight represents the overall width that transparent substance image is corresponding.
The second computing module 6414, the texture coordinate of answering for getting it right according to described mapping ratiometer and the apex coordinate of preset rending model opaque section, obtain opaque section opaque section position in the mapping position of original image and preset rending model.Concrete computing formula is:
TextureLeftUpCoord=(WidthRadio,HightRadio);
TextureLeftDownCoord=(WidthRatio,1.0-HightRatio);
TextureRightUpCoord=(1.0-WidthRatio,HightRatio);
TextureRightDownCoord=(1.0-WidthRatio,1.0-HightRatio);
LeftUpCoord=(-1+2*WidthRatio,1-2*HightRatio);
LeftDownCoord=(-1+2*WidthRatio,-1+2*HightRatio);
RightUpCoord=(1-2*WidthRatio,1-2*HightRatio);
RightDownCoord=(1.0-2*WidthRatio,-1.0+2*HightRatio);
Wherein, TextureLeftUpCoord represents the top left corner apex coordinate of texture coordinate, TextureLeftDownCoord represents the lower left corner apex coordinate of texture coordinate, TextureRightUpCoord represents the upper right corner apex coordinate of texture coordinate, and TextureRightDownCoord represents the lower right corner apex coordinate of texture coordinate; LeftUpCoord represents the top left corner apex coordinate of opaque section in preset rending model, LeftDownCoord represents the lower left corner apex coordinate of opaque section in preset rending model, RightUpCoord represents the upper right corner apex coordinate of opaque section in preset rending model, RightDownCoord represents the lower right corner apex coordinate of opaque section in preset rending model, WidthRatio represents the width ratio of mapping, and HightRatio represents the height ratio of mapping.
Obtain after opaque section by the second sort module like this, the remaining other parts of transparent substance are transparent part.If when the first scan module, the second scan module do not scan the row and column being consistent certainly, also illustrate that this transparent substance is that transparent object does not exist opaque section completely, so plays up according to transparent part.
Those skilled in the art can be well understood to, for convenience and simplicity of description, only be illustrated with the division of above-mentioned each functional unit, module, in practical application, can above-mentioned functions be distributed and completed by different functional units, module as required, the inner structure that is system is divided into different functional units or module, to complete all or part of function described above.Each functional unit in embodiment or module can be integrated in a processing unit, also can be that the independent physics of unit exists, also can be integrated in a unit two or more unit, above-mentioned integrated unit or module both can adopt the form of hardware to realize, and also can adopt the form of SFU software functional unit to realize.In addition, the concrete title of each functional unit, module also, just for the ease of mutual differentiation, is not limited to the application's protection domain.The specific works process of unit, module in said system, can, with reference to the corresponding process in preceding method embodiment, not repeat them here.
Those of ordinary skill in the art it is also understood that, the all or part of step realizing in above-described embodiment method is can carry out the hardware that instruction is relevant by program to complete, described program can be being stored in a computer read/write memory medium, described storage medium, comprises ROM/RAM, disk, CD etc.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.

Claims (10)

1. a 3D method for rendering graph, is characterized in that, comprising:
Parses scene description document, obtains the object of playing up in scene;
Described in inciting somebody to action, play up object and be divided into opaque article and transparent substance;
According to the ascending described opaque article that sorts successively of coordinate figure of opaque article z direction in visual coordinate system, described opaque article is successively played up successively according to sequence, and same pixel corresponding to the not identical opaque article of z coordinate figure only played up once;
Described transparent substance is played up.
2. the method for claim 1, is characterized in that, described described transparent substance is played up and is specially:
Described transparent substance is divided into opaque section and transparent part;
According to the ascending described opaque section that sorts successively of coordinate figure of opaque section z direction in visual coordinate system, institute's opaque section is successively played up successively according to sequence, and same pixel corresponding to the not identical opaque section of z coordinate figure only played up once;
The descending described transparent part that sorts successively of coordinate figure of the z direction according to transparent part in visual coordinate system, successively plays up according to sequence successively to described transparent part.
3. method as claimed in claim 2, is characterized in that, described described transparent substance is divided into opaque section and transparent part, specifically comprises:
From left to right scan the row pixel of transparent substance vertical direction, after the number that has a row respective pixel value to equal 1 pixel exceedes default first threshold and described pixel and is continuous image vegetarian refreshments, stop scanning, and record is when prostatitis number;
Scan from top to bottom the row pixel of transparent substance horizontal direction, after detecting that number that a line respective pixel value equals 1 pixel exceedes default first threshold and described pixel and is continuous image vegetarian refreshments, stop scanning, and record current line number;
Calculate mapping ratio according to the described prostatitis number of working as with described current line number;
According to the get it right apex coordinate of opaque section in the texture coordinate of answering and preset rending model of described mapping ratiometer, obtain opaque section opaque section position in the mapping position of original image and preset rending model.
4. method as claimed in claim 3, is characterized in that, calculates mapping ratio described in described basis when prostatitis number and described current line number, and concrete computing formula is:
HightRatio = ColumnNumber PictureHight ;
WidthRatio = RowNumber PictureWidth ;
Wherein, described HightRatio represents the height ratio of mapping, and described ColumnNumber represents described when prostatitis number, and PictureHight represents the overall height that transparent substance image is corresponding; Described WidthRatio represents the width ratio of mapping, and described RowNumber represents described current line number, and PictureHight represents the overall width that transparent substance image is corresponding.
5. the method as described in claim 3 or 4, is characterized in that, described according to the get it right apex coordinate of opaque section in the texture coordinate of answering and preset rending model of described mapping ratiometer, concrete computing formula is:
TextureLeftUpCoord=(WidthRadio,HightRadio);
TextureLeftDownCoord=(WidthRatio,1.0-HightRatio);
TextureRightUpCoord=(1.0-WidthRatio,HightRatio);
TextureRightDownCoord=(1.0-WidthRatio,1.0-HightRatio);
LeftUpCoord=(-1+2*WidthRatio,1-2*HightRatio);
LeftDownCoord=(-1+2*WidthRatio,-1+2*HightRatio);
RightUpCoord=(1-2*WidthRatio,1-2*HightRatio);
RightDownCoord=(1.0-2*WidthRatio,-1.0+2*HightRatio);
Wherein, described TextureLeftUpCoord represents the top left corner apex coordinate of texture coordinate, described TextureLeftDownCoord represents the lower left corner apex coordinate of texture coordinate, described TextureRightUpCoord represents the upper right corner apex coordinate of texture coordinate, and TextureRightDownCoord represents the lower right corner apex coordinate of texture coordinate; Described LeftUpCoord represents the top left corner apex coordinate of opaque section in preset rending model, described LeftDownCoord represents the lower left corner apex coordinate of opaque section in preset rending model, described RightUpCoord represents the upper right corner apex coordinate of opaque section in preset rending model, described RightDownCoord represents the lower right corner apex coordinate of opaque section in preset rending model, described WidthRatio represents the width ratio of mapping, and described HightRatio represents the height ratio of mapping.
6. a 3D graph rendering system, is characterized in that, comprising:
Resolve acquisition module, for parses scene description document, obtain the object of playing up in scene;
The first sort module, for to the described sorting objects of playing up, plays up object described in inciting somebody to action and is divided into opaque article and transparent substance;
The first rendering module, for the ascending described opaque article that sorts successively of coordinate figure in the visual coordinate z of system direction according to opaque article, described opaque article is successively played up successively according to sequence, and same pixel corresponding to the not identical opaque article of z coordinate figure only played up once;
The second rendering module, for playing up described transparent substance.
7. system as claimed in claim 6, is characterized in that, described the second rendering module, also comprises:
The second sort module, for being divided into opaque section and transparent part by described transparent substance;
First plays up submodule, for the ascending described opaque section that sorts successively of coordinate figure in the visual coordinate z of system direction according to opaque section, described opaque section is successively played up successively according to sequence, and same pixel corresponding to the not identical opaque section of z coordinate figure only played up once;
Second plays up submodule, for by the descending described transparent part that sorts successively of coordinate figure in the z direction of visual coordinate system according to transparent part, described transparent part is successively played up successively according to sequence.
8. system as claimed in claim 7, is characterized in that, described the second sort module also comprises:
The first scan module, for from left to right scanning the row pixel of transparent substance vertical direction, after detecting that number that a row respective pixel value equals 1 pixel exceedes default first threshold and described pixel and is continuous image vegetarian refreshments, stop scanning, and record is when prostatitis number;
The second scan module, for scanning from top to bottom the row pixel of transparent substance horizontal direction, after detecting that number that a line respective pixel value equals 1 pixel exceedes default first threshold and described pixel and is continuous image vegetarian refreshments, stop scanning, and record current line number;
The first computing module, for calculating mapping ratio according to the described prostatitis number of working as with described current line number;
The second computing module, the texture coordinate of answering for getting it right according to described mapping ratiometer and the apex coordinate of preset rending model opaque section, obtain opaque section opaque section position in the mapping position of original image and preset rending model.
9. system as claimed in claim 8, is characterized in that, described the first computing module, and for calculating mapping ratio when prostatitis number with described current line number according to described, concrete computing formula is:
HightRatio = ColumnNumber PictureHight ;
WidthRatio = RowNumber PictureWidth ;
Wherein, described HightRatio represents the height ratio of mapping, and described ColumnNumber represents described when prostatitis number, and PictureHight represents the overall height that transparent substance image is corresponding; Described WidthRatio represents the width ratio of mapping, and described RowNumber represents described current line number, and PictureHight represents the overall width that transparent substance image is corresponding.
10. system as claimed in claim 8 or 9, is characterized in that, described the second computing module, and the texture coordinate of answering for getting it right according to described mapping ratiometer and the apex coordinate of preset rending model opaque section, concrete computing formula is:
TextureLeftUpCoord=(WidthRadio,HightRadio);
TextureLeftDownCoord=(WidthRatio,1.0-HightRatio);
TextureRightUpCoord=(1.0-WidthRatio,HightRatio);
TextureRightDownCoord=(1.0-WidthRatio,1.0-HightRatio);
LeftUpCoord=(-1+2*WidthRatio,1-2*HightRatio);
LeftDownCoord=(-1+2*WidthRatio,-1+2*HightRatio);
RightUpCoord=(1-2*WidthRatio,1-2*HightRatio);
RightDownCoord=(1.0-2*WidthRatio,-1.0+2*HightRatio);
Wherein, described TextureLeftUpCoord represents the top left corner apex coordinate of texture coordinate, described TextureLeftDownCoord represents the lower left corner apex coordinate of texture coordinate, described TextureRightUpCoord represents the upper right corner apex coordinate of texture coordinate, and TextureRightDownCoord represents the lower right corner apex coordinate of texture coordinate; Described LeftUpCoord represents the top left corner apex coordinate of opaque section in preset rending model, described LeftDownCoord represents the lower left corner apex coordinate of opaque section in preset rending model, described RightUpCoord represents the upper right corner apex coordinate of opaque section in preset rending model, described RightDownCoord represents the lower right corner apex coordinate of opaque section in preset rending model, described WidthRatio represents the width ratio of mapping, and described HightRatio represents the height ratio of mapping.
CN201410164315.XA 2014-04-22 2014-04-22 3D graphics rending method and system Pending CN103955957A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410164315.XA CN103955957A (en) 2014-04-22 2014-04-22 3D graphics rending method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410164315.XA CN103955957A (en) 2014-04-22 2014-04-22 3D graphics rending method and system

Publications (1)

Publication Number Publication Date
CN103955957A true CN103955957A (en) 2014-07-30

Family

ID=51333226

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410164315.XA Pending CN103955957A (en) 2014-04-22 2014-04-22 3D graphics rending method and system

Country Status (1)

Country Link
CN (1) CN103955957A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106296782A (en) * 2015-05-29 2017-01-04 Tcl集团股份有限公司 A kind of word rendering intent and word rendering device
CN106846443A (en) * 2017-01-05 2017-06-13 福建天泉教育科技有限公司 A kind of collision checking method and system
CN109389659A (en) * 2018-09-11 2019-02-26 广州视源电子科技股份有限公司 The rendering method of mathematical formulae, device, storage medium and terminal device in PPT
CN109978971A (en) * 2019-03-29 2019-07-05 深圳市万普拉斯科技有限公司 UI drawing practice, device and mobile terminal
CN110209444A (en) * 2019-03-20 2019-09-06 华为技术有限公司 A kind of method for rendering graph and electronic equipment
CN111462278A (en) * 2020-03-17 2020-07-28 稿定(厦门)科技有限公司 Depth-based material sorting rendering method, medium, equipment and device
CN113205583A (en) * 2021-04-28 2021-08-03 北京字跳网络技术有限公司 Scene rendering method and device, electronic equipment and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101154294A (en) * 2006-09-29 2008-04-02 三星电子株式会社 Method, medium and system rendering 3-d graphics data having an object to which a motion blur effect is to be applied
US20080094395A1 (en) * 2006-10-18 2008-04-24 Samsung Electronics Co., Ltd. Method, medium, and system rendering 3D graphic data to enhance image quality of transparent objects
CN101295408A (en) * 2007-04-27 2008-10-29 新奥特硅谷视频技术有限责任公司 3D videotext rendering method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101154294A (en) * 2006-09-29 2008-04-02 三星电子株式会社 Method, medium and system rendering 3-d graphics data having an object to which a motion blur effect is to be applied
US20080094395A1 (en) * 2006-10-18 2008-04-24 Samsung Electronics Co., Ltd. Method, medium, and system rendering 3D graphic data to enhance image quality of transparent objects
CN101295408A (en) * 2007-04-27 2008-10-29 新奥特硅谷视频技术有限责任公司 3D videotext rendering method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HTTP://WWW.BAIKE.COM/WIKI/画家算法: "《画家算法》", 《互动百科》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106296782A (en) * 2015-05-29 2017-01-04 Tcl集团股份有限公司 A kind of word rendering intent and word rendering device
CN106296782B (en) * 2015-05-29 2019-04-26 Tcl集团股份有限公司 A kind of text rendering method and text rendering device
CN106846443A (en) * 2017-01-05 2017-06-13 福建天泉教育科技有限公司 A kind of collision checking method and system
CN109389659A (en) * 2018-09-11 2019-02-26 广州视源电子科技股份有限公司 The rendering method of mathematical formulae, device, storage medium and terminal device in PPT
CN109389659B (en) * 2018-09-11 2023-08-25 广州视源电子科技股份有限公司 Rendering method and device of mathematical formula in PPT, storage medium and terminal equipment
CN110209444A (en) * 2019-03-20 2019-09-06 华为技术有限公司 A kind of method for rendering graph and electronic equipment
CN109978971A (en) * 2019-03-29 2019-07-05 深圳市万普拉斯科技有限公司 UI drawing practice, device and mobile terminal
CN111462278A (en) * 2020-03-17 2020-07-28 稿定(厦门)科技有限公司 Depth-based material sorting rendering method, medium, equipment and device
CN111462278B (en) * 2020-03-17 2022-10-25 稿定(厦门)科技有限公司 Depth-based material sequencing rendering method, medium, equipment and device
CN113205583A (en) * 2021-04-28 2021-08-03 北京字跳网络技术有限公司 Scene rendering method and device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN103955957A (en) 3D graphics rending method and system
CN103473799B (en) The method for dynamically processing of a kind of picture and device, terminal unit
CN102779358B (en) Method and device for designing a geometrical three-dimensional modeled object
US20190294938A1 (en) Method and apparatus for generating two-dimensional barcode picture having dynamic effect
CN100550059C (en) A kind of vector graph acceleration method and multimedia player
US20170132836A1 (en) 2D Image Processing for Extrusion Into 3D Objects
CN105719332B (en) The implementation method and device of animation between color is mended
US20150235392A1 (en) Drawing data generation device and image drawing device
US10347052B2 (en) Color-based geometric feature enhancement for 3D models
US10204447B2 (en) 2D image processing for extrusion into 3D objects
CN103180818A (en) Animated page turning
KR102138847B1 (en) Dynamic image color remapping method with alpha blending
CN111970503B (en) Three-dimensional method, device and equipment for two-dimensional image and computer readable storage medium
CN107578367B (en) Method and device for generating stylized image
CN111429566B (en) Reconstruction method and device of virtual home decoration scene and electronic equipment
US20150066443A1 (en) Computing device and method for analyzing assembly clearance between two components of product
GB2546861A (en) 3D model generation from 2D images
CN104270624B (en) A kind of subregional 3D video mapping method
CN111161388B (en) Method, system, device and storage medium for generating retail commodity shelf images
CN113870097A (en) Marking method of furniture image, model training method and equipment
CN104637047A (en) Image processing method and device
Sulzer et al. Scalable Surface Reconstruction with Delaunay‐Graph Neural Networks
CN103052973B (en) Generate method and the device of body animation
CN104346046B (en) Three-dimensional artificial page turning method and system
CN111161127B (en) Picture resource rendering optimization method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20140730

RJ01 Rejection of invention patent application after publication