CN115512047A - Coordinate conversion method of multi-structure live-action three-dimensional model - Google Patents

Coordinate conversion method of multi-structure live-action three-dimensional model Download PDF

Info

Publication number
CN115512047A
CN115512047A CN202211173152.2A CN202211173152A CN115512047A CN 115512047 A CN115512047 A CN 115512047A CN 202211173152 A CN202211173152 A CN 202211173152A CN 115512047 A CN115512047 A CN 115512047A
Authority
CN
China
Prior art keywords
coordinate
file
node
osgb
conversion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211173152.2A
Other languages
Chinese (zh)
Inventor
范冲
李洵铧
陈旭帅
熊友曹
詹岳陈
杨晨晨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Central South University
Original Assignee
Central South University
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 Central South University filed Critical Central South University
Priority to CN202211173152.2A priority Critical patent/CN115512047A/en
Publication of CN115512047A publication Critical patent/CN115512047A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts

Abstract

The invention relates to the technical field of computer networks, and particularly discloses a coordinate conversion method of a multi-structure live-action three-dimensional model, which mainly comprises the steps of firstly setting conversion information, then carrying out metafile processing, file directory analysis, OSGB file access and coordinate conversion and file output, and fully considering the coordinate conversion requirements of OSGB files with various node arrangement structures when the OSGB files are accessed and subjected to coordinate conversion, so that the OSGB files originally produced by ContextCapture software are met, the OSGB files with special structures such as secondary repair replacement and non-participation segmentation are also met, and the method has higher adaptability and compatibility; in the coordinate conversion process, the texture pictures of the leaf nodes are processed by adopting a file stream mode of firstly exporting and then writing, so that the data volume of the OSGB file after conversion is reduced, the aim of saving resources is fulfilled, and the texture is ensured not to be lost, twinkle and deformed.

Description

Coordinate conversion method of multi-structure live-action three-dimensional model
Technical Field
The invention belongs to the technical field of computer networks, and particularly relates to a coordinate conversion method of a multi-structure live-action three-dimensional model.
Background
With the gradual maturity of the live-action three-dimensional data acquisition and processing technology, the live-action three-dimensional model data generated by the oblique photography technology has the advantages of large scene, low cost, high efficiency and the like compared with the traditional artificial modeling data, and can reflect the situation of ground objects more truly. At present, a realistic three-dimensional model result file mainly adopts an OpenSceneGraphBinary (OSGB) format produced by ContextCapture software, and realistic three-dimensional data represented by an OSGB three-dimensional model becomes one of main mapping products and is an indispensable technical element for constructing a smart city.
The OSGB three-dimensional model belongs to a binary file format, and the file stores the space coordinates of each point of the model. The production result of the live-action three-dimensional model is mostly expressed by adopting a plane coordinate system which is based on a 2000 national geodetic coordinate system and is projected by Gauss-Kruger zones. In order to reduce the influence caused by projection deformation, a local coordinate system is often used for laying a measurement control network for planning and construction in many cities or engineering construction areas, so that the actual requirement for converting an OSGB three-dimensional model from a national coordinate system to a local coordinate system is generated.
Through search, chinese patent publication No. CN108694702A discloses a spatial coordinate system conversion method for oblique photography live-action three-dimensional models, and dawn light (dawn light, wang fall, spring source. OSGB format three-dimensional model projection coordinate conversion method [ J ]. Mapping project, 2022,31 (2): 40-45.) have noticed the coordinate conversion requirement of live-action three-dimensional model production. The patent focuses on the algorithm process of encryption, conversion and resolving of spatial coordinate points in a real-scene three-dimensional model; the dawn light and the like propose a coordinate information extraction and conversion method facing an OSGB file, and realize the coordinate conversion process of the OSGB file by extracting, converting and replacing corresponding space coordinates in the OSGB file.
However, the method for extracting and converting the coordinate information for the OSGB file proposed by the above patent and dawn light still has the following defects:
(1) At present, conversion aiming at the real three-dimensional model coordinates only relates to selection of specific parameters and algorithms in the coordinate conversion process, and under the background that the conversion methods of two-dimensional polynomials, two-dimensional seven parameters and the like among the existing projection coordinate systems are mature, the invention technology of extracting and converting the coordinates around the real three-dimensional model file per se, in particular the OSGB real three-dimensional model file produced by mainstream ContextCapture software, is lacked.
(2) The OSGB three-dimensional model has a relatively fixed structure, however, the model often needs to be subjected to secondary processing such as repairing and replacing, different repairing processes and tools often bring special node structures different from the original software production model, and the existing model file analysis and coordinate information extraction method is difficult to bring.
(3) Because the OSGB file embeds the texture and other contents therein, the current processing for the OSGB file generally has a phenomenon that the amount of data after processing is significantly increased, which undoubtedly will cause a certain waste of storage space. The drill-down path index, the model texture and the like of part of OSGB original files are absolute paths, and if only the replacement of coordinates is realized, the converted data cannot be used when being distributed and shared to other platforms.
Disclosure of Invention
The invention aims to provide a coordinate conversion method of a multi-structure live-action three-dimensional model, which realizes the extraction and transformation of the OSGB file produced by mainstream ContextCapture software and the coordinate information of the OSGB file with a special structure subjected to secondary processing such as repair, replacement and the like, and processes model texture, drill-down path and the like on the basis of the coordinate information so as to realize the saving of storage space after conversion and the sharing and distribution of the file and solve the problems in the background technology.
In order to achieve the purpose, the invention adopts the following technical scheme:
a coordinate transformation method of a multi-structure real-scene three-dimensional model,
the method comprises the following steps:
s1, setting conversion information: selecting a directory where a metadata-xml metafile is located in a three-dimensional model file to be converted as an input path, selecting any folder as an output path, setting parameter information of coordinate conversion and connecting the parameter information with an external coordinate conversion library, wherein the external coordinate conversion library realizes reading, conversion and isomorphic output of a single (x, y, z) format coordinate point according to the conversion parameter information, and the conversion algorithm and the process are the same as those of common single-point coordinate conversion;
s2, metafile processing: analyzing, converting and rewriting the metadata.xml metafile;
s3, file directory analysis: traversing each tile folder of the model file according to the input path set in the step S1 in sequence, and adding OSGB files under each folder into an OSGB access module;
s4, access and coordinate conversion of an OSGB file: the nodes of the OSGB file comprise a Geode type and a Group type, and the processing of the OSGB file comprises the processing of a file only containing a single Geode node and the processing of a file containing a Group node;
processing a file only containing a single Geode node comprises node access, texture information extraction, vertex coordinate conversion and coordinate setting after conversion;
the processing of the file containing the Group node comprises judging whether a father node has a secondary node, judging the type of the father node and judging whether the secondary node has a tertiary node.
S5, outputting the file: and writing the converted OSGB file to an output path by using an osgDB:: writeNodeFile () method.
Preferably, the parameter information of the coordinate transformation in the step S1 includes a coordinate transformation library, a band number of the transformed coordinate, and coordinate compensation information;
the coordinate conversion library comprises parameter template names and conversion methods;
the band number of the converted coordinate comprises a Y coordinate band number of the original data and a Y coordinate band number of the converted data, the default is 0, the band number value is subtracted from the Y coordinate of the original data before conversion, and the band number value is added to the Y coordinate of the converted data;
the coordinate compensation information includes an X coordinate compensation number and a Y coordinate compensation number of the converted data, and the default is 0, so that a fixed value is added to the converted XY coordinate.
Preferably, the specific steps of the metafile processing in step S2 are as follows:
and A1, analyzing a < SRSOrigin > file header in the path metadata, xml file and extracting the coordinates of the center point of the model in the (x, y, z) format according to the input path set in the S1. Setting the center point of the model to be (0, 0) for the model without defining the coordinates of the center point;
a2, importing the coordinates of the center point of the model into a coordinate conversion library according to the parameter information of the coordinate conversion set in the S1 to obtain the coordinates of the center point after conversion;
a3, storing coordinates relative to a model central point at a vertex in an OSGB file, and recording the coordinates of the model central point before and after conversion so as to facilitate the subsequent conversion of the OSGB vertex coordinates into actual coordinates for coordinate conversion;
and A4, according to the output path set in the S1, newly establishing a metadata metafile under the output path, wherein the content and the format are consistent with those of the metafile of the original data, and the model central point coordinate of the line where the < SRSOrigin > file header is positioned is input into the converted model central point coordinate.
Preferably, in step S3, the file directory includes a metafile hierarchy, a Tile folder hierarchy and an OSGB file hierarchy, where the hierarchy of the metafile is represented by a Data layer, the Tile folder hierarchy is represented by a Tile layer, and the OSGB file hierarchy is represented by an OSGB layer, and traversing is performed in sequence to add the OSGB file corresponding to each Tile hierarchy under each Data layer to the OSGB access module.
Preferably, the node file types in step S4 include a file containing only a single Geode node and a file containing a Group node, and the file containing the Group node includes three common types, namely, a Group-Geode, a Group-PagedLOD-Geode and a PagedLOD-Geode, and two special types, namely, a mixture of the Group-Geode and the Group-PagedLOD-Geode, wherein the special types are mainly found in data where an original OSGB file is not divided or is patched.
Preferably, the processing flow of the file containing only a single Geode node is as follows:
b1, accessing a Geode node, and acquiring a node Drawable object by using an osg (Geode: getDrawable () method, wherein the Drawable object is mainly composed of Geometry which comprises StateSet for storing texture paths and material information and PrimitiveSets for storing a primitive array, a vertex coordinate and a texture coordinate;
b2, in order to realize the compression of the file, acquiring a node texture object by using an osgStateSeSeSeSetIn the stateSetProperty () method in the attribute of the Geometry, setting the picture path of the texture object as a relative path, and outputting the texture to the directory where the program running file is located by using an osgDB:: writeImageFile () method;
b3, accessing the PrimitiveSets attribute of the node through an application () method corresponding to the acceptable in Draable, defining an osg (Vec 3 Array) type Array because the vertex coordinate of the OSGB is in an (x, y, z) format, and storing the vertex coordinate into the Array when the osg (Draable) is AttributeType in osg (Draable) in Draable in VERTICES;
b4, traversing the vertex coordinate array obtained by B3 by taking 3 as a step length, adding the coordinates of the central point before model conversion to each single-point coordinate, and then importing the coordinates into a coordinate conversion library to obtain the converted single-point coordinates; defining an osg, wherein Vec3Array is used for sequentially storing the converted single-point coordinates minus the converted central-point coordinate values;
and B5, setting the converted vertex array obtained by the B4 as the vertex coordinate array of the current node by using an osg (Geometry) method and a setVertexAlrray () method.
Preferably, the processing flow of the file containing the Group node is as follows:
c1, acquiring the number of secondary nodes of a father node for the accessed Group node by using an osg:: group:: getNumCildren () method;
when the number of the secondary nodes is 0, the special type of the Group only containing PagedLOD is adopted, the LOD center coordinate information is not stored in the special type, S5 is directly executed, and when the number of the secondary nodes is more than 0, C2 is directly executed;
c2, acquiring the name of the current father node by using an osg Group className () method; when the name of the parent node is Group, directly executing C3; when the name of the parent node is PagedLOD, using osg as LOD, obtaining the central coordinate of the LOD by using a loD (loD) method, importing the central coordinate into a coordinate conversion library to obtain the converted central coordinate, using osg as LOD, updating the central coordinate by using a setCenter () method, and setting the drill-down search path of the LOD as a relative path by using osg as PagedLOD, and setting the drill-down search path of the LOD by using a setDatabasePath () method;
and C3, judging whether each secondary node has a tertiary node or not by adopting the same method as the C1.
When the number of the three-level nodes is 0, the two-level Geode is of a Group-Geode type or a PagedLOD-Geode type, and the vertex coordinate conversion of the two types of two-level Geode nodes is realized by using the same method as that of a single Geode node file.
When the number of the three-level nodes is more than 0, the node is a Group-PagedLOD-Geode or a mixed type of the Group-Geode and the Group-PagedLOD-Geode; acquiring the name of a secondary node head, and judging whether the secondary node head is a PagedLOD or not; processing a secondary node head of a non-pagedLOD (namely, a Geode) according to a Group-Geode type, performing central coordinate transformation on the PagedLOD and setting a drill-down path as a relative path on the secondary node head, and realizing vertex coordinate conversion on a three-level Geode node by using the same method as a single Geode node file.
Preferably, when the file in step S5 is output, for a file that only contains a single Geode node, the WriteImageHint attribute of the writing method is set as the inludefile to implement effective compression of data, and for the written OSGB file, the temporary texture generated under the operating directory is deleted; for a file containing a Group node, the WriteImageHint attribute of the writing-out method is set as IncludeData.
Compared with the prior art, the coordinate conversion method of the multi-structure real-scene three-dimensional model provided by the invention has the following advantages:
1. the invention mainly sets conversion information, and then processes metafile processing, file directory analysis, OSGB file access and coordinate conversion and file output, and fully considers the coordinate conversion requirement of OSGB files with various node arrangement structures when accessing and converting the OSGB files, thereby not only meeting the OSGB files originally produced by the Context Capture software, but also meeting the OSGB files with special structures such as secondary repair replacement and non-participation segmentation, and having higher adaptability and compatibility.
2. In the coordinate conversion process, the texture pictures of the leaf nodes are processed by adopting a file stream mode of firstly exporting and then writing, so that the data volume of the OSGB file after conversion is reduced, the aim of saving resources is fulfilled, and the texture is ensured not to be lost, twinkling and deformed.
3. In the coordinate conversion process, the invention takes the lower-level index path and the texture picture path of the OSGB file produced by ContextCapture software as relative paths, thereby avoiding the problem that the conversion result can not be drilled to the lower-level model file in distribution and sharing.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a three-dimensional model file directory diagram of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The specific embodiments described herein are merely illustrative of the invention and do not delimit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides a coordinate conversion method of a multi-structure real-scene three-dimensional model as shown in figures 1-2, which comprises the following steps:
s1, setting conversion information: selecting a directory where a metadata-xml metafile is located in a three-dimensional model file to be converted as an input path, selecting any folder as an output path, setting parameter information of coordinate conversion and connecting the parameter information with an external coordinate conversion library, wherein the external coordinate conversion library realizes reading, conversion and isomorphic output of a single (x, y, z) format coordinate point according to the conversion parameter information, and the conversion algorithm and the process are the same as those of common single-point coordinate conversion;
the parameter information of the coordinate conversion comprises a coordinate conversion library, a band number of a conversion coordinate and coordinate compensation information;
the coordinate transformation library comprises parameter template names (such as '2000 country _3 degree _114 to Changsha independent coordinate system') and transformation methods (such as 'two-dimensional polynomial (xy)');
the band number of the converted coordinate comprises a Y coordinate band number of the original data and a Y coordinate band number of the converted data, the default is 0, the band number value is subtracted from the Y coordinate of the original data before conversion, and the band number value is added to the Y coordinate of the converted data;
the coordinate compensation information includes an X coordinate compensation number and a Y coordinate compensation number of the converted data, which are both 0 by default, so that a fixed value is added to the converted XY coordinates.
S2, metafile processing: analyzing, converting and rewriting the metadata.
The specific steps of metafile processing in step S2 are as follows:
and A1, analyzing the coordinates of the center point of the model in the (x, y, z) format extracted by the < SRSOrigin > file header in the path metadata. Setting the center point of the model to be (0, 0) for the model without defining the coordinates of the center point;
a2, importing the coordinates of the center point of the model into a coordinate conversion library according to the parameter information of the coordinate conversion set in the S1 to obtain the coordinates of the center point after conversion;
a3, storing coordinates relative to a model central point at a vertex in an OSGB file, and recording the coordinates of the model central point before and after conversion so as to facilitate the subsequent conversion of the OSGB vertex coordinates into actual coordinates for coordinate conversion;
and A4, according to the output path set in the S1, newly establishing a metadata metafile under the output path, wherein the content and the format are consistent with those of the metafile of the original data, and the model central point coordinate of the line where the < SRSOrigin > file header is positioned is input into the converted model central point coordinate.
S3, file directory analysis: traversing each tile folder of the model file according to the input path set in the step S1 in sequence, and adding OSGB files under each folder into an OSGB access module;
the file directory comprises a metafile hierarchy, a Tile folder hierarchy and an OSGB file hierarchy, wherein the hierarchy of the metafile is represented by a Data layer, the Tile folder hierarchy is represented by a Tile layer, and the OSGB file hierarchy is represented by an OSGB layer, and traversing in sequence facilitates adding the OSGB file corresponding to each Tile hierarchy under each Data layer to the OSGB access module.
S4, access and coordinate conversion of the OSGB file: the nodes of the OSGB file comprise a Geode type and a Group type, the Node file type comprises a file only containing a single Geode Node and a file containing a Group Node, the file containing the Group Node comprises three common types of Group-Geode, group-PagedLOD-Geode and two special types of PagedLOD, group-Geode and Group-PagedLOD-Geode, wherein the special types are mainly found in data which is not divided or is used for repairing the original OSGB file, and the nodes of the Geode type and the Group type are respectively accessed and processed by an adaptation () method of an accept in an accessor by using an accessor mode of an OSG; the processing of the OSGB file comprises the processing of a file only containing a single Geode node and the processing of a file containing a Group node;
processing files only containing a single Geode node comprises node access, texture information extraction, vertex coordinate conversion and coordinate setting after conversion;
the processing flow of the file containing only a single Geode node is as follows:
b1, accessing a Geode node, and acquiring a node Drawable object by using an osg (Geode: getDrawable () method, wherein the Drawable object is mainly composed of Geometry which comprises StateSet for storing texture paths and material information and PrimitiveSets for storing a primitive array, a vertex coordinate and a texture coordinate;
b2, in order to realize the compression of the file, acquiring a node texture object by using an osgStatStateSet () method in the StateSet attribute of Geometry, setting a picture path of the texture object as a relative path, and outputting the texture to a directory where a program running file is located by using an osgDB:: writeImageFile () method;
b3, accessing the PrimitiveSets attribute of the node through an application () method corresponding to the acceptable in Draable, defining an osg (Vec 3 Array) type Array because the vertex coordinate of the OSGB is in an (x, y, z) format, and storing the vertex coordinate into the Array when the osg (Draable) is AttributeType in osg (Draable) in Draable in VERTICES;
b4, traversing the vertex coordinate array obtained by B3 by taking 3 as a step length, adding the coordinates of the central point before model conversion to each single-point coordinate, and then importing the coordinates into a coordinate conversion library to obtain the converted single-point coordinates; defining an osg, wherein Vec3Array is used for sequentially storing the converted single-point coordinates minus the converted central-point coordinate values;
and B5, setting the converted vertex array obtained by the B4 as the vertex coordinate array of the current node by using an osg (Geometry) method.
The processing of the file containing the Group node comprises judging whether a father node has a secondary node, judging the type of the father node and judging whether the secondary node has a tertiary node.
The processing flow of the file containing the Group node is as follows:
c1, acquiring the number of secondary nodes of a father node for the accessed Group node by using an osg:: group:: getNumCildren () method;
when the number of the secondary nodes is 0, the special type of the Group only containing PagedLOD is adopted, the LOD center coordinate information is not stored in the special type, S5 is directly executed, and when the number of the secondary nodes is more than 0, C2 is directly executed;
c2, acquiring the name of the current father node by using an osg Group className () method; when the name of the parent node is Group, directly executing C3; when the name of the parent node is PagedLOD, using osg as LOD, obtaining the central coordinate of the LOD by using a loD (loD) method, importing the central coordinate into a coordinate conversion library to obtain the converted central coordinate, using osg as LOD, updating the central coordinate by using a setCenter () method, and setting the drill-down search path of the LOD as a relative path by using osg as PagedLOD, and setting the drill-down search path of the LOD by using a setDatabasePath () method;
and C3, judging whether each secondary node has a tertiary node or not by adopting the same method as the C1.
When the number of the three-level nodes is 0, the two-level Geode is of a Group-Geode type or a PagedLOD-Geode type, and the vertex coordinate conversion of the two types of two-level Geode nodes is realized by using the same method as that of a single Geode node file.
When the number of the three-level nodes is more than 0, the node is a Group-PagedLOD-Geode or a mixed type of the Group-Geode and the Group-PagedLOD-Geode; acquiring the name of a secondary node head, and judging whether the secondary node head is PagedLOD or not; processing a secondary node head of a non-PagedLOD (namely, a Geode) according to a Group-Geode type, performing center coordinate transformation on the secondary node head named as the PagedLOD, setting a drill-down path as a relative path, and realizing vertex coordinate transformation on a three-level Geode node by using the same method as a single Geode node file.
S5, outputting a file: writing the converted OSGB file to an output path by using the osgDB:: writeNodeFile () method,
when the file is output, setting the WriteImageHint attribute of the writing method to be IncludeFile for the file only containing a single Geode node to realize effective compression of data, and deleting temporary textures generated by the written OSGB file under an operation directory; for a file containing a Group node, the WriteImageHint attribute of the writing-out method is set as IncludeData.
In summary, conversion information setting is performed first, and then metafile processing, file directory parsing, access and coordinate conversion of an OSGB file and file output are performed, so that a coordinate conversion requirement of the OSGB file with various node arrangement structures is fully considered during the access and coordinate conversion of the OSGB file, that is, the OSGB file originally produced by ContextCapture software is satisfied, and the OSGB file with a special structure, such as secondary repair replacement and non-participation in segmentation, is also satisfied, and has high adaptability and compatibility.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still make modifications to the technical solutions described in the foregoing embodiments, or make equivalent substitutions and improvements to part of the technical features of the foregoing embodiments, and any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (8)

1. A coordinate conversion method of a multi-structure real-scene three-dimensional model is characterized in that: the method comprises the following steps:
s1, setting conversion information: selecting a directory where a metadata-xml metafile is located in a three-dimensional model file to be converted as an input path, selecting any folder as an output path, setting parameter information of coordinate conversion and connecting the parameter information with an external coordinate conversion library, wherein the external coordinate conversion library realizes reading, conversion and isomorphic output of a single (x, y, z) format coordinate point according to the conversion parameter information, and the conversion algorithm and the process are the same as those of common single-point coordinate conversion;
s2, metafile processing: analyzing, converting and rewriting the metadata.xml metafile;
s3, file directory analysis: traversing all tile folders of the model file according to the input path set in the step S1 in sequence, and adding OSGB files under each folder into an OSGB access module;
s4, access and coordinate conversion of an OSGB file: the nodes of the OSGB file comprise a Geode type and a Group type, and the processing of the OSGB file comprises the processing of a file only containing a single Geode node and the processing of a file containing a Group node;
processing files only containing a single Geode node comprises node access, texture information extraction, vertex coordinate conversion and coordinate setting after conversion;
the processing of the file containing the Group node comprises judging whether a father node has a secondary node, judging the type of the father node and judging whether the secondary node has a tertiary node;
s5, outputting a file: and writing the converted OSGB file to an output path by using an osgDB: (writeNodeFile () method).
2. The method of converting coordinates of a multi-structure real-scene three-dimensional model according to claim 1, wherein: the parameter information of the coordinate conversion in the step S1 comprises a coordinate conversion library, a band number of a conversion coordinate and coordinate compensation information;
the coordinate conversion library comprises parameter template names and conversion methods;
the belt number of the conversion coordinate comprises a Y coordinate belt number of the original data and a Y coordinate belt number of the converted data, the default is 0, the belt number value is subtracted from the Y coordinate of the original data before conversion, and the belt number value is added to the Y coordinate of the converted data;
the coordinate compensation information includes an X coordinate compensation number and a Y coordinate compensation number of the converted data, and the default is 0, so that a fixed value is added to the converted XY coordinate.
3. The method of claim 1, wherein the method comprises the steps of: the specific steps of the metafile processing in step S2 are as follows:
a1, analyzing a < SRSOrigin > file header in a path metadata.xml file to extract coordinates of a model center point in an (x, y, z) format according to an input path set in S1, and setting the model center point to (0, 0) for a model without defining the coordinates of the center point;
a2, importing the coordinates of the center point of the model into a coordinate conversion library according to the parameter information of the coordinate conversion set in the S1 to obtain the coordinates of the center point after the conversion;
a3, storing coordinates relative to a model central point at a vertex in an OSGB file, and recording the coordinates of the model central point before and after conversion so as to facilitate the subsequent conversion of the OSGB vertex coordinates into actual coordinates for coordinate conversion;
and A4, according to the output path set in the S1, newly establishing a metadata metafile under the output path, wherein the content and the format are consistent with those of the metafile of the original data, and the model central point coordinate of the line where the < SRSOrigin > file header is positioned is input into the converted model central point coordinate.
4. The method of converting coordinates of a multi-structure real-scene three-dimensional model according to claim 1, wherein: in the step S3, the file directory comprises a metafile hierarchy, a Tile folder hierarchy and an OSGB file hierarchy, wherein the hierarchy of the metafile is represented by a Data layer, the Tile folder hierarchy is represented by a Tile layer, and the OSGB file hierarchy is represented by an OSGB layer, and traversing is performed in order to add the OSGB file corresponding to each Tile hierarchy under each Data layer to the OSGB access module.
5. The method of converting coordinates of a multi-structure real-scene three-dimensional model according to claim 1, wherein: the node file types in the step S4 include a file only containing a single Geode node and a file containing a Group node, the file containing the Group node includes three common types of Group-Geode, group-PagedLOD-Geode and two special types of PagedLOD, group-Geode and Group-PagedLOD-Geode, and the special types are mainly found in data which is not divided or is used for repairing the original OSGB file.
6. The method of claim 5, wherein the method comprises: the processing flow of the file only containing a single Geode node is as follows:
b1, accessing a Geode node, and acquiring a node Drawable object by using an osg (Geode: getDrawable () method, wherein the Drawable object is mainly composed of Geometry which comprises StateSet for storing texture paths and material information and PrimitiveSets for storing a primitive array, a vertex coordinate and a texture coordinate;
b2, in order to realize the compression of the file, acquiring a node texture object by using an osgStateSeSeSeSetIn the stateSetProperty () method in the attribute of the Geometry, setting the picture path of the texture object as a relative path, and outputting the texture to the directory where the program running file is located by using an osgDB:: writeImageFile () method;
b3, accessing the PrimitiveSets attribute of the node through an application () method corresponding to the acceptable in Draable, defining an osg (Vec 3 Array) type Array because the vertex coordinate of the OSGB is in an (x, y, z) format, and storing the vertex coordinate into the Array when the osg (Draable) is AttributeType in osg (Draable) in Draable in VERTICES;
b4, traversing the vertex coordinate array obtained by B3 by taking 3 as a step length, adding the coordinates of the central point before model conversion to each single-point coordinate, and then importing the coordinates into a coordinate conversion library to obtain the converted single-point coordinates; defining an osg, wherein Vec3Array is used for sequentially storing the converted single-point coordinates minus the converted central-point coordinate values;
and B5, setting the converted vertex array obtained by the B4 as the vertex coordinate array of the current node by using an osg (Geometry) method.
7. The method of claim 6, wherein the method comprises: the processing flow of the file containing the Group node is as follows:
c1, acquiring the number of secondary nodes of a father node for the accessed Group node by using an osg:: group:: getNumCildren () method;
when the number of the secondary nodes is 0, the special type of the Group only containing PagedLOD is adopted, the LOD center coordinate information is not stored in the special type, S5 is directly executed, and when the number of the secondary nodes is more than 0, C2 is directly executed;
c2, acquiring the name of the current father node by using an osg Group className () method; when the name of the parent node is Group, directly executing C3; when the name of the parent node is PagedLOD, using osg as LOD, obtaining the central coordinate of the LOD by using a loD (loD) method, importing the central coordinate into a coordinate conversion library to obtain the converted central coordinate, using osg as LOD, updating the central coordinate by using a setCenter () method, and setting the drill-down search path of the LOD as a relative path by using osg as PagedLOD, and setting the drill-down search path of the LOD by using a setDatabasePath () method;
c3, judging whether each secondary node has a tertiary node or not by adopting the same method as C1;
when the number of the three-level nodes is 0, the two types of the two secondary Geode nodes are of a Group-Geode type or a PagedLOD-Geode type, and vertex coordinate conversion is realized by using the same method as a single Geode node file;
when the number of the three-level nodes is more than 0, the node is a Group-PagedLOD-Geode or a mixed type of the Group-Geode and the Group-PagedLOD-Geode; acquiring the name of a secondary node head, and judging whether the secondary node head is PagedLOD or not; processing a secondary node head of a non-PagedLOD (namely, a Geode) according to a Group-Geode type, performing center coordinate transformation on the secondary node head named as the PagedLOD, setting a drill-down path as a relative path, and realizing vertex coordinate transformation on a three-level Geode node by using the same method as a single Geode node file.
8. The method of converting coordinates of a multi-structure real-scene three-dimensional model according to claim 1, wherein: when the file is output in the step S5, the WriteImageHint attribute of the writing method is set as IncludeFile to realize effective compression of data for the file only containing a single Geode node, and temporary textures generated by the written OSGB file under an operation directory are deleted; for a file containing a Group node, the WriteImageHint attribute of the writing method is set as IncludeData.
CN202211173152.2A 2022-09-26 2022-09-26 Coordinate conversion method of multi-structure live-action three-dimensional model Pending CN115512047A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211173152.2A CN115512047A (en) 2022-09-26 2022-09-26 Coordinate conversion method of multi-structure live-action three-dimensional model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211173152.2A CN115512047A (en) 2022-09-26 2022-09-26 Coordinate conversion method of multi-structure live-action three-dimensional model

Publications (1)

Publication Number Publication Date
CN115512047A true CN115512047A (en) 2022-12-23

Family

ID=84505279

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211173152.2A Pending CN115512047A (en) 2022-09-26 2022-09-26 Coordinate conversion method of multi-structure live-action three-dimensional model

Country Status (1)

Country Link
CN (1) CN115512047A (en)

Similar Documents

Publication Publication Date Title
CN110704928B (en) Method for converting BIM model into GIS model
JP3870167B2 (en) Rendering system, rendering method and recording medium thereof
CN106600700B (en) Three-dimensional model data processing system
CN108647017A (en) A kind of parametrization quickly generates the integrated platform of three-dimensional interactive and Simulation Application software
CN112989482B (en) BIM model data generation method and device and building method and device
CN104392037A (en) City scene parameterization modeling system
CN111540051A (en) CIM-based full-factor mass data lightweight and topology analysis application platform
CN113094355A (en) Model instantiation method, device, equipment and medium based on domestic communication protocol
CN116340260A (en) Building model data rendering method and device, electronic equipment and readable storage medium
CN109858059B (en) Application method of virtual reality technology based on CAD (computer-aided design) super-large model in hydropower station simulation
CN116414316B (en) Illusion engine rendering method based on BIM model in digital city
CN112365598B (en) Method, device and terminal for converting oblique photography data into three-dimensional data
CN109189725A (en) The obj file lossless compression method of rule-oriented building
CN111275826B (en) Three-dimensional model automatic conversion method suitable for AR scene
CN117077256A (en) Method for converting rvt format into b3d format, plug-in and system thereof
CN105242958A (en) Virtual testing system and HLA simulation system data exchange method
CN115512047A (en) Coordinate conversion method of multi-structure live-action three-dimensional model
CN104392035B (en) A kind of urban three-dimensional modeling method of sing on web
CN111427867B (en) Model persistence method based on hybrid storage
CN113470172A (en) Method for converting 3DTiles through OBJ three-dimensional model
CN113609556A (en) GIM format and XDB format lossless conversion method of basic C #, and base XDB format lossless conversion method
CN114969586A (en) BIM (building information modeling) graphic engine loading method and device based on WEB side
CN113730920B (en) Method and system for presetting component synchronization attribute
Ding et al. Lightweight display of railway four-electricity BIM model based on glTF format and WebGL technology
CN116012532A (en) Live-action three-dimensional model light-weight method and system

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