Embodiment
In order to realize that the three-dimensional model of distributed storage is carried out distributed plotting; Be presented at a client requests end then effectively; Promptly realize the distributed drawing of three-dimensional modeling data, the embodiment of the invention provides distributed drawing practice of a kind of three-dimensional modeling data and device.The basic thought of the distributed drawing practice of this three-dimensional modeling data is:
When needs drawing three-dimensional model data, the request transmitting terminal sends the corresponding drawing data request that comprises the identical view controlled variable to a plurality of request receiving ends; Each asks receiving end after receiving the drawing data request, the corresponding back data of drawing of feedback; And the request transmitting terminal after the data, synthesize processing to a plurality of drafting back data after receiving the drafting of respectively asking receiving end feedback, is the image after the distributed drawing of three-dimensional modeling data with the image after definite synthesizing.
Therefore, the scheme that the embodiment of the invention provided can effectively realize the distributed drawing of three-dimensional modeling data.
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
To the understanding of the scheme that the embodiment of the invention provided, at first the procedure for displaying of three-dimensional model in view window carried out brief account for ease.The procedure for displaying of three-dimensional model in view window is generally:
At first the three-dimensional model that will meet given space condition through spatial data index takes out through transmission medium and passes to three-dimensional model user (like client); After then three-dimensional modeling data being carried out a series of coordinate transform and handles, be transformed to the coordinate points on the two dimensional image; According to display parameter, three-dimensional model finally is tiled into image pixel through drawing algorithm, is depicted as a width of cloth grating image, shows or output (like computer screen demonstration, printout and the output of generation image file etc. on paper) in client.The wherein drafting of three-dimensional model finally is summed up as the operation of pixel one by one by drawing algorithm, and what finally can be revealed all is to be plotted in the pixel that the nearest three-dimensional modeling data of three-dimensional modeling data middle distance observation point on the same pixel is drawn.
Therefore; The present invention proposes to control with identical view controlled variable the distributed plotting of three-dimensional modeling data; The degree of depth of each pixel on the while document image; Be used for judging the distance of the pairing three-dimensional modeling data of pixel apart from the distance of the determined viewpoint of said view controlled variable; Constitute the synthetic labelled amount of respective pixel; According to the synthetic labelled amount of pixel a plurality of images after drawing are synthesized at last, the image after confirming to synthesize is the image after the distributed drawing of three-dimensional modeling data.
At first from the angle of request transmitting terminal, the distributed drawing practice of a kind of three-dimensional modeling data that the embodiment of the invention provided is introduced below.The described request transmitting terminal can be computer equipment, cell phone apparatus etc.
As shown in Figure 1, the distributed drawing practice of a kind of three-dimensional modeling data can comprise:
Step S101, the request transmitting terminal sends the drawing data request to a plurality of request receiving ends, carries the view controlled variable in the said drawing data request;
Be understandable that the described request receiving end can or have other equipment of image processing function etc. for image processing server.
Storing under the scene of the three-dimensional modeling data of asking the required demonstration of transmitting terminal at a plurality of request receiving ends; When needs drawing three-dimensional model data; The request transmitting terminal is then according to carrying out the definite view controlled variable of view window that three-dimensional modeling data shows; Generate corresponding drawing data request, and the drawing data request that is generated is sent to corresponding request receiving end.
Wherein, said view controlled variable can comprise:
The outsourcing rectangle of view window, viewpoint parameter and projective parameter; Said viewpoint parameter comprises the position O (x of viewpoint in world coordinate system
o, y
o, z
o), x wherein
o, y
o, z
oThe observed target location A (x of expression three components, the viewpoint of viewpoint in world coordinate system
a, y
a, z
a) and the vectorial up (x that makes progress of virtual camera
Up, y
Up, z
Up); Can confirm a transformation matrix through viewpoint parameter, the apex coordinate in the original coordinate system is transformed to eye coordinates system down.Projective parameter comprises: rectangular projection and perspective projection.Or the viewing matrix and the projection matrix that obtain through above-mentioned parameter.
Step S102, data after drafting feedback, corresponding with said drawing data request of reception described request receiving end;
Wherein, the said back data of drawing comprise the request receiving end according to the corresponding synthetic sign amount of each pixel on pairing image of view controlled variable drawing three-dimensional model data and the said image.
The request receiving end is after receiving corresponding drawing data request; Then according to the view controlled variable drawing three-dimensional model data of carrying in the said drawing data request; Generate the identical image of outsourcing rectangle size with the corresponding view window of said view controlled variable; Write down the corresponding synthetic sign amount of each pixel on the said image simultaneously, said synthetic sign amount includes the degree of depth of pixel on the said image.Wherein, the degree of depth of said pixel is used to judge the distance of the pairing three-dimensional modeling data of each pixel apart from the distance of the determined viewpoint of said view controlled variable.At last, the synthetic sign amount that the request receiving end is corresponding with the pairing image of drawing three-dimensional model data and each pixel feeds back to the described request transmitting terminal as drawing the back data.Be understandable that, can also comprise the identification number of three-dimensional model, the information such as transparency of pixel in the said synthetic sign amount.
Need to prove; In the present embodiment; The pixel of representing view window according to the view controlled variable with raster data structure; The uniform grid unit that said pixel is divided into for the view window plane; Said pixel is the essential information storage unit in the raster data, and the coordinate position of said pixel number is confirmed according to said pixel corresponding row number and row in said view window.Suppose to be expressed as with zValue the degree of depth (being the z coordinate) of pixel, according to different systems, if the pixel depth value is more little near more from viewpoint, then the initial value of the raster data of the remarked pixel degree of depth is composed maximum value; If the pixel depth value is near more from viewpoint more greatly, then the initial value of the raster data of the remarked pixel degree of depth is composed minimal value.Wherein, when pixel depth is initial value, mean that said pixel also do not drawn by any three-dimensional model.
Step S103 according to said synthetic sign amount of drawing each pixel in the data of back, synthesizes data after the received drafting, is the image after the distributed drawing of three-dimensional modeling data to confirm image after synthetic.
The request transmitting terminal is after receiving the corresponding drafting back data of request receiving end feedback; Then utilize the synthetic sign amount of drawing pixel in the data of back; A plurality of draftings back data to being received are synthesized processing; Just a plurality of images are synthesized processing; Make on Pixel-level, to replace thing far away with nearly thing, and the sequence independence that on screen, occurs with body.
Wherein,, data after the received drafting are synthesized according to said synthetic sign amount of drawing back each pixel of data, specifically can for:
Receive when the request transmitting terminal after the drafting of request receiving end feedback after the data; Judge whether to exist and formerly draw the back data; If; Then with data after the current received drafting as current drafting back data; And according to the said current synthetic sign amount of drawing the synthetic sign amount of each pixel in the data of back and formerly drawing respective pixel in the data of back; Said current drafting back data and the said back data of formerly drawing synthesize processing, and will synthesize afterwards data as new drafting formerly after data; Otherwise, with data after the current received drafting as formerly drawing the back data;
Data after the drafting that receives are carried out above-mentioned processing, and confirm that the image after final synthesizing is the image after the distributed drawing of three-dimensional modeling data.
Being understandable that, can drawing the back data to all that receive according to actual conditions and carry out above-mentioned synthetic processing, perhaps data after the drafting that receives and satisfy request transmitting terminal particular demands are carried out above-mentioned processing, all is rational.Simultaneously; Generally will ask that transmitting terminal receives and satisfy particular demands first draw back data as formerly drawing the back data; And with follow-up that receive and satisfy the drafting of particular demands after data successively as current drafting back data; Carry out specific synthetic processing with the back data of formerly drawing of current existence; And will synthesize the back data as new drafting formerly after data; After data after the drafting that satisfies the demands are all handled with formerly drafting back data are synthetic, the image after the distributed drawing of formation three-dimensional modeling data.
Further; As shown in Figure 2; More little with the pixel depth value is example from the near more situation of viewpoint; Said according to the said current synthetic sign amount of drawing the synthetic sign amount of each pixel in the data of back and formerly drawing respective pixel in the data of back; Said current drafting back data and the said back data of formerly drawing are synthesized processing, can comprise:
Step S201 confirms as current pixel Pi to be analyzed with one on the pairing view window of the said view controlled variable pixel of not analyzing;
The image of drawing in the data of back is that the request receiving end is after receiving corresponding drawing data request; According to the view controlled variable drawing three-dimensional model data of carrying in the said drawing data request; Generate the identical image of outsourcing rectangle size with the corresponding view window of said view controlled variable, the pixel of the image after the pixel of the image after the pixel on the pairing view window of just said view controlled variable and said current the drafting in the data and the said drafting formerly in the data is one to one.
Step S202 confirms as current synthetic sign amount Zi to be analyzed with the pairing synthetic sign amount of current pixel Pi to be analyzed in the data of said current drafting back;
Step S203 judges whether the pixel depth that writes down among the said current synthetic sign amount Zi to be analyzed equals initial value, if, execution in step S207 then; Otherwise, execution in step S204;
Wherein, the described pixel depth initial value of present embodiment is a maximum value.Be understandable that according to different systems, if the pixel depth value is more little near more from viewpoint, then said pixel depth initial value is composed maximum value; If the pixel depth value is near more from viewpoint more greatly, then said pixel depth initial value is composed minimal value.Wherein, when pixel depth is initial value, mean that said pixel also do not drawn by any three-dimensional model.
Step S204 obtains the said pairing synthetic sign amount Zi ' of current pixel Pi to be analyzed in the data of back that formerly draws;
Step S205; Judge that whether the pixel depth that writes down among the said current synthetic sign amount Zi to be analyzed formerly draw the pixel depth that the pairing synthetic sign amount Zi ' of current pixel Pi to be analyzed is write down in the data of back less than said; If, execution in step S206 then; Otherwise, execution in step S207;
Step S206 replaces with the pairing current data of drawing in the data of back of said current pixel Pi to be analyzed, execution in step S208 with the pairing data of formerly drawing in the data of back of said current pixel Pi to be analyzed;
Step S207 keeps the pairing data of formerly drawing in the data of back of said current pixel Pi to be analyzed;
Step S208 judges whether there is the pixel of not analyzed in the said view window, if, execution in step S201 then; Otherwise, finish.
When the pixel depth value is more little when viewpoint is nearer, can accomplish by the way said current drafting back data and the said back data of formerly drawing are synthesized processing.
Simultaneously; As shown in Figure 3; With the pixel depth value is example from the near more situation of viewpoint more greatly; Said according to the said current synthetic sign amount of drawing the synthetic sign amount of each pixel in the data of back and formerly drawing respective pixel in the data of back; Said current drafting back data and the said back data of formerly drawing are synthesized processing, can comprise:
Step S301 confirms as current pixel Pi to be analyzed with one on the pairing view window of the said view controlled variable pixel of not analyzing;
The image of drawing in the data of back is that the request receiving end is after receiving corresponding drawing data request; According to the view controlled variable drawing three-dimensional model data of carrying in the said drawing data request; Generate the identical image of outsourcing rectangle size with the corresponding view window of said view controlled variable, the pixel of the image after the pixel of the image after the pixel on the pairing view window of just said view controlled variable and said current the drafting in the data and the said drafting formerly in the data is one to one.
Step S302 confirms as current synthetic sign amount Zi to be analyzed with the pairing synthetic sign amount of current pixel Pi to be analyzed in the data of said current drafting back;
Step S303 judges whether the pixel depth that writes down among the said current synthetic sign amount Zi to be analyzed equals initial value, if, execution in step S307 then; Otherwise, execution in step S304;
Wherein, the described pixel depth initial value of present embodiment is a minimal value.Be understandable that according to different systems, if the pixel depth value is more little near more from viewpoint, then said pixel depth initial value is composed maximum value; If the pixel depth value is near more from viewpoint more greatly, then said pixel depth initial value is composed minimal value.Wherein, when pixel depth is initial value, mean that said pixel also do not drawn by any three-dimensional model.
Step S304 obtains the said pairing synthetic sign amount Zi ' of current pixel Pi to be analyzed in the data of back that formerly draws;
Step S305; Judge that whether the pixel depth that writes down among the said current synthetic sign amount Zi to be analyzed formerly draw the pixel depth that the pairing synthetic sign amount Zi ' of current pixel Pi to be analyzed is write down in the data of back greater than said; If, execution in step S306 then; Otherwise, execution in step S307;
Step S306 replaces with the pairing current data of drawing in the data of back of said current pixel Pi to be analyzed, execution in step S308 with the pairing data of formerly drawing in the data of back of said current pixel Pi to be analyzed;
Step S307 keeps the pairing data of formerly drawing in the data of back of said current pixel Pi to be analyzed;
Step S308 judges whether there is the pixel of not analyzed in the said view window, if, execution in step S301 then; Otherwise, finish.
When the pixel depth value more greatly from viewpoint when nearer, can accomplish by the way to said current draftings back data and said drafting formerly afterwards data synthesize processing.
Be understandable that the synthetic processing mode to a plurality of images that present embodiment provided only is a kind of example, should do not constitute restriction the present invention program.
From the angle of request receiving end, the distributed drawing practice of a kind of three-dimensional modeling data that provides of the present invention is introduced below.
As shown in Figure 4, the distributed drawing practice of a kind of three-dimensional modeling data can comprise:
Step S401 receives the drawing data request that the request transmitting terminal sends, and the view controlled variable is carried in said drawing data request;
Wherein, said view controlled variable comprises: outsourcing rectangle, viewpoint parameter and the projective parameter of view window.
Step S402, according to said view controlled variable drawing three-dimensional model data, and the identical image of outsourcing rectangle size of the corresponding view window of generation and said view controlled variable;
Step S403; Obtain each pixel depth on the said image; And said pixel depth is used for constituting the synthetic sign amount of respective pixel, said pixel depth is used to judge the distance of the distance of the determined viewpoint of the pairing three-dimensional modeling data said view controlled variable of distance of each pixel;
Be understandable that said synthetic sign amount can also comprise information such as the label, pixel transparency of three-dimensional model.
Wherein, the account form of each pixel depth can be selected different algorithms according to actual conditions on the said image, for example: Z-buffer algorithm.
Be example with the Z-buffer algorithm below, the calculating of pixel depth introduced:
Z-buffer algorithm also is depth buffer algorithm, belongs to the image space efficient rendering algorithm, and it at first obtains the view coordinate of said view window according to the view controlled variable with the original coordinates conversion of three-dimensional modeling data, carries out analytical calculation then.
Depth buffer algorithm has two impact dampers: depth buffer and frame buffer, corresponding two arrays: degree of depth array depth (x, y) with attribute array intensity (x, y).The former is depositing the z coordinate of each visible pixels of image space, and the latter is used for attribute (light intensity or the color) value of each visible pixels of memory image space.
Wherein, the Z-buffer algorithm basic thought is following:
The degree of depth of pairing all dough sheets of each pixel of projection plane (plane or curved surface) is compared, get then from the property value of the nearest dough sheet of sight line property value as this pixel.
Algorithm calculates the degree of depth of each body surface apart from viewing plane along the Z axle of view coordinate usually, and it is handled separately each body surface in the scene, and pointwise is carried out on each dough sheet.The description of object is converted into after the projected coordinate system, each point on the polygon facet (x, y, z) all corresponding to the forward projection point on the viewing plane (x, y).Thereby (x, y), the comparison of its degree of depth can relatively realizing through their z values for each pixel on the viewing plane.For right-handed coordinate system, the maximum point of z value should be visible.As shown in Figure 5, on viewing plane, face s1 opposite face s2, face s3 are nearest from viewpoint, thus it in this position (x, y) visible.
The Z-buffer algorithm step is following:
When initial, all unit of depth buffer all are changed to from viewpoint value farthest, and each unit of frame buffer all is changed to background colour, handles each dough sheet in the polygon table then one by one.Every scanning delegation, calculate each pixel of this row (x, y) pairing depth value z (x, y), and the depth value depth that this pixel cell in result and the depth buffer is stored (x y) compares.
According to different systems, if the pixel depth value is more little near more from viewpoint:
If z<depth (x, y), then depth (x, y)=z
If the pixel depth value is near more from viewpoint more greatly:
If z>depth (x, y), then depth (x, y)=z
And with the property value I of this pixel (x y) writes frame buffer, promptly
intensity(x,y)=I(x,y)
Otherwise it is constant.
Wherein, utilize the Z-buffer algorithm calculating pixel degree of depth can be specific as follows:
If known polygonal equation, then the available delta method is calculated the degree of depth of each pixel of sweep trace.
If plane equation is:
Ax+By+Cz+D=0
Then the point on the polygon facet (x, y) pairing depth value is:
Because the level interval on all sweep traces between consecutive point is 1 pixel unit, the vertical interval between sweep trace is capable and capable also is 1.Therefore can utilize this continuity to simplify computation process, like Fig. 6, shown in Figure 7.
(x, depth value y) is Z as if calculating
i, along the adjacent coherent point of x direction (x+1, depth value zi+1 y) can be calculated by following formula:
Should calculate the scope of y coordinate earlier along the calculating of y direction, handle each dough sheet then from top to bottom one by one.Top sweep trace by the top sets out, along the coordinate of each point on the polygon left margin recursive calculation border:
Here m is the slope on this limit, also can recursive calculation come out along the degree of depth on this limit, that is:
If this limit is a vertical boundary, then computing formula is reduced to:
For every sweep trace, at first calculate and its pairing depth value of the leftmost intersection point of polygon that intersects according to formula (3), then, subsequent point all on this sweep trace are calculated by (4) formula.
All polygons dispose, and promptly get the figure after the blanking, have also just obtained the pairing degree of depth of each pixel on the image, and then can constitute the pairing synthetic labelled amount of pixel.
Step S404, the synthetic sign amount that the image after the said drafting and each pixel is corresponding sends to the described request transmitting terminal as drawing the back data.
In the technical scheme that the embodiment of the invention provided; When needs drawing three-dimensional model data; The request transmitting terminal sends the drawing data request that carries view control parameter accordingly to a plurality of request receiving terminals; And when receive described request receiving terminal feedback corresponding with described request, comprise after the drafting of controlling the corresponding synthetic sign amount of each pixel on parameter pairing image of drawing three-dimensional model data and the said image according to view after the data; Synthetic sign amount according to each pixel; A plurality of images are synthesized processing, are the image after the distributed drawing of three-dimensional modeling data to confirm image after synthetic.In the scheme provided by the present invention, through sending corresponding drawing data request to a plurality of request receiving ends, and data are synthesized processing after will asking the drafting of receiving end feedback, realize the distributed drawing of three-dimensional modeling data with this.
Description through above method embodiment; The those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential general hardware platform; Can certainly pass through hardware, but the former is better embodiment under a lot of situation.Based on such understanding; The part that technical scheme of the present invention contributes to prior art in essence in other words can be come out with the embodied of software product; This computer software product is stored in the storage medium; Comprise that some instructions are with so that a computer equipment (can be a personal computer; Server, the perhaps network equipment etc.) carry out all or part of step of the said method of each embodiment of the present invention.And aforesaid storage medium comprises: various media that can be program code stored such as ROM (read-only memory) (ROM), random-access memory (ram), magnetic disc or CD.
Corresponding to top method embodiment, the embodiment of the invention also provides a kind of three-dimensional modeling data distributed plotting unit, and this device as shown in Figure 8, can comprise as the request transmitting terminal:
Request sending module 110 is used for sending the drawing data request to a plurality of request receiving ends, carries the view controlled variable in the said drawing data request;
Data reception module 120; Be used to receive data after drafting feedback, corresponding with said drawing data request of described request receiving end, data comprise the synthetic sign amount of receiving end according to each pixel correspondence on pairing image of view controlled variable drawing three-dimensional model data and the said image of asking after the said drafting;
Merge processing module 130, be used for synthetic sign amount, data after the received drafting are synthesized according to each pixel of data after said the drafting.
Be understandable that, can be computer equipment, cell phone apparatus etc. as the distributed plotting unit of three-dimensional modeling data of asking transmitting terminal.
Wherein, merge processing module 130, can comprise:
First judging unit is used for after receiving the drafting of asking the receiving end feedback, after the data, judging whether to exist and formerly drawing the back data, if then triggering merges processing unit; Otherwise, trigger formerly data and confirm the unit;
Merge processing unit; Be used for data after the current received drafting as current drafting back data; And according to the said current synthetic sign amount of drawing the synthetic sign amount of each pixel in the data of back and formerly drawing pairing pixel in the data of back; Said current drafting back data and the said back data of formerly drawing are synthesized processing, and the data after will synthesizing as new drafting formerly after data;
Formerly data are confirmed the unit, are used for data after the current received drafting as formerly drawing the back data.
The embodiment of the invention also provides a kind of three-dimensional modeling data distributed plotting unit, and this device as shown in Figure 9, can comprise as the request receiving end:
Request receiver module 210 is used to receive the drawing data request that the request transmitting terminal sends, and the view controlled variable is carried in said drawing data request, and said view controlled variable comprises: outsourcing rectangle, viewpoint parameter and the projective parameter of view window;
Image generation module 220 is used for according to said view controlled variable drawing three-dimensional model data, and the identical image of outsourcing rectangle size of the corresponding view window of generation and said view controlled variable;
Sign amount generation module 230; Be used to obtain each pixel depth on the said image; And said pixel depth is used for constituting the synthetic sign amount of respective pixel, said pixel depth is used to judge the distance of the distance of the determined viewpoint of the pairing three-dimensional modeling data said view controlled variable of distance of each pixel;
Data transmission blocks 240 is used for the synthetic sign amount that the image after the said drafting and each pixel is corresponding and sends to the described request transmitting terminal as drawing the back data.
Be understandable that for image processing server or to have other equipment etc. of image processing function as the distributed plotting unit of three-dimensional modeling data of request receiving end.
For device or system embodiment, because it is basically corresponding to method embodiment, so relevant part gets final product referring to the part explanation of method embodiment.Device described above or system embodiment only are schematic; Wherein said unit as the separating component explanation can or can not be physically to separate also; The parts that show as the unit can be or can not be physical locations also; Promptly can be positioned at a place, perhaps also can be distributed on a plurality of network element.Can realize the purpose of present embodiment scheme according to the needs selection some or all of module wherein of reality.Those of ordinary skills promptly can understand and implement under the situation of not paying creative work.
In several embodiment provided by the present invention, should be understood that, the system that is disclosed, apparatus and method not surpassing in the application's the spirit and scope, can realize through other mode.Current embodiment is a kind of exemplary example, should be as restriction, and given particular content should in no way limit the application's purpose.For example, the division of said unit or subelement only is that a kind of logic function is divided, and during actual the realization other dividing mode can be arranged, and for example a plurality of unit or a plurality of subelement combine.In addition, a plurality of unit can or assembly can combine or can be integrated into another system, or some characteristics can ignore, or do not carry out.
In addition, institute's descriptive system, the synoptic diagram of apparatus and method and different embodiment, in the scope that does not exceed the application, can with other system, module, technology or method combine or are integrated.Another point, the coupling each other that shows or discuss or directly coupling or communication to connect can be through some interfaces, the indirect coupling of device or unit or communication connect, and can be electrically, machinery or other form.
The above only is the specific embodiment of the present invention; Should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; Can also make some improvement and retouching, these improvement and retouching also should be considered as protection scope of the present invention.