CN115830273A - Optimization method and device of lightweight grid before three-dimensional scene rendering - Google Patents

Optimization method and device of lightweight grid before three-dimensional scene rendering Download PDF

Info

Publication number
CN115830273A
CN115830273A CN202310030942.3A CN202310030942A CN115830273A CN 115830273 A CN115830273 A CN 115830273A CN 202310030942 A CN202310030942 A CN 202310030942A CN 115830273 A CN115830273 A CN 115830273A
Authority
CN
China
Prior art keywords
collapse
optimizing
rendering
edge
dimensional scene
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
CN202310030942.3A
Other languages
Chinese (zh)
Other versions
CN115830273B (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.)
Beijing Feidu Technology Co ltd
Original Assignee
Beijing Feidu Technology 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 Beijing Feidu Technology Co ltd filed Critical Beijing Feidu Technology Co ltd
Priority to CN202310030942.3A priority Critical patent/CN115830273B/en
Publication of CN115830273A publication Critical patent/CN115830273A/en
Application granted granted Critical
Publication of CN115830273B publication Critical patent/CN115830273B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Image Generation (AREA)

Abstract

The invention discloses a method and a device for optimizing a lightweight grid before three-dimensional scene rendering. The optimization method of the lightweight grid before the three-dimensional scene rendering comprises the following steps: step 1: acquiring plane information of a plane where each triangle in the three-dimensional model to be optimized is located; step 2: acquiring the collapse position of each edge of the three-dimensional model to be optimized according to the plane information of the plane where each triangle is located; and step 3: selecting one of the collapse positions as an optimal collapse position; and 4, step 4: and optimizing the three-dimensional model to be optimized according to the optimal collapse position, thereby reducing the number of triangles in the three-dimensional model to be optimized. The method and the device optimize the huge triangular meshes, and reduce the number of the triangular meshes for describing the three-dimensional scene details as much as possible on the premise of ensuring controllable loss of the triangular meshes.

Description

Optimization method and device of lightweight grid before three-dimensional scene rendering
Technical Field
The application relates to the technical field of three-dimensional model optimization, in particular to an optimization method of a light-weight grid before three-dimensional scene rendering and an optimization device of the light-weight grid before three-dimensional scene rendering.
Background
In a massive three-dimensional scene at the city level, components in the three-dimensional scene are often described using triangles at the million level or billions (hereinafter referred to as triangle meshes). Such a large number of triangular meshes is not necessary or redundant in nature in either a near view or a far view. How to remove some redundant triangular meshes before rendering these huge triangular meshes is very necessary to improve the rendering frame rate and reduce the use of storage space.
Accordingly, a solution is desired to solve or at least mitigate the above-mentioned deficiencies of the prior art.
Disclosure of Invention
It is an object of the present invention to provide a method of optimizing a pre-rendering lightweight mesh for a three-dimensional scene that overcomes or at least mitigates at least one of the above-mentioned disadvantages of the prior art.
In one aspect of the present invention, a method for optimizing a three-dimensional scene pre-rendering lightweight mesh is provided, where the method for optimizing the three-dimensional scene pre-rendering lightweight mesh includes:
step 1: acquiring plane information of a plane where each triangle in the three-dimensional model to be optimized is located;
step 2: acquiring the collapse position of each edge of the three-dimensional model to be optimized according to the plane information of the plane where each triangle is located;
and step 3: selecting one of the collapse positions as an optimal collapse position;
and 4, step 4: and optimizing the three-dimensional model to be optimized according to the optimal collapse position, thereby reducing the number of triangles in the three-dimensional model to be optimized.
Optionally, the step 2 includes:
the collapse position of each edge is obtained by the following formula:
Figure 415219DEST_PATH_IMAGE001
(ii) a Wherein the content of the first and second substances,
a is a symmetric matrix;
Figure 66780DEST_PATH_IMAGE002
(ii) a f (x, y, z) is the vertex at which the extremum is obtainedCoordinates of the object
Figure 315358DEST_PATH_IMAGE003
In a collapsed position.
Optionally, the step 3 includes:
step 31: obtaining a distance square sum value of each edge of the three-dimensional model to be optimized according to the collapse positions and the plane information of the plane where each triangle is located, wherein one collapse position is used for solving a distance square sum value;
step 32: and acquiring the collapse position corresponding to the minimum distance sum of squares value in each distance sum of squares value as the optimal collapse position.
Optionally, the step 31 obtains a distance sum of squares value by using the following formula:
Figure 444988DEST_PATH_IMAGE004
(ii) a Wherein the content of the first and second substances,
L 2 is the sum of squares of the distances,
Figure 993782DEST_PATH_IMAGE005
Is the transposition of V, V is a collapse position,
Figure 285086DEST_PATH_IMAGE006
Is a symmetric matrix, is recorded as
Figure 20960DEST_PATH_IMAGE007
Optionally, the step 4 includes:
step 41: acquiring position information of each side of each triangle;
step 42: respectively setting a connection relation set for each endpoint of each edge, wherein each connection relation set comprises an endpoint and a triangle having a connection relation with the endpoint;
step 43: obtaining an edge corresponding to the optimal collapse position according to the optimal collapse position, wherein the edge is called a collapse edge to be collapsed;
step 44: two end points of the edge to be collapsed collapse to the optimal collapse position, so that an optimal collapse point is formed;
step 45: acquiring triangles with connection relations with two end points of the side to be collapsed respectively through the connection relation set;
step 46: and connecting each triangle which has a connection relation with two end points of the edge to be collapsed with the optimal collapse point.
Optionally, after the step 4 is completed, the method for optimizing the lightweight mesh before the three-dimensional scene rendering further includes:
and repeating the step 3 and the step 4 until a preset condition is reached.
Optionally, the preset conditions are:
each distance sum of squares value in the step 31 is greater than a preset threshold value.
The application also provides an optimizing device of the lightweight mesh before the three-dimensional scene is rendered, the optimizing device of the lightweight mesh before the three-dimensional scene is rendered includes:
the plane information acquisition module is used for acquiring plane information of a plane where each triangle in the three-dimensional model to be optimized is located;
the collapse position obtaining module is used for obtaining the collapse position of each side of the three-dimensional model to be optimized according to the plane information of the plane where each triangle is located;
the optimal collapse position selection module is used for selecting one of the collapse positions as an optimal collapse position;
and the optimization module is used for optimizing the three-dimensional model to be optimized according to the optimal collapse position, so that the number of triangles in the three-dimensional model to be optimized is reduced.
The application also provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to realize the optimization method of the three-dimensional scene pre-rendering lightweight mesh.
The application also provides a computer-readable storage medium, which stores a computer program, and the computer program can realize the optimization method of the three-dimensional scene before rendering lightweight grid when being executed by a processor.
Advantageous effects
This application has following advantage:
according to the optimization method of the lightweight mesh before the three-dimensional scene rendering, before massive three-dimensional scenes are rendered, the huge triangular mesh can be optimized, and the number of the triangular meshes for describing the three-dimensional scene details is reduced as much as possible on the premise that the loss of the triangular meshes is controllable, so that the rendering frame rate of the three-dimensional scene can be greatly improved through the reduction of the number of the triangular meshes and the reduction of the storage space, and the distribution and the sharing of the city-level three-dimensional scene are facilitated.
Drawings
Fig. 1 is a schematic flowchart of a method for optimizing a lightweight mesh before rendering a three-dimensional scene according to a first embodiment of the present application;
FIG. 2 is an electronic device for implementing the method for optimizing a pre-rendering lightweight mesh for the three-dimensional scene shown in FIG. 1;
FIG. 3 is a schematic diagram of a three-dimensional model of an embodiment of the present application.
Detailed Description
In order to make the implementation objects, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be described in more detail below with reference to the drawings in the embodiments of the present application. In the drawings, the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The described embodiments are a subset of the embodiments in the present application and not all embodiments in the present application. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application. 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 application. Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of an optimization method for a lightweight mesh before rendering a three-dimensional scene according to a first embodiment of the present disclosure.
The optimization method of the lightweight mesh before the three-dimensional scene rendering as shown in fig. 1 comprises the following steps:
step 1: acquiring plane information of a plane where each triangle in the three-dimensional model to be optimized is located;
step 2: acquiring the collapse position of each edge of the three-dimensional model to be optimized according to the plane information of the plane where each triangle is located;
and step 3: selecting one of the collapse positions as an optimal collapse position;
and 4, step 4: and optimizing the three-dimensional model to be optimized according to the optimal collapse position, thereby reducing the number of triangles in the three-dimensional model to be optimized.
According to the optimization method of the lightweight mesh before the three-dimensional scene rendering, before massive three-dimensional scenes are rendered, the huge triangular mesh can be optimized, and the number of the triangular meshes for describing the three-dimensional scene details is reduced as much as possible on the premise that the loss of the triangular meshes is controllable, so that the rendering frame rate of the three-dimensional scene can be greatly improved through the reduction of the number of the triangular meshes and the reduction of the storage space, and the distribution and the sharing of the city-level three-dimensional scene are facilitated.
In this embodiment, step 2 includes:
the collapse position of each edge is obtained by the following formula:
Figure 688702DEST_PATH_IMAGE008
in this embodiment, the step 3 includes:
step 31: obtaining a distance square sum value of each edge of the three-dimensional model to be optimized according to the collapse positions and the plane information of the plane where each triangle is located, wherein one collapse position is used for solving a distance square sum value;
step 32: and acquiring the collapse position corresponding to the minimum distance sum of squares value in each distance sum of squares value as the optimal collapse position.
In this embodiment, the step 31 obtains the sum of squared distances by using the following formula:
Figure 92002DEST_PATH_IMAGE009
(ii) a Wherein the content of the first and second substances,
L 2 is the sum of squares of the distances,
Figure 819786DEST_PATH_IMAGE005
Is the transposition of V, V is a collapse position,
Figure 42957DEST_PATH_IMAGE010
Is a symmetric matrix, is recorded as
Figure 514390DEST_PATH_IMAGE007
In this embodiment, the step 4 includes:
step 41: acquiring position information of each side of each triangle;
step 42: respectively setting a connection relation set for each endpoint of each edge, wherein each connection relation set comprises an endpoint and a triangle having a connection relation with the endpoint;
step 43: obtaining an edge corresponding to the optimal collapse position according to the optimal collapse position, wherein the edge is called a collapse edge to be collapsed;
step 44: two end points of the edge to be collapsed collapse to the optimal collapse position, so that an optimal collapse point is formed;
step 45: acquiring a triangle which has a connection relation with two end points of the edge to be collapsed respectively through the connection relation set;
step 46: and connecting each triangle which has a connection relation with two end points of the edge to be collapsed with the optimal collapse point.
In this embodiment, after the step 4 is completed, the method for optimizing a lightweight mesh before three-dimensional scene rendering further includes:
and repeating the step 3 and the step 4 until a preset condition is reached.
In this embodiment, the preset conditions are:
each distance sum of squares value in the step 31 is greater than a preset threshold value.
The technical solutions of the present application are further described in detail below by way of examples, and it should be understood that the examples do not limit the present application in any way.
Referring to fig. 1, step 1: acquiring plane information of a plane where each triangle in the three-dimensional model to be optimized is located;
step 2: acquiring the collapse position of each edge of the three-dimensional model to be optimized according to the plane information of the plane where each triangle is located;
and step 3: selecting one of the collapse positions as an optimal collapse position;
and 4, step 4: and optimizing the three-dimensional model to be optimized according to the optimal collapse position, thereby reducing the number of triangles in the three-dimensional model to be optimized.
Specifically, as shown in fig. 3, fig. 3 is a typical small-scale triangular mesh, and is a schematic diagram of a triangular mesh that only shows a great amount of local details of a three-dimensional scene. How to find out redundant triangles in a large number of triangular meshes and remove the redundant triangles from the original triangular meshes without making human eyes perceive obvious changes in details needs to quantitatively express how much the new triangular meshes and the old triangular meshes (hereinafter referred to as new and old triangular meshes) change in geometry after a certain triangle or triangles are removed, and then determine the triangles to be removed according to the quantitatively expressed changes and a given threshold. As shown in FIG. 3, connecting the three triangles { v1, v2, v3}, { v1, v4, v2}, { v1, v5, v2} on the side { v1, v2} and removing the three triangles on the side { v1, v2} will generate a hole { v1, v3, v2v4}, shorten the side { v1, v2} to a point vo, and the hole disappears, while all the vertices v1, v2 in all the un-removed triangles in the new mesh will be replaced with points vo. The sum of the squares L2 of the distances of the points vo from the plane in which the triangle having an association with vo is located measures the geometric change of the two resulting from the operation of removing the triangle.
Figure 772196DEST_PATH_IMAGE011
=
Figure 667952DEST_PATH_IMAGE012
In the above-mentioned formula, the compound has the following structure,
Figure 643998DEST_PATH_IMAGE013
representing the planes of all triangles associated with the two vertices of the edge { v1, v2}, a plane is typically represented by three directional cosines plus a directed distance to form a column vector, i.e.
Figure 387963DEST_PATH_IMAGE014
The number of planes is n; v is the vertex coordinate of the three-dimensional space, usually expressed in homogeneous coordinates, i.e. the column vector V (x, y, z, 1),
Figure 765855DEST_PATH_IMAGE005
represents a transposition of V; matrix array
Figure 569863DEST_PATH_IMAGE015
Is formed by all column vectors
Figure 33205DEST_PATH_IMAGE016
The structure of the composite material is marked as P,
Figure 580861DEST_PATH_IMAGE017
is the transpose of the matrix P, noted
Figure 813260DEST_PATH_IMAGE018
Then, the sum of squared distances is rewritten as follows:
Figure 53748DEST_PATH_IMAGE009
matrix in the above formula
Figure 738807DEST_PATH_IMAGE006
Is a symmetric matrix, denoted
Figure 355733DEST_PATH_IMAGE007
If the column vectors of the matrix P are linearly independent of each other, the matrix A is positive, the distance sum of squares L2 must have a minimum value, the minimum value of the distance sum of squares (denoted as minL 2) is used as a quantitative expression for removing the geometric change of new and old triangular meshes after removing the associated triangles on a certain edge, such as the edge { v1, v2}, and is recorded in the attribute of each edge.
Then, the minL of all edges in the triangular mesh is obtained 2 While calculating L 2 Obtaining a minimum value minL 2 Coordinates of the time-corresponding vertex vo
Figure 177059DEST_PATH_IMAGE019
Let a ternary quadratic function
Figure 854028DEST_PATH_IMAGE020
Meanwhile, the symmetric matrix A is partitioned as follows:
Figure 760804DEST_PATH_IMAGE021
the gradient vector of the function f (x, y, z) is then:
Figure 650263DEST_PATH_IMAGE022
order to
Figure 857253DEST_PATH_IMAGE002
Obtaining a 3 rd order square matrix of non-homogeneous linear equation system, the only solution is the vertex coordinate when f (x, y, z) obtains extreme value
Figure 705123DEST_PATH_IMAGE019
And the vertex coordinate is the collapse position.
And the blackout matrix formed by the second-order partial derivatives of the function f (x, y, z) is:
Figure 99196DEST_PATH_IMAGE023
the 1, 2 and 3 order sequence subforms of A are only larger than zero, and the black plug matrix
Figure 57924DEST_PATH_IMAGE024
Is a positive definite matrix so that the gradient vector can be determined
Figure 853842DEST_PATH_IMAGE002
Extreme point of time is minimum value, i.e. the vertex coordinates in this case
Figure 607034DEST_PATH_IMAGE003
Substituting into ternary quadratic function f (x, y, z) to obtain L 2 Minimum value of (min L) 2
Finally, there are two special cases to handle. (1) If the column vectors of the matrix P comprise column vectors formed by parallel or same planes, the column vectors of the matrix P cannot ensure that the two column vectors are linearly independent, and the matrix A cannot ensure that the column vectors are positive; (2) if the blackout matrix of the function f (x, y, z) cannot be guaranteed to be positive. At this time, the end point and the midpoint coordinate of an edge, for example, the edge { v1, v2} should be respectively substituted into the ternary quadratic function f (x, y, z), and the minimum value should be taken as L 2 Minimum value of (min L) 2
In this embodiment, the step 4 includes:
step 41: obtaining position information of each edge of each triangle (i.e. position information of each edge in fig. 3, for example, { v1, v2}, { v1, v3}, { v1, v4}, etc. shown in fig. 3. It is understood that each triangle has three edges, and the positions of each point and therefore each edge are known in the three-dimensional model);
step 42: respectively setting a connection relation set for each endpoint of each edge, wherein each connection relation set comprises an endpoint and triangles having connection relations with the endpoint (for example, taking endpoint V1 as an example, triangles having relations with V1 comprise { V1, V2, V3}, { V1, V4, V2}, { V1, V5, V2}, and it is understood that other triangles are also included, and only a few of the triangles are schematically described here);
step 43: obtaining an edge corresponding to the optimal collapse position according to the optimal collapse position, wherein the edge is called an edge to be collapsed (for example, { v1, v2} obtained by calculation is an edge to be collapsed);
step 44: two end points of the edge to be collapsed collapse to the optimal collapse position, so as to form an optimal collapse point (namely, shortening the edge { v1, v2} into a point vo);
step 45: obtaining triangles (i.e., { v1, v2, v3}, { v1, v4, v2}, { v1, v5, v2}, respectively, which have connection relationships with two end points of an edge to be collapsed, through the connection relationship set, and it is understood that other triangles may be included, and only some of them are schematically described here);
step 46: and connecting each triangle which has a connection relation with two end points of the side to be collapsed with the optimal collapse point (namely, V1 in { V1, V2, V3} is changed into V0, V1 in { V1, V4, V2} is changed into V0, and the like).
By the method, the quantity of the massive triangular meshes can be reduced on the premise of controlling the loss of the details of the triangular meshes, so that the three-dimensional massive scene can be interactively rendered without pause when the display memory and rendering operation resources are rendered constantly.
The application also provides an optimization device of the three-dimensional scene pre-rendering lightweight grid, the optimization device of the three-dimensional scene pre-rendering lightweight grid comprises a plane information acquisition module, a collapse position acquisition module, an optimal collapse position selection module and an optimization module, wherein the plane information acquisition module is used for acquiring plane information of a plane where each triangle in the three-dimensional model to be optimized is located; the collapse position acquisition module is used for acquiring the collapse position of each edge of the three-dimensional model to be optimized according to the plane information of the plane where each triangle is located; the optimal collapse position selection module is used for selecting one of the collapse positions as an optimal collapse position; the optimization module is used for optimizing the three-dimensional model to be optimized according to the optimal collapse position, so that the number of triangles in the three-dimensional model to be optimized is reduced.
It should be noted that the foregoing explanations of the method embodiments are also applicable to the system of this embodiment, and are not repeated herein.
The application also provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to realize the optimization method of the lightweight mesh before three-dimensional scene rendering.
The application also provides a computer-readable storage medium, which stores a computer program, and the computer program can realize the optimization method of the lightweight mesh before the rendering of the three-dimensional scene when being executed by a processor.
Fig. 2 is an exemplary structural diagram of an electronic device capable of implementing an optimization method for a pre-rendering lightweight mesh for a three-dimensional scene according to an embodiment of the present application.
As shown in fig. 2, the electronic device includes an input device 501, an input interface 502, a central processor 503, a memory 504, an output interface 505, and an output device 506. The input interface 502, the central processing unit 503, the memory 504 and the output interface 505 are connected to each other through a bus 507, and the input device 501 and the output device 506 are connected to the bus 507 through the input interface 502 and the output interface 505, respectively, and further connected to other components of the electronic device. Specifically, the input device 504 receives input information from the outside and transmits the input information to the central processor 503 through the input interface 502; the central processor 503 processes the input information based on computer-executable instructions stored in the memory 504 to generate output information, temporarily or permanently stores the output information in the memory 504, and then transmits the output information to the output device 506 through the output interface 505; the output device 506 outputs the output information to the outside of the electronic device for use by the user.
That is, the electronic device shown in fig. 2 may also be implemented to include: a memory storing computer-executable instructions; and one or more processors which, when executing the computer executable instructions, may implement the method of optimizing a pre-three-dimensional scene rendering lightweight mesh described in connection with fig. 1.
In one embodiment, the electronic device shown in fig. 2 may be implemented to include: a memory 504 configured to store executable program code; one or more processors 503 configured to execute the executable program code stored in the memory 504 to perform the method for optimizing a three-dimensional scene pre-rendering lightweight mesh in the above embodiments.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media include both non-transitory and non-transitory, removable and non-removable media that implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
Furthermore, it will be obvious that the term "comprising" does not exclude other elements or steps. A plurality of units, modules or devices recited in the device claims may also be implemented by one unit or overall device by software or hardware. The terms first, second, etc. are used to identify names, but not any particular order.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks identified in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The Processor in this embodiment may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, and so on. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may be used to store computer programs and/or modules, and the processor may implement various functions of the apparatus/terminal device by running or executing the computer programs and/or modules stored in the memory, as well as by invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
In this embodiment, the module/unit integrated with the apparatus/terminal device may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by hardware related to instructions of a computer program, and the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments described above may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, recording medium, U.S. disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution media, and the like.
It should be noted that the computer readable medium may contain content that is appropriately increased or decreased as required by legislation and patent practice in the jurisdiction. Although the present application has been described with reference to the preferred embodiments, it is not intended to limit the present application, and those skilled in the art can make variations and modifications without departing from the spirit and scope of the present application.
Although the invention has been described in detail hereinabove with respect to a general description and specific embodiments thereof, it will be apparent to those skilled in the art that modifications or improvements may be made thereto based on the invention. Accordingly, such modifications and improvements are intended to be within the scope of the invention as claimed.

Claims (10)

1. A method for optimizing a three-dimensional scene pre-rendering lightweight mesh, the method comprising:
step 1: acquiring plane information of a plane where each triangle in the three-dimensional model to be optimized is located;
step 2: acquiring the collapse position of each edge of the three-dimensional model to be optimized according to the plane information of the plane where each triangle is located;
and step 3: selecting one of the collapse positions as an optimal collapse position;
and 4, step 4: and optimizing the three-dimensional model to be optimized according to the optimal collapse position, thereby reducing the number of triangles in the three-dimensional model to be optimized.
2. The method of optimizing a pre-rendering lightweight mesh for a three-dimensional scene as recited in claim 1, wherein said step 2 comprises:
the collapse position of each edge is obtained by the following formula:
Figure 171124DEST_PATH_IMAGE001
(ii) a Wherein the content of the first and second substances,
a is a symmetric matrix;
Figure 353843DEST_PATH_IMAGE002
(ii) a f (x, y, z) vertex coordinates at which extrema are obtained
Figure 664739DEST_PATH_IMAGE003
In a collapsed position.
3. The method of optimizing a pre-rendering lightweight mesh for a three-dimensional scene as recited in claim 2, wherein said step 3 comprises:
step 31: obtaining a distance square sum value of each edge of the three-dimensional model to be optimized according to the collapse positions and the plane information of the plane where each triangle is located, wherein one collapse position is used for solving a distance square sum value;
step 32: and acquiring the collapse position corresponding to the minimum distance sum of squares value in each distance sum of squares value as the optimal collapse position.
4. The method of optimizing the pre-rendering lightweight mesh for a three-dimensional scene of claim 3, wherein the step 31 obtains the sum of squared distances using the following formula:
Figure 591107DEST_PATH_IMAGE004
(ii) a Wherein the content of the first and second substances,
L 2 is the sum of squares of the distances,
Figure 671058DEST_PATH_IMAGE005
Is the transposition of V, V is a collapse position,
Figure 775411DEST_PATH_IMAGE006
Is a symmetric matrix, is recorded as
Figure 308024DEST_PATH_IMAGE007
5. The method of optimizing a pre-rendering lightweight mesh for a three-dimensional scene of claim 4, wherein said step 4 comprises:
step 41: acquiring the position information of each edge of each triangle;
step 42: respectively setting a connection relation set for each endpoint of each edge, wherein each connection relation set comprises an endpoint and a triangle having a connection relation with the endpoint;
step 43: obtaining an edge corresponding to the optimal collapse position according to the optimal collapse position, wherein the edge is called a collapse edge to be collapsed;
step 44: two end points of the edge to be collapsed collapse to the optimal collapse position, so that an optimal collapse point is formed;
step 45: acquiring triangles with connection relations with two end points of the side to be collapsed respectively through the connection relation set;
step 46: and connecting each triangle which has a connection relation with two end points of the edge to be collapsed with the optimal collapse point.
6. The method of optimizing a three-dimensional scene pre-rendering lightweight mesh of claim 5, wherein after completing step 4, the method of optimizing a three-dimensional scene pre-rendering lightweight mesh further comprises:
and repeating the step 3 and the step 4 until a preset condition is reached.
7. The method of optimizing a pre-rendering lightweight mesh for a three-dimensional scene of claim 6, wherein the predetermined condition is:
each distance sum of squares value in the step 31 is greater than a preset threshold value.
8. An optimization apparatus for a three-dimensional scene pre-rendering lightweight mesh, the optimization apparatus comprising:
the plane information acquisition module is used for acquiring plane information of a plane where each triangle in the three-dimensional model to be optimized is located;
the collapse position obtaining module is used for obtaining the collapse position of each side of the three-dimensional model to be optimized according to the plane information of the plane where each triangle is located;
the optimal collapse position selection module is used for selecting one of the collapse positions as an optimal collapse position;
and the optimization module is used for optimizing the three-dimensional model to be optimized according to the optimal collapse position, so that the number of triangles in the three-dimensional model to be optimized is reduced.
9. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor, when executing the computer program, implements a method for optimizing a pre-rendering lightweight mesh for a three-dimensional scene as recited in any one of claims 1 to 7.
10. A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, which when executed by a processor, is capable of implementing the method for optimizing a pre-rendering lightweight mesh for a three-dimensional scene as claimed in any one of claims 1 to 7.
CN202310030942.3A 2023-01-10 2023-01-10 Optimization method and device for lightweight grid before three-dimensional scene rendering Active CN115830273B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310030942.3A CN115830273B (en) 2023-01-10 2023-01-10 Optimization method and device for lightweight grid before three-dimensional scene rendering

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310030942.3A CN115830273B (en) 2023-01-10 2023-01-10 Optimization method and device for lightweight grid before three-dimensional scene rendering

Publications (2)

Publication Number Publication Date
CN115830273A true CN115830273A (en) 2023-03-21
CN115830273B CN115830273B (en) 2023-05-09

Family

ID=85520527

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310030942.3A Active CN115830273B (en) 2023-01-10 2023-01-10 Optimization method and device for lightweight grid before three-dimensional scene rendering

Country Status (1)

Country Link
CN (1) CN115830273B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117473655A (en) * 2023-12-27 2024-01-30 中国人民解放军国防科技大学 Aircraft simulation driving design method and device based on edge collapse grid optimization

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130187915A1 (en) * 2012-01-20 2013-07-25 Vangogh Imaging, Inc. Three Dimensional Data Compression
CN107247833A (en) * 2017-05-27 2017-10-13 华中科技大学 A kind of CAE mass data light weight methods under cloud computing
CN109523634A (en) * 2018-09-30 2019-03-26 先临三维科技股份有限公司 Optimize the method and device of grid
CN111868785A (en) * 2018-04-12 2020-10-30 谷歌有限责任公司 Vertex split connectivity prediction for improved progressive mesh compression
CN114677473A (en) * 2022-02-25 2022-06-28 河南中原动力智能制造有限公司 Method, device and equipment for reconstructing three-dimensional model and storage medium
CN115222879A (en) * 2022-06-22 2022-10-21 北京百度网讯科技有限公司 Model surface reduction processing method and device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130187915A1 (en) * 2012-01-20 2013-07-25 Vangogh Imaging, Inc. Three Dimensional Data Compression
CN107247833A (en) * 2017-05-27 2017-10-13 华中科技大学 A kind of CAE mass data light weight methods under cloud computing
CN111868785A (en) * 2018-04-12 2020-10-30 谷歌有限责任公司 Vertex split connectivity prediction for improved progressive mesh compression
CN109523634A (en) * 2018-09-30 2019-03-26 先临三维科技股份有限公司 Optimize the method and device of grid
CN114677473A (en) * 2022-02-25 2022-06-28 河南中原动力智能制造有限公司 Method, device and equipment for reconstructing three-dimensional model and storage medium
CN115222879A (en) * 2022-06-22 2022-10-21 北京百度网讯科技有限公司 Model surface reduction processing method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117473655A (en) * 2023-12-27 2024-01-30 中国人民解放军国防科技大学 Aircraft simulation driving design method and device based on edge collapse grid optimization
CN117473655B (en) * 2023-12-27 2024-03-15 中国人民解放军国防科技大学 Aircraft simulation driving design method and device based on edge collapse grid optimization

Also Published As

Publication number Publication date
CN115830273B (en) 2023-05-09

Similar Documents

Publication Publication Date Title
CN109064399B (en) Image super-resolution reconstruction method and system, computer device and storage medium thereof
US10863206B2 (en) Content-weighted deep residual learning for video in-loop filtering
CN107578467B (en) Three-dimensional modeling method and device for medical instrument
CN106611401B (en) Method and device for storing image in texture memory
CN115830273A (en) Optimization method and device of lightweight grid before three-dimensional scene rendering
KR101810019B1 (en) Animation data generating method, apparatus, and electronic device
CN116227209A (en) Multi-dimensional linear difference method for point cloud data, terminal equipment and storage medium
CN109377552B (en) Image occlusion calculating method, device, calculating equipment and storage medium
CN110581934A (en) Video jitter elimination method and device, terminal equipment and storage medium
CN108280135B (en) Method and device for realizing visualization of data structure and electronic equipment
CN112149745B (en) Method, device, equipment and storage medium for determining difficult example sample
CN111768353B (en) Hole filling method and device for three-dimensional model
CN113538623A (en) Method and device for determining target image, electronic equipment and storage medium
KR20130142661A (en) Apparatus and method of extracting feature information of large source image using scalar invariant feature transform algorithm
WO2021120489A1 (en) Adaptive fault tolerance processing method and system for spatial information data
CN116612223A (en) Digital twin simulation space generation method, device, computer equipment and medium
CN114119831A (en) Snow accumulation model rendering method and device, electronic equipment and readable medium
CN113570691B (en) Storage optimization method and device for voxel model and electronic equipment
CN114979592A (en) Image curved surface geometric correction method and device, electronic equipment and storage medium
CN114022649A (en) GPU-CPU (graphics processing unit-central processing unit) cooperative raster data rapid coordinate conversion method and system
CN109993689B (en) Cosmetic method and device
US20160005215A1 (en) Method and apparatus for representing cordinate values of bounding box of object
CN112837416A (en) Triangulation-based polygon rendering method and device and storage medium
CN117541744B (en) Rendering method and device for urban live-action three-dimensional image
CN115456858B (en) Image processing method, device, computer equipment and computer readable storage medium

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