CN107481307A - A kind of method of Fast rendering three-dimensional scenic - Google Patents

A kind of method of Fast rendering three-dimensional scenic Download PDF

Info

Publication number
CN107481307A
CN107481307A CN201710540801.0A CN201710540801A CN107481307A CN 107481307 A CN107481307 A CN 107481307A CN 201710540801 A CN201710540801 A CN 201710540801A CN 107481307 A CN107481307 A CN 107481307A
Authority
CN
China
Prior art keywords
depth
model
value
interface
tri patch
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710540801.0A
Other languages
Chinese (zh)
Other versions
CN107481307B (en
Inventor
吴斌
王勇
李冬
牟元恩
常英贤
焦洋
石鑫磊
张营
周佳
陈剑飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Shandong Electric Power Co Qufu Power Supply Co
State Grid Shandong Electric Power Co Ltd
TaiAn Power Supply Co of State Grid Shandong Electric Power Co Ltd
Original Assignee
State Grid Shandong Electric Power Co Qufu Power Supply Co
State Grid Shandong Electric Power Co Ltd
TaiAn Power Supply Co of State Grid Shandong Electric Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Shandong Electric Power Co Qufu Power Supply Co, State Grid Shandong Electric Power Co Ltd, TaiAn Power Supply Co of State Grid Shandong Electric Power Co Ltd filed Critical State Grid Shandong Electric Power Co Qufu Power Supply Co
Priority to CN201710540801.0A priority Critical patent/CN107481307B/en
Publication of CN107481307A publication Critical patent/CN107481307A/en
Application granted granted Critical
Publication of CN107481307B publication Critical patent/CN107481307B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Graphics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention provides a kind of method of Fast rendering three-dimensional scenic, including:Step S1000, judge the type of tri patch;Step S1100, if the first tri patch, rendered using the first rendering pipeline;Step S1200, if the second tri patch, rendered using the second rendering pipeline.Wherein, the first rendering pipeline and the second rendering pipeline are the rendering pipelines differed.

Description

A kind of method of Fast rendering three-dimensional scenic
Technical field
The present invention relates to a kind for the treatment of method and apparatus of threedimensional model, and in particular to a kind of method of three-dimension interaction, one The method of kind quick-searching threedimensional model, a kind of loading method of threedimensional model and a kind of method of Fast rendering three-dimensional scenic.
Background technology
In recent years, with the development of computer and the communication technology, the ability of computing device is the communication between computing device Efficiency obtains huge raising, promotes the information processing of power network and power system to be changed from two-dimensional signal to three-dimensional information, and Many aspects form technical exploration, experiment and broken through.
In terms of three-dimensional information acquisition, CN205375587 provides " emulation 3D Model Reconstructions device ", CN105760568 provides " apparatus and method for producing the 3D CAD models based on pipeline warm-up movement of support of pipelines ", CN105844703 provides " a kind of dimensional topography based on high accuracy DEM data simplifies algorithm ", and CN106067189 is provided " magnanimity three-dimensional cable and channel pattern automation modeling and rendering intent " etc..
In terms of three-dimensional information displaying, CN106802993 provides a kind of " exhibition of the operation of the electric network swim under three-dimensional scenic Existing method ", CN105956232 provides " a kind of transformer station's three-dimensional live analogue system and implementation method ", and CN105812697 is carried For " the 3D scene simulations method based on preprocessed video ", CN105808662 provides the " power network based on three dimensional virtual technique Facility layout program results method for visualizing ", CN106557602 provide that " a kind of space length based on GIS is checked three-dimensional imitative True method ", CN106408631 are provided " three-dimensional macro methods of exhibiting and system ", and CN105741430 provides that " one kind is used for Transmission line of electricity three-dimensional scenic emulation mode and system of web page display " etc..
On the basis of three-dimensional information displaying, some management methods to specific point of field are additionally provided, for example, CN106803004 provides " a kind of Quality Process monitoring data integrated approach based on three-dimensional construction model ", CN106787211 Provide " three-dimensional visualization transformer station on-line checking warning system and application method ", CN106650030 provides that " one kind is based on The substation equipment replacement method of three dimensional design platform ", CN106599373 provides the " transformer station based on three dimensional design platform Calculation of short-circuit current system and method ", CN205721989 provide a kind of " 3D transformer stations panorama based on Virtual Simulation Real-time monitoring system ", CN106097648 are provided " transformer station's fortune inspection working space three-dimensional security detection method " etc..
Although background technology achieves achievement on indivedual technology points, due to lacking unified planning, totle drilling cost is developed Preferably, and information island is easily formed, and then also results in following deficiency:Indivedual subdivision fields are only applicable to, versatility is low;With Family interaction is relatively complicated, and experience sense is poor.
The content of the invention
The defects of to overcome background technology, the invention provides a kind of method of three-dimension interaction, a kind of quick-searching is three-dimensional The method of model, a kind of loading method of threedimensional model and a kind of method of Fast rendering three-dimensional scenic.
Brief description of the drawings
Figure 1A is the network according to the invention topology diagram;
Figure 1B is the GUI schematic diagrames according to the three-dimension interaction of the present invention;
Fig. 2 is the flow chart according to the three-dimensional interaction method of the present invention;
Fig. 3 is the illustrative diagram of the metadata of threedimensional model according to an embodiment of the invention;
Fig. 4 is the method flow diagram according to the quick-searching threedimensional model of the present invention;
Fig. 5 is bounding box schematic diagram according to an embodiment of the invention;
Fig. 6 is bounding box schematic diagram according to a preferred embodiment of the invention;
Fig. 7 is the illustrative diagram of the metadata of threedimensional model in accordance with another embodiment of the present invention;
Fig. 8 is the volume concordance list schematic diagram according to the present invention;
Fig. 9 is the flow chart according to the three-dimensional loading method of the present invention;
Figure 10 is the area distributions schematic diagram according to the tri patch of the present invention;
Figure 11 is the method flow diagram according to a kind of Fast rendering three-dimensional scenic of the present invention;
Figure 12 is the relation schematic diagram of the depth scan block and scanning dough sheet according to the present invention;
Figure 13 is the illustrative diagram cached according to the depth buffer and depth block of the present invention;
Figure 14 is the illustrative diagram of the depth buffer and depth page according to the present invention.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, the present invention will be made further with reference to accompanying drawing It is described in detail.This description is to describe specific implementation consistent with the principles of the present invention by way of example, and not limitation Mode, the description of these embodiments is detailed enough, to enable those skilled in the art to put into practice the present invention, is not being taken off Other embodiment can be used in the case of from scope and spirit of the present invention and can change and/or replace each key element Structure.Therefore, the following detailed description should not be understood from restrictive, sense.
Present invention firstly provides a kind of system, including remote server, the first model database, the second model database And browsing client.Remote server and the communication connection of first and second model database, remote server and multiple browsing clients Connected by wired or wireless network.Original threedimensional model is stored with first model database, in the second model database It is stored with the threedimensional model of combination.Those skilled in the art know that the first model database and the second model database can be Logically separate but physically unseparated two databases or the database physically also separated of classifying in logic.
According to the present invention, the first model database is stored with threedimensional model, and threedimensional model includes three-dimensional data, interface number According to, model name, model description information and model metadata.Second model database is stored with the threedimensional model of combination, except Outside three-dimensional data, interface data, model name, model description information and model metadata, in addition to combination metadata.Tool The three-dimensional interaction method later in conjunction with the present invention is discussed in detail with explaining for the elaboration of body related content.
The present invention then provides a kind of GUI of three-dimension interaction, as shown in figure 1, the main interface 10 of the GUI is mainly wrapped Include scene area 12, Matching band 14, combination region 16, attribute area 18.Scene area 12 is used to show a threedimensional model or multiple three Dimension module, user can be to select the first model in the threedimensional model that is shown in scenic spot 12 on the scene.Matching band 14 is used for display can be with The threedimensional model list to match with the first model, a threedimensional model can be included in threedimensional model list, can also be included Multiple threedimensional models, user can select and the second model of the first Model Matching from the threedimensional model list of Matching band 14. Combination region 16 is used for the built-up pattern for showing the second model in the first model and Matching band 14 in scene area 12;Attribute area 18 For the attribute information for the first model for showing active user's selection.Those skilled in the art know that main interface 10 is interface The public affairs such as schematic diagram, the menu associated with interface, toolbar, slider bar, the function button including inquiry button or button The Man Machine Interface known in Fig. 1 by selectivity omission, with cause the present invention inventive concept and inventive point it is more prominent.But It is that this has no effect on the GUI using above-mentioned known Man Machine Interface without falling into protection scope of the present invention.
According to the present invention, GUI is located on browsing client, but those skilled in the art also know, without using Figure 1A In the case of shown system, such as use in the case that unit carries first and second model database, GUI can also be located at single In machine.
As shown in Fig. 2 the three-dimensional interaction method of the present invention comprises the following steps:
Step S110, user choose the first model.
User can click on the first model in selection scene area 12 by mouse, can also pass through the shortcut on keyboard Choose the first model.Preferably, GUI main interface 10 is shown on touch control device, therefore is allowed user using finger or touched Control equipment (such as stylus) and select the first model.
Threedimensional model in scene area 12 can be imported into by way of opening single 3 D model file, such case Suitable for the interactive operation for single force device threedimensional model;The scene of multiple threedimensional models can also be included by opening The mode of file is imported into, and such case, which is applied to transformer station, transmission line of electricity, control computer room etc., includes the three of multiple threedimensional models Tie up the interactive operation of scene.
Optionally, when the threedimensional model of importing only has one, the threedimensional model is chosen automatically as the first model.When leading When the threedimensional model entered is multiple (importing the scene for including multiple threedimensional models), user is just needed to select needs to interact First model of operation.
As it was noted above, threedimensional model includes three-dimensional data and interface data.Wherein, three-dimensional data is renders three-dimensional Data used in model, generally, three-dimensional data include the spatial position datas such as point data, line number evidence and face data. The generally triangular face data of face data (i.e. tri patch data).In addition, three-dimensional data can also include it is other kinds of Data, such as the data of wing-edge data structure.In the present invention, to simplify data store organisation, locus is identified in three-dimensional data Data be tri patch data, i.e. threedimensional model is made up of tri patch, and each tri patch includes three of triangle Summit P1, P2, P3, each summit have a corresponding space coordinates, i.e., P1 space coordinates is { x1, y1, z1 }, P2 space sits It is designated as { x2, y2, z2 }, P3 space coordinates is { x3, y3, z3 }.Also include the number of colours on each summit of triangle in three-dimensional data Texture coordinate according to the texture coordinate that, it is preferred that color data is vertex correspondence, such as P1 is { u1, v1 }, P2 texture coordinate For { u2, v2 }, P3 texture coordinate is { u3, v3 }.Texture coordinate is the pixel point coordinates of texture image, for from texture image The middle color value for obtaining Atria summit.In another embodiment, color data can also be defined as the color on summit Value, such as RGB color value, or RGBA color value, wherein A colors represent transparency, and relatively low three-dimensional is being required for color In model, such as pay attention to the force device of size or require in relatively low background model, can use such a mode, to be lifted Rendering efficiency.In yet another embodiment, color data can also include the normal vector on summit, to cause in particular light situation The reflected light on summit can be simulated by normal vector down, so as to calculate the color data for obtaining summit.
According to the present invention, interface data are used to indicate that the first model that active user chooses can with other threedimensional models It is combined interface.In power system, some threedimensional models can be combined with any other threedimensional model, such as be carried Platform.Some threedimensional models can only be combined by specific position (interface) and other threedimensional models, for example, distributing frame model and Wire jumper model, the i.e. spigot of distributing frame model are interface, are interface at the crystal head of wire jumper model.
According to the present invention, it is connected situation according to actual, a threedimensional model there can be an interface, it is possible to have Multiple interfaces.When with multiple interfaces, threedimensional model will include multigroup interface data.
According to an aspect of the present invention, interface data are the triangular apex for all tri patch for forming interface List.Because the major function of interface is to show the cohesive position between threedimensional model, therefore without requiring excessively fine Render, it is preferred that interface data for form interface all tri patch bounding box summit list, so as to The data volume of interface is greatly decreased while completion interface function, bounding box is the minimum that can accommodate all tri patch Cuboid, bounding box can use cuboid 8 vertex representations.Preferably, three sides on some summit of bounding box with Three reference axis of coordinate system are parallel where tri patch.For example, working as threedimensional model has 4 interface data, altogether including 500 During individual triangle, it is necessary to store 500*3=1500 vertex information when directly using tri patch as interface data.And During using bounding box as interface data, each bounding box only needs 8 vertex datas, therefore needs 8*4=32 top altogether Point data, so as to drastically reduce the area the data volume of storage interface, save memory space and lift interface render effect Rate.It is furthermore preferred that the vertex data of interface is represented using the fixed-point data of 16, without being used using usual vertex data 32 or 64 floating datas represent, so as to further save memory space and lift rendering efficiency.In saying for the present invention In bright book, if without refering in particular to, it is considered that interface is similar with the implication of the bounding box of interface.
According to the present invention, optionally, interface data are the triangular apex of all tri patch of composition interface List and the vertex list of bounding box.
According to the present invention, threedimensional model further comprises model name, model description information and model metadata.Model Title preferably can be identical with storing the filename of three-dimensional data.Model description information is to create or change the user of the model The text message being briefly described to model provided.
Model metadata includes:Model ID, interface quantity, three-dimensional data original position, three-dimensional data length, interface Feature list.Model ID is the one number of threedimensional model, and 32 fixed-point numbers represent.When interface quantity is 0, the three-dimensional is represented Model does not have interface, i.e., can be connected with any other threedimensional model, when interface quantity is other values, represents the three-dimensional The interface quantity that model has.Three-dimensional data original position and three-dimensional data length are respectively used to indicate three-dimensional data in three-dimensional Original position and data length in model, it is that 32 fixed-point numbers represent.
Interface feature list includes interface ID, interface mark, model quantity, model the ID row of each interface Table, interface data start.Interface ID is the one number in threedimensional model internal cohesion face, and 8 fixed-point numbers represent, meaning Taste each threedimensional model and is at best able to set 256 interfaces.Interface identifies the interface attribute for mark, and 8 fixed Points represent:When its value is 1, represent that the interface is merely able to be connected with the interface stored in interface feature list; (optional) represents that the interface is preferably connected with the interface stored in interface feature list when its value is 2, but It can be connected by the bounding box of interface with other threedimensional models.Model ID lists are that can be connected all by the interface The model ID lists of other models.Interface data start is the original position of current interface in the three-dimensional model, should In embodiment, because interface is using 8 vertex datas expression of bounding box, therefore the data length of interface is fixed value, It need not represent in the metadata.If it will be apparent to those skilled in the art that represent interface using tri patch list, The data length of interface is should also contain in interface feature list.
In the example depicted in fig. 4, threedimensional model includes two interfaces (ID1 and ID2), interface ID1 can and its He is connected two threedimensional models (ID1_1 and ID1_2), and interface ID2 can be with other three threedimensional models (ID2_1, ID2_2 And ID2_3) linking.Interface ID1 interface is identified as 1, it is meant that, interface ID1 be only capable of with threedimensional model (ID1_1 and ID1_2) it is connected, interface ID2 interface is identified as 2, it is meant that, interface ID2 is acceptable and except threedimensional model (ID2_ 1st, ID2_2 and ID2_3) outside other threedimensional models linking, as long as the bounding box for two interfaces being mutually linked meets spy Fixed condition.
Step S120, obtain the interface quantity of the first model.
According to the present invention, after user chooses the first model, the metadata of the first model is obtained, reads the linking in metadata Face quantity.If the interface quantity is 0, the display reminding information in GUI attribute area 18, such as " threedimensional model does not have Have interface ", then perform step S210;If the interface quantity is not 0, the number of display interface in attribute area 18 Amount, then perform step S310.
Step S210, input inquiry word, obtain Matching Model.
According to the present invention, when the first model does not have interface, user's (being especially the user using browsing client) Query interface (interface that " input inquiry content " is shown as in such as Figure 1B) input inquiry in GUI Matching band 14 can be passed through Word is retrieved, so as to obtain the Matching Model matched with query word.Comprise the following steps that:
Step S220, browsing client obtain the query word of user's input, and query word is sent into remote server.
Step S230, remote server are retrieved in the first model database according to query word, obtain retrieval knot Fruit, as the Matching Model matched with query word.It will be apparent to those skilled in the art that when Matching Model is multiple, retrieval result For Matching Model list, in the present invention, as without refering in particular to, belong to " Matching Model " can also expression matching model list implication On.Optionally, remote server describes to be retrieved in data in model name and/or model, so as to obtain retrieval result.
Then, step S130 is performed.
Step S310, according to interface, obtain Matching Model.
Specifically include following steps:
Step S320, interface is shown on the first model.
Interface (bounding box) is shown on threedimensional model, such as interface is shown with specified color, or to specify Line style (such as dotted line) show interface, so as to intuitively providing interface in threedimensional model to user in a manner of visual On position.
Preferably, interface (bounding box) is attached on threedimensional model in a manner of translucent, so as to be carried to user While for interface position, user is not influenceed and intuitively observes threedimensional model.It is furthermore preferred that identified according to interface, with not Same color shows the interface of threedimensional model, such as shows that interface is identified as 1 as interface (bag with the first color (red) Enclose box), show that interface is identified as 2 interface (bounding box) with the second color (blueness).
Step S330, interface is selected on the first model.
According to the present invention, user can select the interface being shown on threedimensional model by mouse, can also pass through key Shortcut on disk is selected.Preferably, user uses finger or touch control device (such as stylus) selection threedimensional model On interface (bounding box).Obvious selected effect is presented to user in selected interface (bounding box), while not Influence user and understand selected interface mark.For example, when interface (bounding box) that selection is shown with the first color, rank Junction (bounding box) remains as red, but sense of movement is presented in the lines on the side of interface (bounding box), or interface (surrounds Box) flickering is presented.
Step S340, the interface chosen according to user, obtain the interface ID of the interface;According to interface ID Matched in the metadata of one model, so as to obtain model quantity N corresponding to interface ID.
Step S350, according to model quantity N, N number of model ID is extracted in the metadata of the first model.
Step S360, retrieved according to N number of model ID in the first model database, acquisition corresponds to N number of model ID Threedimensional model as Matching Model.
Then, step S130 is performed.
Step S130, the second model is selected in Matching Model.
According to the present invention, browser client can show three-dimensional mould corresponding with interface in GUI Matching band 14 Type list, user can select the second model from threedimensional model list, specifically include:
Step S132, obtain the metadata in each Matching Model, such as model ID, model name and model description letter Breath.
Step S134, the display model name list in GUI Matching band 14.Further, user can pass through right button Menu display model description information.It will be apparent to those skilled in the art that in Matching band 14 can also display model ID lists, or Name list and the combination of ID lists.
Step S136, user select the second model from model name list so that the second model is in selected state.Can Choosing, user can choose the second model by the single-click operation of mouse, it is preferred that user can choose the by touch operation Two models.
Step S140, judge the whether existing built-up pattern of first and second model.
According to the present invention, it is stored with what model of the user in the first model database was formed in the second model database Built-up pattern.When the built-up pattern of first and second model be present, it is meant that there is user to complete first and second before The combination of model, therefore active user can be supplied to use for reference, lift the interactive efficiency of threedimensional model.
Further, the combination metadata in the second model database further comprises:First built-up pattern ID, second group Matched moulds type ID, the first interface ID, the second interface ID, interface front view.First and second built-up pattern ID is respectively composition group The model ID of two threedimensional models of matched moulds type, it is corresponding with the model ID in the first model database.First and second interface ID The ID being mutually linked in respectively first and second model.Interface front view is the figure of the interface effect of first and second model of display Picture.
According to the present invention, in step S140, user's (being especially the user using browsing client) is by the first of acquisition The model ID of the model and model ID of the second model is sent to remote server, and remote server is according to the mould of first and second model Type ID, retrieved in the second model database.If the same of first and second model ID and the second model database records In first and second built-up pattern ID it is identical, then it is assumed that built-up pattern be present, and then perform step S410;Otherwise step is performed S510.It will be apparent to those skilled in the art that first and second in the same of first and second model ID and the second model database record Built-up pattern ID is identical can to include two kinds of situations, i.e. the first model ID is equal to the first built-up pattern ID and the second model ID etc. The second built-up pattern ID is same as, or the first model ID is equal to the second built-up pattern ID and the second model ID is equal to first group Matched moulds type ID.According to the present invention, built-up pattern there may be one, it is also possible to exist multiple.
Step S410, show built-up pattern.
According to the present invention, when the built-up pattern of first and second model be present, remote server is by the metadata of built-up pattern With composite unit data transfer to browsing client.Combinations thereof model is shown in the GUI of browsing client combination region 16.It is optional , show built-up pattern in the form of thumbnail icon and model name.Preferably, it is allowed to user with for example choose or right button operate Mode eject the window of the interface front view for checking built-up pattern, enable a user to easily judge that built-up pattern is It is no to be used.
Step S420, judges which model user's selection uses.
According to the present invention, the 3rd model is the built-up pattern that user confirms from combination region 16.Optionally, user can lead to The double click operation selection for crossing mouse uses the 3rd model, it is preferred that user can select to use the 3rd model by touch operation. As user's selection use the 3rd model, then execution step S430;Otherwise, as user thinks the mould that is not applicable in built-up pattern Type, and select to use the second model, then perform step S510.
Step S430, import the 3rd model.
According to the present invention, browsing client sends the request of the model data of the 3rd model of transmission to remote server, should Request includes the model ID of the 3rd model, and remote server responds the request, and response is retrieved from the second model database Threedimensional model model data and the model data is transferred to browsing client, browsing client is in GUI scene area 12 The middle model data for being loaded into the 3rd model.So as to complete three-dimension interaction operation.
Step S510, built-up pattern is generated according to first and second model.
According to the present invention, step S510 specifically includes following steps:
Step S520, import the second model.According to the present invention, browsing client sends the second mould of transmission to remote server The request of the model data of type, the request include the model ID of the second model, and remote server responds the request, from the first mould The model data of the threedimensional model of response is retrieved in type database and the model data is transferred to browsing client, browses visitor Family end is loaded into the model data of the second model in GUI scene area 12.
Step S530, in scenic spot 12 on the scene, the first model and the second model are combined, form built-up pattern.User The merging of the three-dimensional data of the first model and the second model is completed, so as to form the three-dimensional data of built-up pattern.Art technology Personnel understand that the specific generation type of three-dimensional data of built-up pattern can be completed with either type of the prior art.Further , user specifically includes following steps always according to the combination metadata of generation built-up pattern:
Step S532, using the model ID of first and second model as first and second built-up pattern ID of built-up pattern.
Step S534, by first and second model be used for be connected interface ID, respectively as the first and second of built-up pattern Interface ID.If the interface quantity of the first model is 0, first and second interface ID of built-up pattern is arranged to Null.
Step S536, obtain the sectional drawing of the built-up pattern in scene area 12, the interface front view as built-up pattern.
Step S540, built-up pattern is uploaded and stored to the second model database.
According to the present invention, browsing client transmits built-up pattern to remote server, and remote server is by the built-up pattern It is saved in the second model database, so as to complete three-dimension interaction process.Because built-up pattern is stored in the second model data In storehouse, power system other users can be facilitated to be used when building three-dimensional scenic or creating force device model.
The present invention obtains the members such as the model name, model description information, interface front view of threedimensional model in the gui first Data and combination metadata information, the three-dimensional data without obtaining specific threedimensional model and combination threedimensional model.Also, only exist When user determines the threedimensional model for needing to be connected according to model metadata and/or combination metadata, threedimensional model is just really obtained Data.System consumption when this processing mode can effectively avoid loading the three-dimensional data of second and third larger model of quantity. Especially it is stored in threedimensional model in the first model database of remote server, and GUI is mutual with remote server During browsing client (such as PC ends or tablet personal computer end) of connection, similar to the power system shown in CN102819861B In the environment of three dimensional device scene modeling, this processing mode can also further save logical between mobile terminal and server Letter consumption.
Further, according to the present invention, the size of three-dimensional data is also included in threedimensional model.Preferably, step S210, Also include in S310 and/or S410, obtain the size of the three-dimensional data of each Matching Model, and work as the big of some Matching Model When being less than specific threshold, the threedimensional model is spread out of into browsing client in the lump together with model metadata.So as to not influence On the premise of efficiency of transmission, the interaction between browsing client and remote server is reduced.
Present invention also offers a kind of method of quick-searching threedimensional model.
As it was noted above, the threedimensional model of the present invention includes model metadata, model metadata includes interface list, rank Junction list identifies including interface.Interface identifies the interface attribute for mark, when its value is 1, represents the rank Junction is merely able to be connected with the interface stored in interface feature list;(optional) represents the linking when its value is 2 Face is preferably connected with the interface stored in interface feature list, but can also be three-dimensional with other by the bounding box of interface Model is connected.Further point out in step s 320:It is furthermore preferred that being identified according to interface, shown with different colors three-dimensional The interface of model, such as show that interface is identified as 1 as interface (bounding box) with the first color (red), with the second color (blueness) shows that interface is identified as 2 interface (bounding box).
According to the present invention, abovementioned steps S330 further comprises, if user's selection is rank that interface is identified as 1 Junction (bounding box), step S340 is performed, if user's selection is interface (bounding box) that interface is identified as 2, such as Shown in Fig. 4, a kind of method (step S600) of quick-searching threedimensional model provided by the invention is performed, specifically includes following step Suddenly:
Step S610, the interface chosen according to user, obtain the interface ID of the interface;According to interface ID Matched in the metadata of one model, so as to obtain model quantity N corresponding to interface ID.
Step S620, according to model quantity N, N number of model ID is extracted in the metadata of the first model.
Step S630, retrieved according to N number of model ID in the first model database, acquisition corresponds to N number of model ID Threedimensional model as the first Matching Model.
Step S700, retrieved according to interface (bounding box) in the first model database, obtain M threedimensional model As the second Matching Model.
Step S790, the first Matching Model and the second Matching Model are shown in Matching band 14, wherein the first Matching Model Position before the position of the second Matching Model.
Because the first Matching Model belongs to the directly corresponding Matching Model of interface, the second Matching Model is to pass through interface The model that matching just obtains is carried out, therefore user selects the probability of the first Matching Model to exceed the general of the second Matching Model of selection Rate, therefore in sequence, the first Matching Model will be placed in before the second Matching Model.
Wherein, step S700 further comprises the steps:
Step S720, the length of side B1={ P1, Q1, R1 }, wherein P1, Q1 of the bounding box that user chooses are obtained, R1 is the bag Enclose the length of side that box shares three sides on same summit;
Step S730, length of side B1 is sent to remote server;
Step S740, for any threedimensional model in the first model database, remote server extracts its linking first Face quantity, when interface quantity is not 0, each interface mark of the threedimensional model is further extracted, for interface mark Know the interface for 2, calculate the length of side B2={ P2, Q2, R2 } of its bounding box, wherein P2, Q2, R2 shares same for the bounding box The length of side on three sides on summit.
Step S750, if meeting following condition between the length of side B1 and B2, using the threedimensional model as the second matching mould Type.
Wherein, D is specific threshold.
According to an aspect of the present invention, similarly to the prior art, bounding box is represented by the way of 8 apex coordinates, I.e. the interface data of threedimensional model are 8 apex coordinates.Preferably, three sides on some summit of bounding box and tri patch Three reference axis of place coordinate system are parallel.As shown in figure 5, bounding box includes V0-V7 totally 8 summits, the coordinate on each summit Respectively { x0, y0, z0 }-{ x7, y7, z7 }.Under the coordinate system shown in Fig. 4, in step S720, it can obtain in the following ways Take the length of side of bounding box:
P1=x1-x0
Q1=y4-y0
R1=z3-z0
According to another preferred aspect of the present invention, bounding box is represented by the way of 1 apex coordinate and 3 length of sides, I.e. the interface data of threedimensional model are 1 apex coordinate and 3 length of sides.As shown in fig. 6, bounding box includes summit V, its coordinate For { x, y, z }, and respectively along x-axis, the length of side { P, Q, R } in y-axis and z-axis direction.Now, can be direct in step S720 Read the length of side of bounding box.Compared with embodiment illustrated in fig. 5 or prior art, have the following advantages that:
When the firstth, retrieving the second Matching Model in step S700, without calculating the length of side of bounding box, so as to save inspection The rope time, improve recall precision.
Secondth, interface data are reduced to 1 summit and 3 length of sides (equivalent to 1 in data volume from 8 common summits Individual summit), 75% is reduced to the demand of memory space.
It will be apparent to those skilled in the art that for any threedimensional model in the first model library, when it has multiple interfaces When being identified as 2 interface, as long as the length of side of one of interface (bounding box) meets the situation in step S750, then should Threedimensional model is as the second Matching Model.
According to the present invention, still further comprised after step S630:
Step S640, browsing client obtains the query word that user is inputted by Matching band 14, and query word is sent to Remote server.
Step S650, remote server are retrieved in the first model database according to query word, obtain retrieval knot Fruit.
Now, step S700 is replaced by, and is examined according to interface (bounding box) in step S650 retrieval result Rope, M threedimensional model is obtained as the second Matching Model.
Range of search is defined by the quadratic search of query word, improves recall precision.
According to a preferred embodiment of the invention, as shown in fig. 7, being held in the mouth in the interface list of the metadata of the threedimensional model The interface that junction is identified as 2 still further comprises interface (bounding box) volume.As shown in figure 8, first model data Volume concordance list is also stored with storehouse, the volume concordance list includes interface (bounding box) volume and model ID, wherein being connected Face (bounding box) volume and model ID are one-to-one or one-to-many relations, and according to the ascending order of interface volume Sort, i.e. v1 in Fig. 8<v2<v3<v4.Further, for the interface (bounding box) that the length of side is { P, Q, R }, the body of interface Product V is calculated as follows:
V=Round (P) * Round (Q) * Round (R)
Wherein, Round functions are the bracket function to round up, although so sacrificing the precision of some volumes, It is integer that volume V, which can be ensured, can effectively simplify volume concordance list, lifts recall precision.
Step S700 further comprises the steps:
Step S725, the length of side B1={ P1, Q1, R1 } and volume V1 of the bounding box that user chooses, wherein P1, Q1 are obtained, R1 is the length of side on three sides that the bounding box shares same summit;
Step S735, length of side B1 and volume V1 are sent to remote server;
Step S745, remote server retrieve the three-dimensional mould that volume is V2 in the volume concordance list of the first model database Type, alternately model;Wherein V1 and V2 meets following relation:
Step S755, each interface mark of alternative model is extracted, 2 interface is identified as interface, is calculated The length of side B2={ P2, Q2, R2 } of its bounding box, wherein P2, Q2, R2 be the bounding box share three of same summit while while It is long.
Step S765, if meeting following condition between the length of side B1 and B2, using the threedimensional model as the second matching mould Type.
Wherein, A and D is specific threshold, and meets following relation:
A=D3+3D2+3D。
First retrieved by using volume concordance list, the scope of retrieval can be significantly reduced, so as to increase substantially The subsequent use length of side carries out effectiveness of retrieval.
Present invention also offers a kind of loading method of threedimensional model, the threedimensional model can be previously described first Model, the second model and/or the 3rd model.
As it was noted above, it is stored with three-dimensional mould in the first model database by the invention and the second model database Type, threedimensional model include three-dimensional data.The data that locus is identified in three-dimensional data are tri patch data, i.e., three-dimensional mould Type is made up of tri patch, and each tri patch includes three summits P1, P2, P3 of triangle, and each summit has corresponding The space coordinates of space coordinates, i.e. P1 is { x1, y1, z1 }, P2 space coordinates is { x2, y2, z2 }, P3 space coordinates is { x3, y3, z3 }.Second and third model is directed respectively into step S430 and step S520, but in some cases, such as combination die Type needs details model data very true to nature, and the tri patch data included in threedimensional model are extremely more, so as to cause three Dimension data amount is very big so that is loaded in browsing client GUI scene area 12 needed for the threedimensional model from remote server Time it is longer, influence Consumer's Experience, especially when multiple browsing client parallel work-flows, or even can influence network biography Defeated speed.In order to overcome the problem, as shown in figure 9, importing the model data of second and third model in step S430 and step S520 Loading method specifically comprise the following steps:
Step S900, obtain the size of three-dimensional data in threedimensional model.
Step S910, when the size of three-dimensional data is less than or equal to first threshold T1, in browsing client GUI scene Threedimensional model is loaded in area;Otherwise, when the size of three-dimensional data is more than first threshold T1, step S930 is performed.
Step S930, the first tri patch data of threedimensional model are loaded in browsing client scenic spot on the scene, formed three-dimensional A part for model.Wherein, the first tri patch data are that can embody the tri patch data of threedimensional model profile, therein The area of each tri patch is all higher than Second Threshold T2.
Step S940, after the first tri patch data have been loaded, browsing client sends the to remote server request Two tri patch data, remote server respond the request, and the second tri patch data are sent to browsing client.Wherein second Tri patch data are that can embody the tri patch data of threedimensional model details, and the area of each tri patch therein is small In or equal to Second Threshold T2.
Step S950, browsing client inform the user after the second tri patch data are received and complete the second triangle The reception of dough sheet data, and the refresh requests of user are responded, is loaded on the basis of the first tri patch data at scenic spot on the scene Two tri patch data, form complete threedimensional model.
In the anabolic process that user carries out threedimensional model, due to successively transmitting the in step S930 and step S940 First, two tri patch data so that user can just carry out follow-up with three-dimensional mould after the first tri patch data are received The operation of the combination correlation of type, without waiting all three-dimensional data whole end of transmissions just to carry out subsequent operation, so as to carry The operating experience sense of user is risen.Meanwhile second tri patch data can also be carried out in the remote server relative free time Transmission, so as to make full use of network.
According to the present invention, the GUI of browsing client further comprises progress bar and refresh button, and the progress bar is used to refer to Show the transmission progress of the second tri patch data.In step S950, user can be asked by clicking on refresh button transmission refreshing Ask, it is preferred that when progress bar indicates that the second tri patch data transfer finishes so that the never workable gray scale of refresh button State is changed into can be with use state.
According to the present invention, the calculation of the Second Threshold T2 in step S930 is as follows:
Step S932, the area of each tri patch data in threedimensional model is obtained, count the area shape of each tri patch Into area distribution plot (S1, N1), (S2, N2) ..., (Sp, Np) }.Wherein, (Si, Ni) represents the tri patch that area is Si Quantity be Ni, i is 1 to the integer between p, and meets S1<S2<……<Sp.It can be known according to experiment experience, Line Integral Butut is typically as shown in Figure 10, and the quantity of less second tri patch of area is a lot, constitutes the details of threedimensional model, area The quantity of the first larger tri patch is more, constitutes the profile of threedimensional model, occupy the number of tri patch therebetween Measure it is less, therefore threshold value T2 ideally should be in Figure 10 dotted line delineation part.
In the step, for any one tri patch, its three summits P1, P2, P3 space coordinates for x1, y1, Z1 }, { x2, y2, z2 }, { x3, y3, z3 }, then its area S computational methods are as follows:
Wherein, Round functions are the bracket function to round up;
A=(x2-x1)2+(y2-y1)2+(z2-z1)2
B=(x3-x1)2+(y3-y1)2+(z3-z1)2
C=(x3-x2)2+(y3-y2)2+(z3-z2)2
A, b, c are respectively square of three length of sides of tri patch, in this way, when obtaining triangle area, only Need to calculate an open operation, Heron's formula more of the prior art being capable of effectively save operation time.By using rounding Function, area distribution plot can be formed.
Step S933, obtain the area average K and average N of a tri patch.
Wherein, Round functions are the bracket function to round up;λ is empirical parameter, and value is less than 1.
Step S934, if tri patch quantity corresponding to area K is less than N, then T2=K;Otherwise, if K pairs of area The tri patch quantity answered is more than or equal to N, then performs step S935.
Step S935, the area average K1 and area of tri patch of the reference area more than K are less than or equal to K triangular facet The area average K2 of piece.K=(K1+K 2)/2 is made, then performs step S933.
Wherein, a value causes Sa=K.
According to the present invention, in the loading method of threedimensional model, step S930 further comprises:Obtain the rank of threedimensional model The tri patch data of junction, the tri patch data of interface data are loaded in browsing client scenic spot also on the scene, use rank Junction data and the first tri patch data collectively form a part for threedimensional model.By the tri patch number for loading interface According to enabling to the three dimensional modeled segment data in step S930 intuitively to show the minutia of interface, so as to there is utilization User combines threedimensional model.
According to an aspect of the present invention, interface data are the triangular apex for all tri patch for forming interface List.In this case, interface data can be directly read, so as to obtain the tri patch data of interface.
According to another aspect of the present invention, interface data are the bounding box of all tri patch of composition interface The list on summit.In this case, whether bounding box is located at by the apex coordinate for each tri patch for judging threedimensional model It is interior, if located in then obtaining tri patch data using the tri patch as interface.Preferably, using shown in Fig. 6 In the case of bounding box, for any vertex of a triangle coordinate { x1, y1, z1 }, if meeting following condition simultaneously, then it is assumed that It is located in bounding box:
x1-x<P
y1-y<Q
z1-z<R。
According to the present invention, a kind of method of Fast rendering three-dimensional scenic is additionally provided.
Those skilled in the art know, render (Rendering) refer to mathematical modeling simulate in objective world object with The process of the interaction generation photo-realistic images of visible ray.Render complete by rendering pipeline (Rendering Pipeline) Into the input that rendering pipeline is also referred to as rendering pipeline (Graphic Pipeline) is the set of tri patch, specific to wrap Include three apex coordinates of tri patch, and the attribute on summit, such as the color on summit, normal vector, material and light source, texture Deng one or more of attribute, apex coordinate determines the position on summit, and vertex attribute determines the color on summit.Render stream The output of waterline is the two-dimensional array of pixel value, and in computing device, the two-dimensional array of pixel value is that can directly drive display The frame buffer (Frame Buffer) that equipment is shown.From the process for being input to output generally comprises model conversion, viewpoint becomes Change, illumination calculation, projective transformation, the cone are cut out, texture mapping, alpha test, depth test, atomization, shake, alpha mixing Etc. step.Current computer system both provides programmable rendering pipeline, according to actual conditions, the portion of rendering pipeline It is according to circumstances selectable step by step, the order of part steps can merge as the case may be, the elder generation of part steps Order can adjust according to actual conditions afterwards.
In above-mentioned rendering pipeline, depth test is essential important step.Between depth test, flowing water is rendered Line is by the coordinate under the summit space coordinate conversion to screen coordinate system of tri patch.For three summits of any triangle, Its space coordinates is { x1, y1, z1 }, { x2, y2, z2 }, { x3, y3, z3 }, before depth test, by rotating, translating, throwing Shadow, scale, cut out etc. operation by space coordinate transformation be screen coordinate { Xp1, Yp1, Zp1 }, { Xp2, Yp2, Zp2 }, Xp3, Yp3, Zp3 }, wherein Xp and Yp are the positions of pixel of the summit on screen, and Zp represents the summit in vertical screen defence line Depth.According to the screen coordinate on Atria summit, it is each triangle interior can be obtained by the way of such as interpolation The depth value of pixel.Depth test also needs to use depth buffer (Depth buffer), also referred to as Z buffer (Z Buffer), wherein being stored with the depth value of current frame buffer.For any pixel after interpolation, if its depth value is than deep The depth value of respective pixel position is big or equal in degree caching, then means that the pixel is hidden by the pixel in current frame buffer Gear, it is not necessary to carry out subsequent operation, otherwise mean that the pixel is not blocked by the pixel in current frame buffer, by the color of the pixel Frame buffer is write, and uses the depth value renewal depth buffer of the pixel.
Those skilled in the art know, above is the usual operation of rendering pipeline, but as described in Figure 10, in the present invention Loading procedure in, tri patch includes the first tri patch and the second tri patch, therebetween with it is different the characteristics of.Cause The characteristics of this is desirable with the two, based on programmable rendering pipeline, different wash with watercolours is designed different types of tri patch Streamline is contaminated, i.e., different rendering pipelines is used in step S930 and S950, lifts the rendering efficiency of threedimensional model.
As shown in figure 11, according to a kind of method of Fast rendering three-dimensional scenic provided by the invention, including:
Step S1000, judge the type of tri patch.
Step S1100, if the first tri patch, rendered using the first rendering pipeline.
Step S1200, if the second tri patch, rendered using the second rendering pipeline.
Wherein, the first rendering pipeline and the second rendering pipeline can be identical rendering pipelines or not Identical rendering pipeline.For example, first, second rendering pipeline is the rendering pipeline used in the prior art, still First, second rendering pipeline is different rendering pipeline.For another example, it is preferred that the first rendering pipeline is in the prior art The rendering pipeline used, and the second rendering pipeline is according to the improved rendering pipeline of the present invention;Or first render stream Waterline be according to the improved rendering pipeline of the present invention, and the second rendering pipeline be use in the prior art render flowing water Line;Or most preferably, first, second rendering pipeline is according to the improved rendering pipeline of the present invention.
According to the improved one side of the present invention, the step S1100 further comprises:
Step S1110, the first tri patch of parsing, the space coordinates V11={ x11, y11, z11 } on three summits of acquisition, V12={ x12, y12, z12 }, V13={ x13, y13, z13 }.
Step S1112, according to three summits space coordinates V11, V12, V13, the screen coordinate S11=on three summits of acquisition { Xp11, Yp11, Zp11 }, S12={ Xp12, Yp12, Zp12 }, S13={ Xp13, Yp13, Zp13 }.Wherein Xp and Yp represents top The position of pixel of the point on screen, Zp represent depth of the summit in vertical screen defence line.
Wherein, can be realized by the specific conversion of space coordinates to screen coordinate according to a variety of prior arts, prior art Particular content repeats no more.
Step S1114, obtain screen coordinate under, obtain the first tri patch minimum external matrix M1=Xmin, Ymin, Xmax, Ymax }, wherein Xmin and Xmax are respectively the minimum value and maximum in { x11, x12, x13 }, Ymin and Ymax is respectively the minimum value and maximum in { y11, y12, y13 }.
Step S1120, in minimum external matrix, it is scanned in units of depth scan block, according to tri patch Summit screen coordinate, obtains the depth value { D1, D2, D3, D4 } of four angle points of depth scan block, and calculates Dmax and Dmin. Dmax is the maximum in { D1, D2, D3, D4 }, and Dmin is the minimum value in { D1, D2, D3, D4 }.Depth scan block is pros Shape scanning block, the square length of side are N number of pixel, and N is integer.As shown in figure 12, the area of the first tri patch is larger, in it Portion frequently includes multiple depth scan blocks, and each depth scan block includes N*N pixel, such as shown in Figure 12, each depth Scanning block includes 4*4=16 pixel.For each depth scan block, such as the scanning block in Figure 12 shown in shade, the step In only need obtain (such as method by interpolation in the prior art) four angle points (B0, B3, B12, B15) depth value, and The depth value of all pixels point in scanning block need not be obtained, so as to improve operational efficiency.
Step S1122, read corresponding maximum depth value Zmax and minimum with current depth scanning block in depth block caching Depth value Zmin.Depth block caching be according to depth buffer obtain caching, its resolution ratio be depth buffer 1/N*N, N be with The depth scan block being used cooperatively the length of side.Value in depth block caching is included corresponding in depth buffer corresponding to each deep The maximum and minimum value for the pixel depth spent in scanning block.As shown in figure 13, in the case of N=4, point of depth block caching Resolution is the 1/16 of depth buffer, and the maximum depth value of the depth buffer of corresponding depth scan block is only stored in depth block caching 8 and minimum depth value 1.Those skilled in the art know that the numerical value in Figure 13 is only for convenience of the example data understood, in reality In the application of border, depth buffer typically uses the fixed-point number of 24 or 32.
Step S1130, if Dmin>=Zmax, then mean the depth of all pixels point involved by the depth scan block Degree is all higher than or equal to the depth in depth block caching, i.e., caches corresponding pixel by depth block and block, therefore entirety is thrown Pixel corresponding to abandoning the depth scan block, no longer carry out the subsequent treatment of the first rendering pipeline.
Step S1132, if Dmax<Zmin, then mean the depth of all pixels point involved by the depth scan block Depth respectively less than in depth block caching, i.e., corresponding pixel is not cached by depth block and blocked, therefore the depth scan Pixel corresponding to block, entirely through depth test, the depth value and color value of all pixels point of the depth scan block are calculated, And using color value renewal frame buffer, update depth buffer using depth value and depth block caches.It will be apparent to those skilled in the art that The specific calculating of depth value and color value can use computational methods conventional in the prior art, repeat no more.
Step S1134, if Dmin<Zmax, and Dmax>=Zmin, then mean the picture involved by the depth scan block Vegetarian refreshments part is blocked, and part is not blocked.Therefore, the depth value and color of all pixels point of the depth scan block are calculated Value, depth test is carried out, be used to update frame buffer by the color value of the pixel of depth test, depth value be used to update Depth buffer and depth block caching.It is abandoned not over the pixel of depth test, no longer carries out the first rendering pipeline Subsequent treatment.
According to the present invention, N values are too small, easily cause improved efficiency unobvious, and during N=1, depth scan block deteriorates to single Pixel;N values are excessive, the number that easy lifting step S1134 is performed, so as to reduce efficiency.Based on this, it is preferred that N is equal to 3 Or 4.
According to the improved one side of the present invention, the step S1200 further comprises:
Step S1210, the second tri patch of parsing, the space coordinates V21={ x21, y21, z21 } on three summits of acquisition, V12={ x22, y22, z22 }, V13={ x23, y23, z23 }.
Step S1212, according to three summits space coordinates V11, V12, V13, the screen coordinate S21=on three summits of acquisition { Xp21, Yp21, Zp21 }, S12={ Xp22, Yp22, Zp22 }, S23={ Xp23, Yp23, Zp23 }.Wherein Xp and Yp represents top The position of pixel of the point on screen, Zp represent depth of the summit in vertical screen defence line.
Wherein, can be realized by the specific conversion of space coordinates to screen coordinate according to a variety of prior arts, prior art Particular content repeats no more.
According to the present invention, hidden page is provided in rendering pipeline.Hidden page is to have identical resolution with depth buffer The caching of rate, the value at any position (i, j) place includes Zijmax and Zijmin, wherein Zijmax and Zijmin difference in hidden page For in depth buffer with all depths in rectangle that { (i, j), (i+W-1, j), (i, j+H-1), (i+W-1, j+H-1) } is summit The maximum and minimum value of angle value.W and H is integer, preferable W=H.As shown in Figure 10, the present invention in the first tri patch compared with Greatly, the area of the second tri patch is smaller, and it has the line of demarcation of relative ideal, therefore it is furthermore preferred that W=H>=N, such as above The general values of N are 3 or 4.The schematic diagram of one fragment of depth buffer and hidden page as shown in figure 14, W=H=3's In the case of, depth value and Zijmax and Zijmin mapping relations are shown in dotted line frame.Obvious, the resolution ratio of hidden page Can be lower slightly compared with the resolution ratio of depth buffer, such as in the case of W=H=N=4, if the resolution ratio of depth buffer is 1920*1280, then the resolution ratio of hidden page can be 1917*1277, so as to not influence to use.In addition, hidden page can also It is designed as being suitable for use with { Xmax, Ymax } to obtain the maximum of hidden page and minimum value.
Step S1214, obtain screen coordinate under, obtain the second tri patch minimum external matrix M2=Xmin, Ymin, Xmax, Ymax }, wherein Xmin and Xmax are respectively the minimum value and maximum in { x21, x22, x23 }, Ymin and Ymax is respectively the minimum value and maximum in { y21, y22, y23 }.
Step S1216, if Xmax-Xmin<=W, and Ymax-Ymin<=H, then perform step S1220;Otherwise The operation of the second rendering pipeline is performed, that is, calculates the depth value and color value of all pixels point of second tri patch, enters Row depth test, it be used to update frame buffer by the color value of the pixel of depth test, depth value is used for renewal and hidden Page and depth block caching.It is abandoned not over the pixel of depth test, no longer carries out the follow-up place of the second rendering pipeline Reason..
Step S1220, obtains the maximum depth value Dmax and minimum depth value Dmin of the second tri patch, and wherein Dmax is Maximum in { Zp21, Zp22, Zp23 }, Dmin are the minimum value in { Zp21, Zp22, Zp23 }.
Step S1222, the maximum Zmax and minimum value Zmin of hidden page are obtained according to { Xmin, Ymin }.
Step S1230, if Dmin>=Zmax, then mean the depth of all pixels point involved by second triangle Degree is all higher than or equal to the depth in hidden page, that is, is hidden the pixel corresponding to page and blocks, therefore entirety abandons the depth Pixel corresponding to scanning block, no longer carry out the subsequent treatment of the first rendering pipeline.
Step S1232, if Dmax<Zmin, then mean the depth of all pixels point involved by second triangle Depth respectively less than in hidden page, i.e., it is not hidden page and deposits corresponding pixel and block, therefore second triangle pair should Pixel, entirely through depth test, calculate the depth value and color value of all pixels point of second triangle, and use Color value updates frame buffer, updates depth buffer and hidden page using depth value.It will be apparent to those skilled in the art that depth value and face The specific calculating of colour can use computational methods conventional in the prior art, repeat no more.
Step S1234, if Dmin<Zmax, and Dmax>=Zmin, then mean involved by second tri patch Pixel part is blocked, and part is not blocked.Therefore, calculate all pixels point of second tri patch depth value and Color value, depth test is carried out, be used to update frame buffer by the color value of the pixel of depth test, depth value is used for Update hidden page and depth block caching.It is abandoned not over the pixel of depth test, no longer carries out the second rendering pipeline Subsequent treatment.
In the present invention, make full use of the first tri patch larger and the less feature of the second tri patch, use respectively The mode of depth scan block and hidden page carries out rendering processing, small-scale test display, comprehensive rendering efficiency lifting about 15.7% Left and right, achieve good technique effect.
In addition, according to disclosed specification of the invention, other realizations of the invention are for those skilled in the art Significantly.The various aspects of embodiment and/or embodiment can be used for the system of the present invention individually or with any combinations In method.Specification and example therein should only be regarded solely as exemplary, of the invention actual range and spirit by appended Claims represent.

Claims (9)

1. a kind of method of Fast rendering three-dimensional scenic, including:
Step S1000, judge the type of tri patch;
Step S1100, if the first tri patch, rendered using the first rendering pipeline;
Step S1200, if the second tri patch, rendered using the second rendering pipeline.
2. according to the method for claim 1, wherein, the first rendering pipeline and the second rendering pipeline are the wash with watercolours differed Contaminate streamline.
3. according to the method for claim 2, it is characterised in that the step S1100 further comprises:
Step S1110, the first tri patch is parsed, obtain space coordinates V11={ x11, y11, z11 }, the V12=on three summits { x12, y12, z12 }, V13={ x13, y13, z13 };
Step S1112, according to three summits space coordinates V11, V12, V13 of first tri patch, obtain three summits Screen coordinate S11={ Xp11, Yp11, Zp11 }, S12={ Xp12, Yp12, Zp12 }, S13={ Xp13, Yp13, Zp13 }; Wherein Xp and Yp represents the position of pixel of the summit on screen, and Zp represents depth of the summit in vertical screen defence line;
Step S1114, obtain screen coordinate under, obtain the first tri patch minimum external matrix M1=Xmin, Ymin, Xmax, Ymax }, wherein Xmin and Xmax are respectively the minimum value and maximum in { x11, x12, x13 }, Ymin and Ymax difference For the minimum value and maximum in { y11, y12, y13 };
Step S1120, in minimum external matrix, it is scanned in units of depth scan block, according to the summit of tri patch Screen coordinate, obtains the depth value { D1, D2, D3, D4 } of four angle points of depth scan block, and calculates Dmax and Dmin;Wherein, Dmax is the maximum in { D1, D2, D3, D4 }, and Dmin is the minimum value in { D1, D2, D3, D4 };
Step S1122, read corresponding maximum depth value Zmax and minimum-depth with current depth scanning block in depth block caching Value Zmin;Depth block caching is the caching obtained according to depth buffer, and the resolution ratio of the depth block caching is less than the depth The resolution ratio of caching;
Step S1130, if Dmin>=Zmax, integrally abandon the depth scan block corresponding to pixel, no longer carry out the first wash with watercolours Contaminate the subsequent treatment of streamline;
Step S1132, if Dmax<Zmin, then the depth value and color value of all pixels point of the depth scan block are calculated, and Frame buffer is updated using color value, depth buffer is updated using depth value and depth block caches;
Step S1134, if Dmin<Zmax, and Dmax>=Zmin, then calculate the depth of all pixels point of the depth scan block Angle value and color value, depth test is carried out, be used to update frame buffer, depth value by the color value of the pixel of depth test It is used to update depth buffer and depth block caching;It is abandoned not over the pixel of depth test, no longer carries out the first wash with watercolours Contaminate the subsequent treatment of streamline;
4. according to the method for claim 3, it is characterised in that the depth scan block is square scanning block, square The length of side be N number of pixel, N is integer.
5. according to the method for claim 4, it is characterised in that N is 3 or 4.
6. according to the method for claim 4, it is characterised in that the resolution ratio of the depth scan block is the 1/ of depth buffer N*N。
7. according to the method for claim 2, it is characterised in that provide hidden page in second rendering pipeline;Institute It is to have the caching of equal resolution with depth buffer to state hidden page, and the value at any position (i, j) place includes in hidden page Zijmax and Zijmin, wherein Zijmax and Zijmin are respectively with { (i, j), (i+W-1, j), (i, j+H- in depth buffer 1), (i+W-1, j+H-1) } for summit rectangle in all depth values maximum and minimum value;W and H is integer.
8. according to the method for claim 7, wherein W=H>(N definition is equal in claim 4 and 5 to be determined=N Justice).
9. according to the method for claim 7, it is characterised in that the step S1200 further comprises:
Step S1210, the second tri patch is parsed, obtain space coordinates V21={ x21, y21, z21 }, the V12=on three summits { x22, y22, z22 }, V13={ x23, y23, z23 };
Step S1212, according to three summits space coordinates V21, V22, V23, the screen coordinate S21=on three summits of acquisition { Xp21, Yp21, Zp21 }, S12={ Xp22, Yp22, Zp22 }, S23={ Xp23, Yp23, Zp23 };Wherein Xp and Yp represents top The position of pixel of the point on screen, Zp represent depth of the summit in vertical screen defence line;
Step S1214, obtain screen coordinate under, obtain the second tri patch minimum external matrix M2=Xmin, Ymin, Xmax, Ymax }, wherein Xmin and Xmax are respectively the minimum value and maximum in { x21, x22, x23 }, Ymin and Ymax difference For the minimum value and maximum in { y21, y22, y23 };
Step S1216, if Xmax-Xmin<=W, and Ymax-Ymin<=H, then perform step S1220;Otherwise calculate The depth value and color value of all pixels point of second tri patch, depth test is carried out, pass through the pixel of depth test Color value be used to update frame buffer, and depth value be used to update hidden page and depth buffer;Not over the picture of depth test Vegetarian refreshments is abandoned, and no longer carries out the subsequent treatment of the second rendering pipeline;
Step S1220, obtains the maximum depth value Dmax and minimum depth value Dmin of the second tri patch, and wherein Dmax is Maximum in { Zp21, Zp22, Zp23 }, Dmin are the minimum value in { Zp21, Zp22, Zp23 };
Step S1222, the maximum Zmax and minimum value Zmin of hidden page are obtained according to { Xmin, Ymin };
Step S1230, if Dmin>=Zmax, then it is overall abandon the depth scan block corresponding to pixel, no longer carry out second The subsequent treatment of rendering pipeline;
Step S1232, if Dmax<Zmin, then the depth value and color value of all pixels point of the second tri patch are calculated, and Frame buffer is updated using color value, updates depth buffer and hidden page using depth value;
Step S1234, if Dmin<Zmax, and Dmax>=Zmin, then calculate the depth of all pixels point of the second tri patch Angle value and color value, depth test is carried out, be used to update frame buffer, depth value by the color value of the pixel of depth test It is used to update hidden page and depth buffer;It is abandoned not over the pixel of depth test, no longer carries out second and render stream The subsequent treatment of waterline.
CN201710540801.0A 2017-07-05 2017-07-05 Method for rapidly rendering three-dimensional scene Active CN107481307B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710540801.0A CN107481307B (en) 2017-07-05 2017-07-05 Method for rapidly rendering three-dimensional scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710540801.0A CN107481307B (en) 2017-07-05 2017-07-05 Method for rapidly rendering three-dimensional scene

Publications (2)

Publication Number Publication Date
CN107481307A true CN107481307A (en) 2017-12-15
CN107481307B CN107481307B (en) 2023-04-07

Family

ID=60596407

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710540801.0A Active CN107481307B (en) 2017-07-05 2017-07-05 Method for rapidly rendering three-dimensional scene

Country Status (1)

Country Link
CN (1) CN107481307B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108399634A (en) * 2018-01-16 2018-08-14 达闼科技(北京)有限公司 The RGB-D data creation methods and device calculated based on high in the clouds
CN111179151A (en) * 2020-04-13 2020-05-19 南京芯瞳半导体技术有限公司 Method and device for improving graphic rendering efficiency and computer storage medium
CN111599011A (en) * 2020-07-15 2020-08-28 杭州电力设备制造有限公司 WebGL technology-based rapid construction method and system for power system scene

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1404017A (en) * 2001-09-13 2003-03-19 矽统科技股份有限公司 Processing method of object triangle in computerized drawing
CA2617373A1 (en) * 2002-03-19 2003-10-02 Aechelon Technology, Inc. Improved terrain rendering in a three-dimensional environment
US20070273689A1 (en) * 2006-05-23 2007-11-29 Smedia Technology Corporation System and method for adaptive tile depth filter
CN101477701A (en) * 2009-02-06 2009-07-08 南京师范大学 Built-in real tri-dimension rendering process oriented to AutoCAD and 3DS MAX
CN102385760A (en) * 2010-08-27 2012-03-21 国际商业机器公司 Method and system used for protecting model data
CN102708585A (en) * 2012-05-09 2012-10-03 北京像素软件科技股份有限公司 Method for rendering contour edges of models
CN102722902A (en) * 2011-05-06 2012-10-10 新奥特(北京)视频技术有限公司 Method for anti-aliasing improvement at rasterization phase in graphic rendering pipeline
CN102722861A (en) * 2011-05-06 2012-10-10 新奥特(北京)视频技术有限公司 CPU-based graphic rendering engine and realization method
CN102737401A (en) * 2011-05-06 2012-10-17 新奥特(北京)视频技术有限公司 Triangular plate filling method in rasterization phase in graphic rendering
US20140333620A1 (en) * 2013-05-09 2014-11-13 Yong-Ha Park Graphic processing unit, graphic processing system including the same and rendering method using the same
CN104183005A (en) * 2013-05-24 2014-12-03 三星电子株式会社 Graphic processing unit and tile-based rendering method
US20140354640A1 (en) * 2013-05-31 2014-12-04 Arm Limited Hidden surface removal in graphics processing systems
EP2991038A1 (en) * 2014-09-01 2016-03-02 Samsung Electronics Co., Ltd Rendering apparatus and method

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1404017A (en) * 2001-09-13 2003-03-19 矽统科技股份有限公司 Processing method of object triangle in computerized drawing
CA2617373A1 (en) * 2002-03-19 2003-10-02 Aechelon Technology, Inc. Improved terrain rendering in a three-dimensional environment
US20070273689A1 (en) * 2006-05-23 2007-11-29 Smedia Technology Corporation System and method for adaptive tile depth filter
CN101477701A (en) * 2009-02-06 2009-07-08 南京师范大学 Built-in real tri-dimension rendering process oriented to AutoCAD and 3DS MAX
CN102385760A (en) * 2010-08-27 2012-03-21 国际商业机器公司 Method and system used for protecting model data
CN102722902A (en) * 2011-05-06 2012-10-10 新奥特(北京)视频技术有限公司 Method for anti-aliasing improvement at rasterization phase in graphic rendering pipeline
CN102722861A (en) * 2011-05-06 2012-10-10 新奥特(北京)视频技术有限公司 CPU-based graphic rendering engine and realization method
CN102737401A (en) * 2011-05-06 2012-10-17 新奥特(北京)视频技术有限公司 Triangular plate filling method in rasterization phase in graphic rendering
CN102708585A (en) * 2012-05-09 2012-10-03 北京像素软件科技股份有限公司 Method for rendering contour edges of models
US20140333620A1 (en) * 2013-05-09 2014-11-13 Yong-Ha Park Graphic processing unit, graphic processing system including the same and rendering method using the same
CN104183005A (en) * 2013-05-24 2014-12-03 三星电子株式会社 Graphic processing unit and tile-based rendering method
US20140354640A1 (en) * 2013-05-31 2014-12-04 Arm Limited Hidden surface removal in graphics processing systems
EP2991038A1 (en) * 2014-09-01 2016-03-02 Samsung Electronics Co., Ltd Rendering apparatus and method

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
CHUNG-PING CHUNG ET AL.: "Blocked-Z Test for Reducing Rasterization, Z Test and Shading Workloads", 《2009 INTERNATIONAL CONFERENCE ON COMPUTATIONAL SCIENCE AND ENGINEERING》 *
HONG-YUN KIM ET AL.: "A Memory-Efficient Unified Early Z-Test" *
张俊杰: "嵌入式GPU中光栅化及深度预测试单元的研究与设计" *
高可: "Coarse-Z_Filt:一种带宽的消隐算法及其硬化研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108399634A (en) * 2018-01-16 2018-08-14 达闼科技(北京)有限公司 The RGB-D data creation methods and device calculated based on high in the clouds
CN108399634B (en) * 2018-01-16 2020-10-16 达闼科技(北京)有限公司 RGB-D data generation method and device based on cloud computing
CN111179151A (en) * 2020-04-13 2020-05-19 南京芯瞳半导体技术有限公司 Method and device for improving graphic rendering efficiency and computer storage medium
CN111179151B (en) * 2020-04-13 2020-07-10 南京芯瞳半导体技术有限公司 Method and device for improving graphic rendering efficiency and computer storage medium
CN111599011A (en) * 2020-07-15 2020-08-28 杭州电力设备制造有限公司 WebGL technology-based rapid construction method and system for power system scene
CN111599011B (en) * 2020-07-15 2023-08-04 杭州电力设备制造有限公司 Power system scene rapid construction method and system based on WebGL technology

Also Published As

Publication number Publication date
CN107481307B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
CN105378796B (en) Scalable volume 3D reconstruct
CN100407798C (en) Three-dimensional geometric mode building system and method
CN110458939A (en) The indoor scene modeling method generated based on visual angle
Chen et al. Exploring the design space of immersive urban analytics
US20100177120A1 (en) System and method for stretching 3d/4d spatial hierarchy models for improved viewing
CN109360262A (en) The indoor locating system and method for threedimensional model are generated based on CAD diagram
CN106294918A (en) A kind of method for designing of virtual transparence office system
EP0865000A2 (en) Image processing method and apparatus
CN107704483B (en) A kind of loading method of threedimensional model
CN101241603A (en) Electromagnetic field intensity real time visualized method
CN108986221A (en) A kind of three-dimensional face grid texture method lack of standardization approached based on template face
CN107481307A (en) A kind of method of Fast rendering three-dimensional scenic
CN107481306A (en) A kind of method of three-dimension interaction
CN116097316A (en) Object recognition neural network for modeless central prediction
Zhang et al. [Retracted] Virtual Reality Design and Realization of Interactive Garden Landscape
Petkov et al. Interactive visibility retargeting in vr using conformal visualization
Wang et al. PointShopAR: Supporting environmental design prototyping using point cloud in augmented reality
CN107688599B (en) A kind of method of quick-searching threedimensional model
Rasoulzadeh et al. Strokes2Surface: Recovering Curve Networks From 4D Architectural Design Sketches
EP4275173B1 (en) Computer-implemented reconstruction of interior rooms
Dong et al. 5G virtual reality in the design and dissemination of contemporary urban image system under the background of big data
CN114815752A (en) Digital twinning system, method, equipment and storage medium applied to production line
Thiel et al. Interaction and locomotion techniques for the exploration of massive 3D point clouds in VR environments
WO2023174561A1 (en) Generating synthetic interior room scene data for training ai-based modules
Giertsen et al. 3D Visualization for 2D GIS: an Analysis of the Users' Needs and a Review of Techniques

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant