Embodiment
In order to realize, the three-dimensional model of distributed storage is carried out to distributed plotting, then be effectively presented at a client requests end, realize the distributed drawing of three-dimensional modeling data, the embodiment of the present invention provides the 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, request transmitting terminal sends and comprises the corresponding drawing data request that identical view is controlled parameter to a plurality of request receiving ends; Each request receiving end is after receiving drawing data request, and feedback is drawn rear data accordingly; And request transmitting terminal after data, synthesize processing to data after a plurality of draftings after the drafting that receives each request receiving end feedback, take and determine image after the synthesizing image after the distributed drawing of three-dimensional modeling data.
Therefore the scheme that, the embodiment of the present invention provides can effectively realize the distributed drawing of three-dimensional modeling data.
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
For the understanding of the convenient scheme that the embodiment of the present invention is provided, first to three-dimensional model, the procedure for displaying in view window is simply introduced.The procedure for displaying of three-dimensional model in view window is generally:
First by spatial data index, the three-dimensional model that meets given space condition is taken out through transmission medium and passes to three-dimensional model user (as client); Then, after three-dimensional modeling data being carried out to a series of coordinate transform and processing, be transformed to the coordinate points on two dimensional image; According to display parameter, three-dimensional model is finally tiled into image pixel by drawing algorithm, is depicted as a width grating image, in client, shows or output (as computer screen shows, printout and synthetic image file output etc. on paper).The wherein drafting of three-dimensional model, is finally drawn algorithm and is summed up as the operation of pixel one by one, and what finally can be revealed is to be all plotted in the pixel that the nearest three-dimensional modeling data of three-dimensional modeling data middle distance observation point in same pixel is drawn.
Therefore, the present invention proposes to control with identical view control parameter the distributed plotting of three-dimensional modeling data, the degree of depth of each pixel on while document image, be used for judging that the corresponding three-dimensional modeling data of pixel is apart from the distance of the distance of the determined viewpoint of described view control parameter, form the synthetic labelled amount of respective pixel, finally according to the synthetic labelled amount of pixel, a plurality of images after drawing are synthesized, determine that the image after synthesizing is the image after the distributed drawing of three-dimensional modeling data.
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 present invention is provided is introduced below.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, request transmitting terminal sends drawing data request to a plurality of request receiving ends, in described drawing data request, carries view control parameter;
Be understandable that, described request receiving end can or have other equipment of image processing function etc. for image processing server.
At a plurality of request receiving ends, storing under the scene of the three-dimensional modeling data of asking the required demonstration of transmitting terminal, when needs drawing three-dimensional model data, request transmitting terminal is according to the definite view control parameter of view window of carrying out three-dimensional modeling data demonstration, generate corresponding drawing data request, and generated drawing data request is sent to corresponding request receiving end.
Wherein, described view control parameter can comprise:
The outsourcing rectangle of view window, viewpoint parameter and projective parameter; Described viewpoint parameter comprises the position O (x of viewpoint in world coordinate system
o, y
o, z
o), x wherein
o, y
o, z
orepresent three components, the viewpoint observed target location A (x 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); By viewpoint parameter, can determine a transformation matrix, the apex coordinate in original coordinate system is transformed under eye coordinate.Projective parameter comprises: rectangular projection and perspective projection.Or the viewing matrix obtaining by above-mentioned parameter and projection matrix.
Step S102, data after drafting feedback, corresponding with described drawing data request of reception described request receiving end;
Wherein, after described drafting, packet contains the request receiving end synthetic sign amount corresponding according to each pixel on the corresponding image of view control parameter drawing three-dimensional model data and described image.
Request receiving end is after receiving corresponding drawing data request, according to the view control parameter drawing three-dimensional model data of carrying in described drawing data request, generate the identical image of outsourcing rectangle size of the view window corresponding with described view control parameter, record synthetic sign amount corresponding to each pixel on described image, described synthetic sign amount includes the degree of depth of pixel on described image simultaneously.Wherein, the degree of depth of described pixel is for judging the distance of the distance of the determined viewpoint of the corresponding three-dimensional modeling data described view control parameter of distance of each pixel.Finally, request receiving end using the corresponding image of drawing three-dimensional model data and synthetic sign amount corresponding to each pixel after drawing data feedback to described request transmitting terminal.Be understandable that, in described synthetic sign amount, can also comprise the identification number of three-dimensional model, the information such as transparency of pixel.
It should be noted that, in the present embodiment, according to view control parameter, with raster data structure, represent the pixel of view window, described pixel is the uniform grid unit that view window plane is divided into, described pixel is the essential information storage unit in raster data, and the coordinate position of described pixel is determined according to described pixel corresponding line number and row number in described view window.Suppose to be expressed as with zValue the degree of depth (being z coordinate) of pixel, according to different systems, if pixel depth value less from viewpoint more close to, represent that the initial value of the raster data of pixel depth is composed maximum value; If pixel depth value more greatly from viewpoint more close to, represent that the initial value of the raster data of pixel depth is composed minimal value.Wherein, when pixel depth is initial value, mean that described pixel also do not drawn by any three-dimensional model.
Step S103, according to the synthetic sign amount of each pixel in data after described drafting, synthesizes data after received drafting, take and determines image after the synthetic image after the distributed drawing of three-dimensional modeling data.
Request transmitting terminal is after the corresponding drafting that receives request receiving end feedback after data, utilize the synthetic sign amount of drawing pixel in rear data, data after received a plurality of draftings are synthesized to processing, namely a plurality of images are synthesized to processing, make with nearly thing, to replace thing far away in Pixel-level, and the sequence independence occurring on screen with body.
Wherein, according to the synthetic sign amount of each pixel of data after described drafting, data after received drafting are synthesized, are specifically as follows:
When request transmitting terminal receives after the drafting of request receiving end feedback after data, judge whether to exist and formerly draw rear data, if, using data data after current drafting after current received drafting, and according to the synthetic sign amount of respective pixel in data after the synthetic sign amount of each pixel in data after described current drafting and formerly drafting, data after data after described current drafting and described formerly drafting are synthesized to processing, and data data after new formerly drafting after synthesizing; Otherwise, using the data after formerly drawing of data after current received drafting;
Data after the drafting receiving are carried out to above-mentioned processing, and determine that the image after final synthesizing is the image after the distributed drawing of three-dimensional modeling data.
Be understandable that, can according to actual conditions to all draftings that receive after data carry out above-mentioned synthetic processing, or data after the drafting receiving and meet request transmitting terminal particular demands are carried out to above-mentioned processing, be all rational.Simultaneously, generally that receive and that meet particular demands first of request transmitting terminal drawn to rear data data after formerly drawing, and using follow-up that receive and meet after the drafting of particular demands data data after current drafting successively, carry out specific synthetic processing with data after the formerly drafting of current existence, and using synthetic rear data data after new formerly drafting, until data are all synthesized after processing with the rear data of formerly drafting after the drafting satisfying the demands, form the image after the distributed drawing of three-dimensional modeling data.
Further, as shown in Figure 2, the pixel depth value of take is less, and from viewpoint, the situation close to is more example, described according to the synthetic sign amount of respective pixel in data after the synthetic sign amount of each pixel in data after described current drafting and formerly drafting, data after data after described current drafting and described formerly drafting are synthesized to processing, can comprise:
Step S201, is defined as current pixel Pi to be analyzed by one in the corresponding view window of the described view control parameter pixel of not analyzing;
Image after drawing in data is that request receiving end is after receiving corresponding drawing data request, according to the view control parameter drawing three-dimensional model data of carrying in described drawing data request, generate the identical image of outsourcing rectangle size of the view window corresponding with described view control parameter, namely after the pixel in the corresponding view window of described view control parameter and described current drafting, the pixel of the image in data and described pixel of formerly drawing the image in rear data are one to one.
Step S202, is defined as current synthetic sign amount Zi to be analyzed by the corresponding synthetic sign amount of current pixel Pi to be analyzed in data after described current drafting;
Step S203, judges that whether the pixel depth recording in described current synthetic sign amount Zi to be analyzed equals initial value, if so, performs step S207; Otherwise, execution step S204;
Wherein, the pixel depth initial value described in the present embodiment is maximum value.Be understandable that, according to different systems, if pixel depth value less from viewpoint more close to, described pixel depth initial value is composed maximum value; If pixel depth value more greatly from viewpoint more close to, described pixel depth initial value is composed minimal value.Wherein, when pixel depth is initial value, mean that described pixel also do not drawn by any three-dimensional model.
Step S204, the corresponding synthetic sign amount Zi ' of current pixel Pi to be analyzed in data after formerly drawing described in acquisition;
Step S205, judge the pixel depth recording in described current synthetic sign amount Zi to be analyzed is formerly drawn the pixel depth that in rear data, the corresponding synthetic sign amount Zi ' of current pixel Pi to be analyzed records described in whether being less than, if so, perform step S206; Otherwise, execution step S207;
Step S206, by described current pixel Pi to be analyzed is corresponding formerly draw after data replacement in data be the data in data after the corresponding current drafting of described current pixel Pi to be analyzed, execution step S208;
Step S207, retains the corresponding data of formerly drawing in rear data of described current pixel Pi to be analyzed;
Step S208, judges in described view window whether have not analyzed pixel, if so, performs step S201; Otherwise, finish.
When pixel depth value less from viewpoint more close to time, can complete by the way to data after described current drafting and described formerly draw after data synthesize processing.
Simultaneously, as shown in Figure 3, the pixel depth value of take is larger, and from viewpoint, the situation close to is more example, described according to the synthetic sign amount of respective pixel in data after the synthetic sign amount of each pixel in data after described current drafting and formerly drafting, data after data after described current drafting and described formerly drafting are synthesized to processing, can comprise:
Step S301, is defined as current pixel Pi to be analyzed by one in the corresponding view window of the described view control parameter pixel of not analyzing;
Image after drawing in data is that request receiving end is after receiving corresponding drawing data request, according to the view control parameter drawing three-dimensional model data of carrying in described drawing data request, generate the identical image of outsourcing rectangle size of the view window corresponding with described view control parameter, namely after the pixel in the corresponding view window of described view control parameter and described current drafting, the pixel of the image in data and described pixel of formerly drawing the image in rear data are one to one.
Step S302, is defined as current synthetic sign amount Zi to be analyzed by the corresponding synthetic sign amount of current pixel Pi to be analyzed in data after described current drafting;
Step S303, judges that whether the pixel depth recording in described current synthetic sign amount Zi to be analyzed equals initial value, if so, performs step S307; Otherwise, execution step S304;
Wherein, the pixel depth initial value described in the present embodiment is minimal value.Be understandable that, according to different systems, if pixel depth value less from viewpoint more close to, described pixel depth initial value is composed maximum value; If pixel depth value more greatly from viewpoint more close to, described pixel depth initial value is composed minimal value.Wherein, when pixel depth is initial value, mean that described pixel also do not drawn by any three-dimensional model.
Step S304, the corresponding synthetic sign amount Zi ' of current pixel Pi to be analyzed in data after formerly drawing described in acquisition;
Step S305, judge the pixel depth recording in described current synthetic sign amount Zi to be analyzed is formerly drawn the pixel depth that in rear data, the corresponding synthetic sign amount Zi ' of current pixel Pi to be analyzed records described in whether being greater than, if so, perform step S306; Otherwise, execution step S307;
Step S306, by described current pixel Pi to be analyzed is corresponding formerly draw after data replacement in data be the data in data after the corresponding current drafting of described current pixel Pi to be analyzed, execution step S308;
Step S307, retains the corresponding data of formerly drawing in rear data of described current pixel Pi to be analyzed;
Step S308, judges in described view window whether have not analyzed pixel, if so, performs step S301; Otherwise, finish.
When pixel depth value more greatly from viewpoint more close to time, can complete by the way to data after described current drafting and described formerly draw after data synthesize processing.
Be understandable that, the synthetic processing mode to a plurality of images that the present embodiment provides is only a kind of example, should not form the restriction to the present invention program.
From the angle of request receiving end, the distributed drawing practice of of the present invention provided a kind of three-dimensional modeling data 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 request transmitting terminal sends, and view control parameter is carried in described drawing data request;
Wherein, described view control parameter comprises: outsourcing rectangle, viewpoint parameter and the projective parameter of view window.
Step S402, according to described view control parameter drawing three-dimensional model data, and the identical image of outsourcing rectangle size of the generation view window corresponding with described view control parameter;
Step S403, obtain each pixel depth on described image, and described pixel depth being used for forming the synthetic sign amount of respective pixel, described pixel depth is for judging the distance of the distance of the determined viewpoint of the corresponding three-dimensional modeling data described view control parameter of distance of each pixel;
Be understandable that, described synthetic sign amount can also comprise the information such as the label, pixel transparency of three-dimensional model.
Wherein, on described image, the account form of each pixel depth can be selected different algorithms according to actual conditions, for example: Z-buffer algorithm.
Z-buffer algorithm take below as example, the calculating of pixel depth be introduced:
Z-buffer algorithm is also depth buffer algorithm, belongs to image space efficient rendering algorithm, and first it obtain the original coordinates conversion of three-dimensional modeling data according to view control parameter the view coordinate of described view window, then carries out analytical calculation.
Depth buffer algorithm has two impact dampers: depth buffer and frame buffer, corresponding two arrays: degree of depth array depth (x, y) and 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, Z-buffer algorithm basic thought is as follows:
The degree of depth of the corresponding all dough sheets of each pixel of projection plane (plane or curved surface) is compared, then get the property value as this pixel from the property value of the nearest dough sheet of sight line.
Algorithm calculates each body surface apart from the degree of depth of viewing plane along the Z axis of view coordinate conventionally, and it is processed separately each body surface in scene, and pointwise is carried out on each dough sheet.After the description of object is converted into projected coordinate system, each point (x, y, z) on polygon facet is all corresponding to the forward projection point (x, y) on viewing plane.Thereby for each pixel (x, y) on viewing plane, the comparison of its degree of depth can relatively realizing by their z values.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, so it is visible in this position (x, y).
Z-buffer algorithm step is as follows:
When initial, all unit of depth buffer are all set to from viewpoint value farthest, and each unit of frame buffer is all set to background colour, then processes one by one each dough sheet in polygon table.Every scanning a line, calculate each corresponding depth value z of pixel (x, y) (x, y) of this row, and the depth value depth (x, y) that this pixel cell in result and depth buffer is stored compares.
According to different systems, if pixel depth value less from viewpoint more close to:
If z < depth (x, y), depth (x, y)=z
If pixel depth value more greatly from viewpoint more close to:
If z > depth (x, y), depth (x, y)=z
And the property value I (x, y) of this pixel is write to frame buffer,
intensity(x,y)=I(x,y)
Otherwise constant.
Wherein, utilize the Z-buffer algorithm calculating pixel degree of depth can be specific as follows:
If known polygonal equation, available delta method is calculated the degree of depth of each pixel of sweep trace.
If plane equation is:
Ax+By+Cz+D=0
The corresponding depth value of point (x, y) on polygon facet is:
Because the level interval between consecutive point on all sweep traces is 1 pixel unit, the vertical interval between sweep trace is capable and capable is also 1.Therefore can utilize this continuity to simplify computation process, as shown in Figure 6, Figure 7.
If having calculated the depth value of (x, y) point is Z
i, the depth value zi+1 of adjacent coherent point (x+1, y) can be calculated by following formula in the x-direction:
Along the calculating of y direction, should first calculate the scope of y coordinate, then process one by one from top to bottom each dough sheet.Top sweep trace by the top sets out, along the coordinate of each point on polygon left margin recursive calculation border:
Here the slope that m is this limit, along the degree of depth on this limit also can recursive calculation out, that is:
If this limit is a vertical boundary, computing formula is reduced to:
For every sweep trace, first according to formula (3), calculate the corresponding depth value of the leftmost intersection point of the polygon crossing with it, then, subsequent point all on this sweep trace are calculated by (4) formula.
All polygons are disposed, and obtain the figure after blanking, have also just obtained the corresponding degree of depth of each pixel on image, and then can form the corresponding synthetic labelled amount of pixel.
Step S404, sends to described request transmitting terminal using the image after described drafting and synthetic sign amount data after drawing corresponding to each pixel.
In the technical scheme that the embodiment of the present invention provides, when needs drawing three-dimensional model data, request transmitting terminal sends the drawing data request that carries accordingly view control parameter to a plurality of request receiving ends, and when receiving the corresponding with described request of described request receiving end feedback, comprise according to after data after the drafting of synthetic sign amount corresponding to each pixel on the corresponding image of view control parameter drawing three-dimensional model data and described image, according to the synthetic sign amount of each pixel, a plurality of images are synthesized to processing, take and determine image after the synthetic image after the distributed drawing of three-dimensional modeling data.In scheme provided by the present invention, by sending corresponding drawing data request to a plurality of request receiving ends, and data after the drafting of request receiving end feedback are synthesized to processing, with this, realize the distributed drawing of three-dimensional modeling data.
By the description of above embodiment of the method, those skilled in the art can be well understood to the mode that the present invention can add essential general hardware platform by software and realize, can certainly pass through hardware, but in a lot of situation, the former is better embodiment.Understanding based on such, the part that technical scheme of the present invention contributes to prior art in essence in other words can embody with the form of software product, this computer software product is stored in a storage medium, comprise that some instructions are with so that a computer equipment (can be personal computer, server, or the network equipment etc.) carry out all or part of step of method described in 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 CDs.
Corresponding to embodiment of the method above, the embodiment of the present invention also provides a kind of three-dimensional modeling data distributed plotting unit, and this device, as request transmitting terminal, as shown in Figure 8, can comprise:
Request sending module 110, for sending drawing data request to a plurality of request receiving ends, carries view control parameter in described drawing data request;
Data reception module 120, for receiving data after drafting described request receiving end feedback, corresponding with described drawing data request, after described drafting, packet contains the request receiving end synthetic sign amount corresponding according to each pixel on the corresponding image of view control parameter drawing three-dimensional model data and described image;
Merge processing module 130, for according to the synthetic sign amount of each pixel of data after described drafting, data after received drafting are synthesized.
Being understandable that, can be computer equipment, cell phone apparatus etc. as asking the distributed plotting unit of three-dimensional modeling data of transmitting terminal.
Wherein, merge processing module 130, can comprise:
The first judging unit, after data after the drafting when receiving request receiving end feedback, judges whether to exist and formerly draws rear data, if so, triggers and merges processing unit; Otherwise, trigger formerly data determining unit;
Merge processing unit, be used for data data after current drafting after current received drafting, and according to the synthetic sign amount of corresponding pixel in data after the synthetic sign amount of each pixel in data after described current drafting and formerly drafting, data after data after described current drafting and described formerly drafting are synthesized to processing, and the data data after new formerly drafting after synthetic;
Data determining unit formerly, for using the data after formerly drawing of data after current received drafting.
The embodiment of the present invention also provides a kind of three-dimensional modeling data distributed plotting unit, and this installs as request receiving end, as shown in Figure 9, can comprise:
Request receiving module 210, the drawing data request sending for receiving request transmitting terminal, view control parameter is carried in described drawing data request, and described view control parameter comprises: outsourcing rectangle, viewpoint parameter and the projective parameter of view window;
Image generation module 220, for according to described view control parameter drawing three-dimensional model data, and the identical image of outsourcing rectangle size of the generation view window corresponding with described view control parameter;
Sign amount generation module 230, be used for obtaining each pixel depth on described image, and described pixel depth being used for forming the synthetic sign amount of respective pixel, described pixel depth is for judging the distance of the distance of the determined viewpoint of the corresponding three-dimensional modeling data described view control parameter of distance of each pixel;
Data transmission blocks 240, for sending to described request transmitting terminal using the image after described drafting and synthetic sign amount data after drawing corresponding to each pixel.
Be understandable that can or there are other equipment of image processing function etc. for image processing server as the distributed plotting unit of three-dimensional modeling data of request receiving end.
For device or system embodiment, because it is substantially corresponding to embodiment of the method, so relevant part is referring to the part explanation of embodiment of the method.Device described above or system embodiment are only schematic, the wherein said unit as separating component explanation can or can not be also physically to separate, the parts that show as unit can be or can not be also physical locations, can be positioned at a place, or also can be distributed in a plurality of network element.Can select according to the actual needs some or all of module wherein to realize the object of the present embodiment scheme.Those of ordinary skills, in the situation that not paying creative work, are appreciated that and implement.
In several embodiment provided by the present invention, should be understood that, disclosed system, apparatus and method, not surpassing in the application's spirit and scope, can realize in other way.Current embodiment is a kind of exemplary example, should be as restriction, and given particular content should in no way limit the application's object.For example, the division of described unit or subelement, is only that a kind of logic function is divided, and during actual realization, can have other dividing mode, and for example a plurality of unit or a plurality of subelement combine.In addition, a plurality of unit can or assembly can in conjunction with or can be integrated into another system, or some features can ignore, or do not carry out.
In addition, institute's descriptive system, the schematic diagram of apparatus and method and different embodiment, within not exceeding the application's scope, can with other system, module, technology or method in conjunction with or integrated.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, indirect coupling or the communication connection of device or unit can be electrically, machinery or other form.
The above is only the specific embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.