CN116912416A - Face reduction method and device of three-dimensional model, electronic equipment and storage medium - Google Patents

Face reduction method and device of three-dimensional model, electronic equipment and storage medium Download PDF

Info

Publication number
CN116912416A
CN116912416A CN202310896437.7A CN202310896437A CN116912416A CN 116912416 A CN116912416 A CN 116912416A CN 202310896437 A CN202310896437 A CN 202310896437A CN 116912416 A CN116912416 A CN 116912416A
Authority
CN
China
Prior art keywords
dimensional model
target
initial
model
distance
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
CN202310896437.7A
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.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network 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 Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202310896437.7A priority Critical patent/CN116912416A/en
Publication of CN116912416A publication Critical patent/CN116912416A/en
Pending legal-status Critical Current

Links

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

Landscapes

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

Abstract

The disclosure provides a face reduction method, device, electronic equipment and storage medium of a three-dimensional model, wherein the method comprises the following steps: acquiring an initial three-dimensional model and a target three-dimensional model, wherein the initial three-dimensional model comprises a plurality of grids; the target three-dimensional model is obtained by simplifying grids of the initial three-dimensional model through a preset error measurement determining algorithm; determining a physical distance between the target three-dimensional model and the initial three-dimensional model, determining a model error metric corresponding to the target three-dimensional model, determining a face reduction distance based on the physical distance and the model error metric, and determining whether a face reduction result of the target three-dimensional model meets preset requirements based on the face reduction distance between the target three-dimensional model and the initial three-dimensional model. According to the embodiment of the disclosure, the accuracy of face reduction can be improved while the occupation of resources is reduced.

Description

Face reduction method and device of three-dimensional model, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of computers, in particular to a face reduction method of a three-dimensional model, a face reduction device of the three-dimensional model, electronic equipment and a computer readable storage medium.
Background
The level of Detail (LOD) model is a real-time three-dimensional computer graphics technology, and the basic idea is that the less an object contributes to a rendered image, the simpler the model is used to express the object, i.e. the model with different Levels of Detail can be selected to render the object according to scene requirements.
In the related art, a grid simplification method is generally sampled to obtain models with different levels of detail, however, the model simplification process can cause the shape of the model to change, so that some details of the model can be lost, and therefore, how to simplify the model and simultaneously preserve the details of the model is also one of important research contents of graphic technology.
Disclosure of Invention
The embodiment of the disclosure at least provides a face reduction method, device, electronic equipment and storage medium for a three-dimensional model, which can improve the accuracy of face reduction while reducing the occupation of resources.
The embodiment of the disclosure provides a face reduction method of a three-dimensional model, which comprises the following steps:
acquiring an initial three-dimensional model and a target three-dimensional model, wherein the initial three-dimensional model comprises a plurality of grids; the target three-dimensional model is obtained by simplifying the grids of the initial three-dimensional model through a preset error measurement determining algorithm;
Determining a physical distance between the target three-dimensional model and the initial three-dimensional model, determining a model error metric corresponding to the target three-dimensional model, and determining a face reduction distance between the target three-dimensional model and the initial three-dimensional model based on the physical distance and the model error metric; wherein the model error metric is derived based on the error metric for each mesh in the initial three-dimensional model simplification process, the physical distance being used to characterize the magnitude of shape differences between the target three-dimensional model and the initial three-dimensional model;
and determining whether a face reduction result of the target three-dimensional model meets a preset requirement or not based on the face reduction distance between the target three-dimensional model and the initial three-dimensional model.
In the embodiment of the disclosure, based on the model type and model error metric to which the target three-dimensional model belongs, determining the physical distance between the target three-dimensional model and the initial three-dimensional model, then determining the face reduction distance based on the physical distance and the model error metric, and finally judging whether the face reduction result of the target three-dimensional model meets the preset requirement according to the face reduction distance, so that the resources occupied by model rendering can be reduced, and meanwhile, determining the face reduction distance based on the physical distance and the model error metric, namely, considering the face reduction of the rendering layer and the face reduction of the physical layer, and being beneficial to improving the detail accuracy of the face reduction of the model.
In one possible implementation manner, in the case that the face reduction distance between the target three-dimensional model and the initial three-dimensional model is within a preset distance range, determining that the face reduction result of the target three-dimensional model meets the preset requirement.
In the embodiment of the disclosure, the face reduction distance is also measured through the preset distance range, so that the accuracy of judgment can be improved.
In a possible implementation manner, in a case that a face reduction distance between the target three-dimensional model and the initial three-dimensional model is not within a preset distance range, the method further includes:
adjusting the preset error metric determination algorithm, and carrying out simplification processing on the grids of the initial three-dimensional model again based on the adjusted error metric determination algorithm to obtain a new target three-dimensional model;
and taking the new target three-dimensional model as the target three-dimensional model, and executing the step of determining the model type and model error measurement to which the target three-dimensional model belongs until the face reduction distance between the target three-dimensional model and the initial three-dimensional model is within the preset distance range.
In the embodiment of the disclosure, if the subtracting face distance is not within the preset distance range, it is indicated that the subtracting face result does not meet the preset requirement, at this time, the preset error measurement determining algorithm needs to be adjusted, and the subtracting face processing is performed on the initial three-dimensional model again, that is, the subtracting face precision of the model is improved in an iterative manner.
In one possible implementation, the determining the physical distance between the target three-dimensional model and the initial three-dimensional model includes:
obtaining a model type of the target three-dimensional model;
based on the model type of the target three-dimensional model, a physical distance between the target three-dimensional model and the initial three-dimensional model is determined.
In the embodiment of the disclosure, the manner of determining the physical distance is different for different model types, so that the accuracy of the physical distance can be improved by determining the physical distance based on the model type of the target three-dimensional model.
In one possible embodiment, the model type includes a convex hull type; the determining the physical distance between the target three-dimensional model and the initial three-dimensional model based on the model type of the target three-dimensional model comprises:
and under the condition that the model type of the target three-dimensional model is the convex hull type, determining the physical distance between the target three-dimensional model and the initial three-dimensional model as zero.
In the embodiment of the disclosure, if the model type is the convex hull type, the difference between the two models on the physical level is not required to be considered, and therefore, the physical distance can be determined to be 0.
In one possible embodiment, the model type includes a concave packet type; the determining the physical distance between the target three-dimensional model and the initial three-dimensional model based on the model type of the target three-dimensional model comprises:
when the model type of the target three-dimensional model is the concave type, projecting each initial point on the initial three-dimensional model to the target three-dimensional model, determining a first distance between each initial point and a projection point falling on the target three-dimensional model according to each initial point, and generating a first physical distance based on each first distance;
projecting each target point on the target three-dimensional model onto the initial three-dimensional model, determining a second distance between the target point and a projection point falling on the initial three-dimensional model for each target point, and generating a second physical distance based on each second distance;
and determining the maximum value between the first physical distance and the second physical distance as the physical distance.
In the embodiment of the disclosure, the accuracy of the physical distance is improved by projecting each initial point on the initial three-dimensional model onto the target three-dimensional model and projecting each target point on the target three-dimensional model onto the initial three-dimensional model.
In an optional implementation manner, the determining whether the face reduction result of the target three-dimensional model meets a preset requirement based on the face reduction distance between the target three-dimensional model and the initial three-dimensional model includes:
acquiring a preset distance range;
and judging whether the face reduction distance is within the preset distance range based on a binary search method, and determining that the face reduction result of the target three-dimensional model meets the preset requirement under the condition that the face reduction distance is within the preset distance range.
In the embodiment of the disclosure, the distance value corresponding to the face reduction distance is searched in the preset distance range by a binary search method, so that the efficiency of data searching is improved.
The embodiment of the disclosure provides a face reduction device of a three-dimensional model, comprising:
the model acquisition module is used for acquiring an initial three-dimensional model and a target three-dimensional model, wherein the initial three-dimensional model comprises a plurality of grids; the target three-dimensional model is obtained by simplifying the grids of the initial three-dimensional model through a preset error measurement determining algorithm;
the distance determining module is used for determining the physical distance between the target three-dimensional model and the initial three-dimensional model and determining a model error metric corresponding to the target three-dimensional model, and determining a face reduction distance between the target three-dimensional model and the initial three-dimensional model based on the physical distance and the model error metric; wherein the model error metric is derived based on the error metric for each mesh in the initial three-dimensional model simplification process, the physical distance being used to characterize the magnitude of shape differences between the target three-dimensional model and the initial three-dimensional model;
The result determining module is used for determining whether the face reduction result of the target three-dimensional model meets the preset requirement or not based on the face reduction distance between the target three-dimensional model and the initial three-dimensional model.
In one possible implementation manner, the result determining module is specifically configured to:
and under the condition that the face reduction distance between the target three-dimensional model and the initial three-dimensional model is within a preset distance range, determining that the face reduction result of the target three-dimensional model meets the preset requirement.
In one possible implementation, the apparatus further includes an algorithm adjustment module for:
and under the condition that the face reduction distance between the target three-dimensional model and the initial three-dimensional model is not in a preset distance range, taking a new target three-dimensional model as the target three-dimensional model, and executing the step of determining the model type and the model error measurement to which the target three-dimensional model belongs until the face reduction distance between the target three-dimensional model and the initial three-dimensional model is in the preset distance range.
In one possible implementation manner, the distance determining module is specifically configured to:
obtaining a model type of the target three-dimensional model;
Based on the model type of the target three-dimensional model, a physical distance between the target three-dimensional model and the initial three-dimensional model is determined.
In one possible embodiment, the model type includes a convex hull type; the distance determining module is specifically configured to:
and under the condition that the model type of the target three-dimensional model is the convex hull type, determining the physical distance between the target three-dimensional model and the initial three-dimensional model as zero.
In one possible embodiment, the model type includes a concave packet type; the distance determining module is specifically configured to:
under the condition that the model type of the target three-dimensional model is the concave type, projecting each initial point on the initial three-dimensional model onto the target three-dimensional model, determining a first distance between the initial point and a projection point falling on the target three-dimensional model for each initial point, and generating a first physical distance based on each first distance;
projecting each target point on the target three-dimensional model onto the initial three-dimensional model, determining a second distance between the target point and a projection point falling on the initial three-dimensional model for each target point, and generating a second physical distance based on each second distance;
And determining the maximum value between the first physical distance and the second physical distance as the physical distance.
In one possible implementation manner, the result determining module is specifically configured to:
acquiring a preset distance range;
and judging whether the face reduction distance is within the preset distance range based on a binary search method, and determining that the face reduction result of the target three-dimensional model meets the preset requirement under the condition that the face reduction distance is within the preset distance range.
The embodiment of the disclosure also provides an electronic device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor in communication with the memory via the bus when the electronic device is running, the machine-readable instructions when executed by the processor performing the steps of the method of face-reduction of a three-dimensional model as described in any one of the possible embodiments above.
The disclosed embodiments also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of face reduction of a three-dimensional model described in any of the possible implementations above.
The foregoing objects, features and advantages of the disclosure will be more readily apparent from the following detailed description of the preferred embodiments taken in conjunction with the accompanying drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for the embodiments are briefly described below, which are incorporated in and constitute a part of the specification, these drawings showing embodiments consistent with the present disclosure and together with the description serve to illustrate the technical solutions of the present disclosure. It is to be understood that the following drawings illustrate only certain embodiments of the present disclosure and are therefore not to be considered limiting of its scope, for the person of ordinary skill in the art may admit to other equally relevant drawings without inventive effort.
FIG. 1 illustrates a flow chart of a method of face reduction of a three-dimensional model provided by some embodiments of the present disclosure;
FIG. 2 illustrates a schematic diagram of a model face-down management interface provided by some embodiments of the present disclosure;
FIG. 3 illustrates a flow chart of a method of determining physical distance provided by some embodiments of the present disclosure;
FIG. 4 illustrates a schematic diagram of determining a first distance provided by some embodiments of the present disclosure;
FIG. 5 illustrates a flow chart of a model face-down method of a three-dimensional model provided by other embodiments of the present disclosure;
FIG. 6 illustrates a schematic diagram of a face-subtracting apparatus for a three-dimensional model provided by some embodiments of the present disclosure;
FIG. 7 illustrates a schematic view of a face-reducing apparatus for a three-dimensional model provided by other embodiments of the present disclosure;
fig. 8 illustrates a schematic diagram of an electronic device provided by some embodiments of the present disclosure.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are only some embodiments of the present disclosure, but not all embodiments. The components of the embodiments of the present disclosure, which are generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure provided in the accompanying drawings is not intended to limit the scope of the disclosure, as claimed, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be made by those skilled in the art based on the embodiments of this disclosure without making any inventive effort, are intended to be within the scope of this disclosure.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
The term "and/or" is used herein to describe only one relationship, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist together, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
It will be appreciated that prior to using the technical solutions disclosed in the embodiments of the present disclosure, the user should be informed and authorized of the type, usage range, usage scenario, etc. of the personal information related to the present disclosure in an appropriate manner according to the relevant legal regulations.
In addition, the data (including but not limited to the data itself, the acquisition or use of the data) related to the technical scheme should conform to the requirements of corresponding laws and regulations and related regulations.
In the related art, a grid simplification method is generally sampled to obtain models with different levels of detail, however, the model simplification process can cause the shape of the model to change, so that some details of the model can be lost, and therefore, how to simplify the model and simultaneously preserve the details of the model is also one of important research contents of graphic technology.
Based on the above study, the present disclosure provides a face-subtracting method, device, electronic equipment and storage medium for a three-dimensional model, firstly, an initial three-dimensional model and a target three-dimensional model are obtained, wherein the initial three-dimensional model comprises a plurality of grids; the target three-dimensional model is obtained by simplifying the grids of the initial three-dimensional model through a preset error measurement determining algorithm; then, determining a physical distance between the target three-dimensional model and the initial three-dimensional model and determining a model error metric corresponding to the target three-dimensional model, and determining a face reduction distance between the target three-dimensional model and the initial three-dimensional model based on the physical distance and the model error metric; wherein the model error metric is derived based on the error metric for each mesh in the initial three-dimensional model simplification process, the physical distance being used to characterize the magnitude of shape differences between the target three-dimensional model and the initial three-dimensional model; and finally, determining whether a face reduction result of the target three-dimensional model meets a preset requirement or not based on the face reduction distance between the target three-dimensional model and the initial three-dimensional model.
In the embodiment of the disclosure, based on the model type and model error metric to which the target three-dimensional model belongs, determining the physical distance between the target three-dimensional model and the initial three-dimensional model, then determining the face reduction distance based on the physical distance and the model error metric, and finally judging whether the face reduction result of the target three-dimensional model meets the preset requirement according to the face reduction distance, so that the resources occupied by model rendering can be reduced, and meanwhile, determining the face reduction distance based on the physical distance and the model error metric, namely, considering the face reduction of the rendering layer and the face reduction of the physical layer, and being beneficial to improving the detail accuracy of the face reduction of the model.
For the convenience of understanding the present embodiment, first, a main body of execution of the face reduction method of the three-dimensional model provided by the embodiment of the present disclosure will be described in detail. The implementation main body of the face reduction method of the three-dimensional model provided by the embodiment of the disclosure is electronic equipment. In this embodiment, the electronic device is a server, and the server may be an independent physical server, or may be a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, cloud storage, big data, and an artificial intelligence platform. In other embodiments, the electronic device may also be a terminal device. The terminal device may be a mobile device, a user terminal, a handheld device, a computing device, a wearable device, or the like.
In other embodiments, the electronic device may also include an AR (Augmented Reality) device, a VR (Virtual Reality) device, an MR (Mixed Reality) device, or the like. For example, the AR device may be a mobile phone or a tablet computer with AR function, or may be AR glasses, which is not limited herein. Furthermore, the face reduction method of the three-dimensional model can be realized by a mode that a processor calls computer readable instructions stored in a memory.
The following describes a method for subtracting a surface of a three-dimensional model provided by an embodiment of the present application in detail with reference to the accompanying drawings. Referring to fig. 1, a flowchart of a method for subtracting a surface of a three-dimensional model according to an embodiment of the disclosure is shown, where the method includes steps S101 to S103, where:
s101, acquiring an initial three-dimensional model and a target three-dimensional model, wherein the initial three-dimensional model comprises a plurality of grids; and simplifying the grids of the initial three-dimensional model by the target three-dimensional model through a preset error measurement determining algorithm.
The initial three-dimensional model and the target three-dimensional model are hierarchical Detail (LOD) models, the principle of the LOD technology is to determine the resource allocation of object rendering according to the position and importance of the object model in a display environment, and the number of planes and the Detail of non-important objects are reduced, so that high-efficiency rendering operation is obtained.
For a virtual object, three-dimensional models with different LOD levels may be provided, where the number of meshes of the models corresponding to the different levels is different, for example, the LOD levels may include LOD0, LOD1, LOD2, LOD3, LOD4, where details of the model corresponding to LOD0 are most abundant, that is, the number of meshes of the model is the greatest, the number of meshes of the model of LOD1 level is less than the number of meshes of the model of LOD1 level, and similarly, the number of meshes of the model of LOD2 level is less than the number of meshes of the model of LOD 1.
Illustratively, the virtual object may be a virtual character, a virtual animal, or a virtual object, the virtual character may be a virtual game character or a virtual customer service, etc., and the virtual animal may include a virtual rabbit, a virtual cow, a virtual tiger, etc.; the virtual object may include a virtual table, a virtual tree, a virtual cup, etc., without limitation.
In this embodiment, the initial three-dimensional model and the target three-dimensional model are three-dimensional models of different LOD levels for the same virtual object, where the initial three-dimensional model refers to a model with the largest number of meshes, and the target three-dimensional model is obtained by simplifying the meshes of the initial three-dimensional model by a preset error metric determination algorithm, that is, the number of meshes of the model of the target three-dimensional model is smaller than that of the initial three-dimensional model.
Here, the preset error metric determination algorithm may be a quadratic error metric (Quadric Error Mactrics, QEM) algorithm, which is based on the principle that the error metric value of each grid is calculated to determine which grids in the model should be combined or deleted, so as to achieve the purpose of reducing the number of triangles of the model. The error metric is obtained by computing a quadratic function of the plane in which each grid lies, which can describe the shape and position of one grid, so that its contribution to the whole model can be estimated. In other embodiments, the preset error measurement algorithm may be other algorithms, which are not limited herein, wherein the other algorithms may include, but are not limited to, algorithms implemented by other functions such as cubic error function or hyperbolic error function, and the like.
The quadratic error function of QEM refers to the error that describes the surface points of a three-dimensional model mesh by a quadratic function. The mathematical expression is shown in formula (1):
E(p)=ap 2 +2bp+c (1)
where p is a point on the surface of the three-dimensional model mesh, a is a matrix of 3x3, b is a vector of 3x1, and c is a constant.
Specifically, when the grids of the initial three-dimensional model are subjected to simplification processing through a preset error metric determination algorithm to obtain a target three-dimensional model, the error metric of each grid of the initial three-dimensional model can be determined based on the preset error metric determination algorithm, then the target grid to be simplified is determined based on the error metric of each grid of the initial three-dimensional model, and the target grid is subjected to simplification processing based on the error metrics to obtain the target three-dimensional model.
Optionally, when determining the error metric of each grid of the initial three-dimensional model based on a preset error metric determination algorithm, the grids included in the initial three-dimensional model may be clustered first, and the error metrics may be calculated for the grids in each cluster, so, compared with a manner of simplifying the grids of the whole model, the grid simplification may be performed for each cluster, which is beneficial to improving the efficiency of grid simplification.
In the embodiment of the disclosure, a user may input a model to be subtracted (an initial three-dimensional model and a target three-dimensional model) through a model subtracting face management interface, where the number of target three-dimensional models may be one or more, for example, models of different LOD levels may be processed simultaneously.
For an example, please refer to fig. 2, which is a schematic diagram of a model face-down management interface provided for some embodiments of the present disclosure. As shown in fig. 2, the model face-reduction management interface includes a plurality of parameter information to be edited and a plurality of execution options, where the plurality of parameter information to be edited may include model information, model comparison algorithm information, face-reduction algorithm information, preset distance information, computer-side screen resolution information (pcscreen), mobile-side screen resolution information (mobile screen), iteration number, preset distance floating interval, maximum grid number, minimum grid number, and the plurality of execution options include "model comparison" execution options, "screen resolution" execution options, "grid simplification" execution options, and "restore default" execution options.
The model comparison algorithm is a process algorithm for judging whether the face reduction result of the target three-dimensional model meets the preset requirement in the embodiment of the disclosure. The face reduction algorithm information is an algorithm for performing face reduction processing on the initial three-dimensional model, and may be, for example, a QEM grid simplification algorithm, and in other embodiments, may also be other algorithms, which are not limited herein.
Therefore, based on FIG. 2, the user can input the model of the surface to be subtracted in the edit box corresponding to the model information (e.g., index [0 ]). Here, a model folder may be input, where the model folder may include three-dimensional models of different LOD levels corresponding to different virtual objects, so that a subsequent step of subtracting a surface from each virtual object may be performed, so that batch processing of subtracting surfaces from models of different virtual objects may be implemented, without subtracting surfaces from each virtual object separately, and thus, efficiency of subtracting surfaces from models may be improved.
In addition, the user may edit the screen resolution information of the computer side and the screen resolution information of the mobile phone side respectively, where setting the screen resolution information may refer to setting a switching distance of a model of different LOD levels under any screen resolution, where a preset correspondence exists between the switching distance and the set screen resolution information, and the correspondence may refer to a scaling ratio, for example, the scaling ratio between the switching distance and the set screen resolution information may be 100:1. it should be noted that, the setting of the screen resolution (for example 1080×960) may be configured in advance in the project setting of the illusion engine, which is not described in detail herein, where the illusion engine is a game making engine with relatively perfect functions, and may be used for making scenes, light rendering, action shots, particle special effects, material blueprints, and the like.
The switching distances for models of different LOD levels are illustrated below.
In a virtual scene of a game, a virtual object (such as a ball) flies to a screen from a certain position at a far distance, and in the ball flying process, a model displayed is a model of an LOD3 level when the distance from the screen is 300 meters, the model is displayed after being switched from the LOD3 level to the LOD2 level when the distance from the screen is 200 meters, and the model is displayed after being switched from the LOD2 level to the LOD1 level when the distance from the screen is 100 meters.
For example, referring to fig. 2 again, if the preset screen resolution is 1920×1080 for the computer, the user can set the screen resolution information of the computer to 2.5 if the switching distance of the model of the different LOD levels is 250 meters for the computer, and further, for example, if the preset screen resolution is 1600×900, the user can set the screen resolution information of the computer to 3 if the switching distance of the model of the different LOD levels is 300 meters for the computer; similarly, if the preset screen resolution of the mobile phone terminal is 1080×720, the user can set the screen resolution information of the computer terminal to 0.5 if the switching distance of the models with different LOD levels is 50 meters according to the screen resolution.
It should be noted that, for different screen resolutions, the switching distance for the same model may be the same or different, and may be set according to actual requirements.
According to the embodiment, since the models of different LOD levels corresponding to different virtual objects can be obtained simultaneously when the models are obtained, batch setting of the screen resolution information can be realized for any screen resolution without setting the models of each virtual object under each screen resolution, so that time can be saved, and the efficiency of game development can be improved.
S102, determining a physical distance between the target three-dimensional model and the initial three-dimensional model and determining a model error metric corresponding to the target three-dimensional model, and determining a face reduction distance between the target three-dimensional model and the initial three-dimensional model based on the physical distance and the model error metric; wherein the model error metric is derived based on the error metric for each mesh in the initial three-dimensional model reduction process, and the physical distance is used to characterize the magnitude of shape differences between the target three-dimensional model and the initial three-dimensional model.
Here, the physical distance may be used to represent a distance between the target three-dimensional model and the initial three-dimensional model on a physical level, specifically, a distance between a point on the target three-dimensional model and a corresponding point on the initial three-dimensional model, which is used to represent a shape difference amplitude between the target three-dimensional model and the initial three-dimensional model, for example, if the initial three-dimensional model is a cube, and the target three-dimensional model is a cube with a groove, the shape difference amplitude between the target three-dimensional model and the initial three-dimensional model needs to be represented by the physical distance.
Optionally, when determining the physical distance, it may be determined, for each point on the target three-dimensional model, whether the point can find a corresponding point on the initial three-dimensional model, if so, it is considered that there is no physical distance between the two points, and if not, it is considered that there is a physical distance between the two points, further, the physical distance may be determined based on the physical distances of the corresponding points of each pair, and a detailed process for determining the physical distance will be described in a subsequent step.
The model error metric is obtained based on the error metric of each grid in the initial three-dimensional model face-subtracting process, namely, the model error metric is a metric index on a model rendering level, so that after the face-subtracting distance between the target three-dimensional model and the initial three-dimensional model is determined based on the physical distance and the model error metric, the face-subtracting distance can simultaneously represent whether the target three-dimensional model meets preset requirements on the physical level and the rendering level.
The model error metric is obtained based on the error metric of each grid in the initial three-dimensional model subtracting process, that is, according to the foregoing embodiment, the error metric of each grid of the initial three-dimensional model may be determined based on a preset error metric determining algorithm, and then the model error metric is obtained based on the error metric of each grid.
In this embodiment, a sum of error metrics of each grid may be determined, and the determined sum may be used as the model error metric.
Optionally, in determining the physical distance between the target three-dimensional model and the initial three-dimensional model, the following steps (a) - (b) may be included:
(a) And obtaining the model type of the target three-dimensional model.
Wherein the model type includes a concave hull type or a convex hull type.
When determining the model type of the target three-dimensional model, finding out all the characteristic points of the quadric surface of the model, calculating the distance from each characteristic point to the curved surface, wherein if the distance from the characteristic point to the curved surface is smaller than or equal to the sum of the distances from the characteristic point to the adjacent characteristic points, the point is a convex point, otherwise, the point is a concave point. If all feature points are convex, the quadric is convex, i.e., the model is convex, and if any feature point is not convex, the quadric is non-convex, i.e., the model is concave.
Illustratively, the convex hull may be a cube, sphere, etc., without limitation. The recess may be a concave shape such as a concave shape obtained by arbitrarily cutting out a part of a sphere, a bowl-like shape (hollow interior), or the like, which are not shown here.
(b) Based on the model type of the target three-dimensional model, a physical distance between the target three-dimensional model and the initial three-dimensional model is determined.
In some embodiments, in a case where the model type to which the target three-dimensional model belongs is the convex hull type, a physical distance between the target three-dimensional model and the initial three-dimensional model is determined to be zero.
It can be understood that if the model type to which the target three-dimensional model belongs is the convex hull type, it is explained that the point on the corresponding model can be found in the initial three-dimensional model, and at this time, only model error measurement exists between the two models, so that it can be determined that the physical distance between the two models is zero.
In other embodiments, when determining the physical distance between the target three-dimensional model and the initial three-dimensional model based on the model type of the target three-dimensional model, please refer to fig. 3, may include S1021-S1023:
S1021, when the model type of the target three-dimensional model is the concave type, each initial point on the initial three-dimensional model is projected onto the target three-dimensional model, a first distance between the initial point and a projection point falling on the target three-dimensional model is determined for each initial point, and a first physical distance is generated based on each first distance.
Wherein the initial point refers to a point on a mesh surface on the initial three-dimensional model.
Here, when the first physical distances are generated based on the respective first distances, the respective first distances may be summed, and the resulting sum may be determined as the first physical distance.
For an example, please refer to fig. 4, which is a schematic diagram provided for some embodiments of the present disclosure for determining a first distance. Taking initial points A1 and A2 on the initial three-dimensional model a as an example, the initial points A1 and A2 are respectively projected onto the target three-dimensional model B, as shown in fig. 4, since the model a is a solid structure and the model B is provided with grooves, the initial point A1 can find a corresponding projection point B1 on the model B, and at this time, a first distance between the initial point A1 and the projection point B1 is 0.
While for the initial point A2, no corresponding point is found on the model B, it should be understood that in the face subtraction process, the model a and the model B are theoretically corresponding, for example, the model a is a solid model, then the model B should also be a similar solid model, but the mesh numbers are different, so, in order to ensure that the appearance of the models is consistent, at the same time, details need to be ensured, at this time, a projection point B2 corresponding to the initial point A2 may be found on the groove surface of the model B, and a projection point B2 'corresponding to the theoretical initial point A2 may be determined, and then a distance of a vertical dotted line h between B2 and B2' may be determined as a first distance between A2 and B2, further, the first physical distance may be generated based on the first distances corresponding to other initial points.
It should be noted that, because the number of points on the model is large, the points on the initial three-dimensional model a may be randomly sampled to obtain initial sampling points, and for the initial sampling points, a first distance between the initial sampling points and the projection points falling on the target three-dimensional model is determined, and based on each first distance, a first physical distance is generated, so that the determination efficiency of the first physical distance may be improved.
S1022, projecting each target point on the target three-dimensional model onto the initial three-dimensional model, determining a second distance between the target point and a projection point falling on the initial three-dimensional model for each target point, and generating a second physical distance based on each second distance.
Similarly, the target point refers to a point on a mesh surface on the target three-dimensional model.
In order to improve accuracy of the physical distance, similarly to the previous step, it is also necessary to project the target point on the target three-dimensional model onto the initial three-dimensional model, thereby determining second distances between the target point and the projected points falling on the initial three-dimensional model, and generating the second physical distance based on the respective second distances.
For the content of this step, please refer to the description of the above steps, and the description is omitted herein.
And S1023, determining the maximum value between the first physical distance and the second physical distance as the physical distance.
In this embodiment, the physical distance is determined based on the hausdorff (Hausdorff distance) distance, wherein Hausdorff distance measures the physical distance of two models by the following equation (2).
H(A,B)=max{D(a,B),D(A,b)} (2)
Where D (a, B) refers to the distance between the point of the sample a model and the B model, D (a, B) refers to the distance between the point of the sample B model and the a model, and the largest Hausdorff distance of D (a, B) and D (a, B) is determined, and the largest hausdorff distance is determined as the physical distance.
Here, the face-subtracting distance may be obtained by setting the respective weights for the physical distance and the model error metric, respectively, and determining a weighted sum between the physical distance and the model error metric. The weight is used for representing the physical distance and the importance degree of the model error measurement, and the value of the weight can be set according to actual requirements, which is not limited herein.
Therefore, in the embodiment of the disclosure, the subtracting face distance between the target three-dimensional model and the initial three-dimensional model is determined from the physical layer and the rendering layer, that is, based on the physical distance and the model error metric, so that the model subtracting face process can simultaneously meet the requirements of different layers (the physical layer and the rendering layer), and further the subtracting face accuracy is improved.
S103, determining whether the face reduction result of the target three-dimensional model meets the preset requirement or not based on the face reduction distance between the target three-dimensional model and the initial three-dimensional model.
It can be understood that after the face reduction distance is obtained, whether the face reduction result of the target three-dimensional model meets the preset requirement can be determined based on the face reduction distance between the target three-dimensional model and the initial three-dimensional model, wherein the preset distance range can be obtained, whether the face reduction distance is within the preset distance range is judged, if the face reduction distance is within the preset distance range, the face reduction distance meets the preset requirement, and if the face reduction distance is not, the face reduction distance does not meet the preset requirement.
Wherein the preset distance range is determined by a user. For example, referring again to fig. 2, the user may set the preset distance information to 100 and set the preset distance floating interval to 5 in the model face-reduction management interface, and the preset distance range thus obtained is [95, 105].
Alternatively, when judging whether the face reduction distance is within the preset distance range, the face reduction distance may be judged based on a binary search method (binary search), and if the face reduction distance is 500, for example, the preset distance range [95, 105] is divided into two parts [95, 100] and [100,105] averagely, the intermediate element is 100, and for the face reduction distance obtained by the next iteration, for example, 102, the face reduction distance continues to be searched in the interval of [100,105], and for the segment of [100,105], it may be determined that the face reduction result of the target three-dimensional model meets the preset requirement.
That is, in the embodiment of the present disclosure, based on the model type and the model error metric to which the target three-dimensional model belongs, the physical distance between the target three-dimensional model and the initial three-dimensional model is determined, then the plane subtraction distance is determined based on the physical distance and the model error metric, and finally whether the plane subtraction result of the target three-dimensional model meets the preset requirement is determined according to the plane subtraction distance, so that resources occupied by model rendering can be reduced, and meanwhile, the plane subtraction distance is determined based on the physical distance and the model error metric, that is, the plane subtraction of the rendering layer is considered, and the plane subtraction of the physical layer is considered, which is favorable for improving the detail accuracy of the plane subtraction of the model.
In some embodiments, the similarity between the target three-dimensional model and the initial three-dimensional model may be further determined based on the face reduction distance, for example, normalization processing may be performed on the face reduction distance, after a "model comparison" execution option is triggered in the model face reduction management interface shown in fig. 2, the similarity between the target three-dimensional model and the initial three-dimensional model may be displayed in the interface, so that it may be intuitively checked whether the difference between the two models and the current face reduction result meet the preset requirement.
It can be understood that if the face reduction result of the target three-dimensional model does not meet the preset requirement, the face reduction process needs to be performed again, and in the following, in conjunction with fig. 6, a description will be given of how to perform the face reduction process when the face reduction result of the target three-dimensional model does not meet the preset requirement.
Referring to fig. 5, a flowchart of a model face reduction method of a three-dimensional model according to other embodiments of the present disclosure is provided. As shown in fig. 5, the method includes the following steps S501 to S506:
s501, acquiring an initial three-dimensional model and a target three-dimensional model, wherein the initial three-dimensional model comprises a plurality of grids; and simplifying the grids of the initial three-dimensional model by the target three-dimensional model through a preset error measurement determining algorithm.
The content of step S501 is similar to that of step S101 in the above embodiment, and the detailed description is referred to step S101, which is not repeated here.
S502, determining a physical distance and a model error metric between the target three-dimensional model and the initial three-dimensional model, and determining a face reduction distance between the target three-dimensional model and the initial three-dimensional model based on the physical distance and the model error metric.
The content of step S502 is similar to that of step S102 in the above embodiment, and the detailed description is referred to step S102, which is not repeated here.
S503, determining whether the face reduction distance between the target three-dimensional model and the initial three-dimensional model is within a preset distance range; if yes, go to step S504, if no, go to step S505.
Wherein the preset distance range is determined by a user.
Specifically, referring to fig. 2 again, the model face-subtracting management interface includes expected error threshold information and an expected error floating interval, and the user inputs the corresponding expected error threshold and the expected error floating interval in the corresponding information editing box, where the expected error threshold may be 100 and the expected error floating interval may be 5, and thus the preset distance range is [95, 105].
S504, determining that the face reduction result of the target three-dimensional model meets the preset requirement.
It may be appreciated that, in the case that the face reduction distance between the target three-dimensional model and the initial three-dimensional model is within a preset distance range, for example, the face reduction distance is 102, 102 belongs to the range of [95, 105], and therefore, it may be determined that the face reduction result of the target three-dimensional model meets the preset requirement.
S505, the preset error metric determining algorithm is adjusted, and the grid of the initial three-dimensional model is simplified again based on the adjusted error metric determining algorithm, so that a new target three-dimensional model is obtained.
Based on the foregoing embodiment, the preset error metric determination algorithm is implemented based on the quadratic error function of QEM, where, when the preset error metric determination algorithm is adjusted, the coefficient of the quadratic error function is adjusted, that is, at least one of the coefficients a, b, and c of the quadratic error function is adjusted, and the mesh of the initial three-dimensional model is subjected to simplification processing again based on the adjusted error metric determination algorithm, that is, the error metric of each mesh of the initial three-dimensional model may be redetermined, and then, a new target mesh to be simplified is determined based on the redetermined error metric of each mesh/mesh of the initial three-dimensional model, and the new target mesh is subjected to simplification processing based on the new error metric, so as to obtain a new target three-dimensional model.
S506, taking the new target three-dimensional model as the target three-dimensional model, and returning to the step S502.
It may be appreciated that after the new target three-dimensional model is obtained, the new target three-dimensional model may be used as the target three-dimensional model, and the step S502 may be returned to, that is, the determination of the model type and the model error metric to which the target three-dimensional model belongs and the subsequent steps may be continuously performed until the face reduction result of the target three-dimensional model meets the preset requirement, that is, until the face reduction distance between the target three-dimensional model and the initial three-dimensional model is within the preset distance range.
In the embodiment of the disclosure, for the case that the face reduction result of the target three-dimensional model does not meet the preset requirement, the error metric determination algorithm is adjusted by the iterative algorithm, so that the face reduction accuracy of the target three-dimensional model can be improved, and the details of the model can be kept.
In addition, it should be noted that the method described in the foregoing embodiment may be packaged in the form of a plug-in, and the plug-in can be applied to a fantasy Engine (un real Engine), and the description about the fantasy Engine has been described in the foregoing, which is not repeated herein.
It will be appreciated by those skilled in the art that in the above-described method of the specific embodiments, the written order of steps is not meant to imply a strict order of execution but rather should be construed according to the function and possibly inherent logic of the steps.
Based on the same inventive concept, the embodiment of the disclosure further provides a surface reduction device of the three-dimensional model corresponding to the surface reduction method of the three-dimensional model, and since the principle of solving the problem by the device in the embodiment of the disclosure is similar to that of the surface reduction method of the three-dimensional model in the embodiment of the disclosure, the implementation of the device can refer to the implementation of the method, and the repetition is omitted.
Referring to fig. 6, a schematic diagram of a surface-reducing device 600 for a three-dimensional model according to an embodiment of the disclosure is shown, where the device includes:
a model obtaining module 601, configured to obtain an initial three-dimensional model and a target three-dimensional model, where the initial three-dimensional model includes a plurality of grids; the target three-dimensional model is obtained by simplifying the grids of the initial three-dimensional model through a preset error measurement determining algorithm;
a distance determining module 602, configured to determine a physical distance between the target three-dimensional model and the initial three-dimensional model, determine a model error metric corresponding to the target three-dimensional model, and determine a face-subtracting distance between the target three-dimensional model and the initial three-dimensional model based on the physical distance and the model error metric; wherein the model error metric is derived based on the error metric for each mesh in the initial three-dimensional model simplification process, the physical distance being used to characterize the magnitude of shape differences between the target three-dimensional model and the initial three-dimensional model;
The result determining module 603 is configured to determine whether a subtraction result of the target three-dimensional model meets a preset requirement based on a subtraction distance between the target three-dimensional model and the initial three-dimensional model.
In one possible implementation, the result determining module 603 is specifically configured to:
and under the condition that the face reduction distance between the target three-dimensional model and the initial three-dimensional model is within a preset distance range, determining that the face reduction result of the target three-dimensional model meets the preset requirement.
Referring to fig. 7, a schematic diagram of another three-dimensional model surface-reducing device 600 according to an embodiment of the disclosure is provided, where the device further includes an algorithm adjustment module 604, where the algorithm adjustment module 604 is configured to:
and under the condition that the face reduction distance between the target three-dimensional model and the initial three-dimensional model is not in a preset distance range, taking a new target three-dimensional model as the target three-dimensional model, and executing the step of determining the model type and the model error measurement to which the target three-dimensional model belongs until the face reduction distance between the target three-dimensional model and the initial three-dimensional model is in the preset distance range.
In one possible implementation, the distance determining module 602 is specifically configured to:
Obtaining a model type of the target three-dimensional model;
based on the model type of the target three-dimensional model, a physical distance between the target three-dimensional model and the initial three-dimensional model is determined.
In one possible embodiment, the model type includes a convex hull type; the distance determining module 602 is specifically configured to:
and under the condition that the model type of the target three-dimensional model is the convex hull type, determining the physical distance between the target three-dimensional model and the initial three-dimensional model as zero.
In one possible embodiment, the model type includes a concave packet type; the distance determining module 602 is specifically configured to:
under the condition that the model type of the target three-dimensional model is the concave type, projecting each initial point on the initial three-dimensional model onto the target three-dimensional model, determining a first distance between the initial point and a projection point falling on the target three-dimensional model for each initial point, and generating a first physical distance based on each first distance;
projecting each target point on the target three-dimensional model onto the initial three-dimensional model, determining a second distance between the target point and a projection point falling on the initial three-dimensional model for each target point, and generating a second physical distance based on each second distance;
And determining the maximum value between the first physical distance and the second physical distance as the physical distance.
In one possible implementation, the result determining module 603 is specifically configured to:
acquiring a preset distance range;
and judging whether the face reduction distance is within the preset distance range based on a binary search method, and determining that the face reduction result of the target three-dimensional model meets the preset requirement under the condition that the face reduction distance is within the preset distance range.
The process flow of each module in the apparatus and the interaction flow between the modules may be described with reference to the related descriptions in the above method embodiments, which are not described in detail herein.
Based on the same technical concept, the embodiment of the disclosure also provides electronic equipment. Referring to fig. 8, a schematic structural diagram of an electronic device 800 according to an embodiment of the disclosure includes a processor 801, a memory 802, and a bus 803. The memory 802 is used for storing execution instructions, including a memory 8021 and an external memory 8022; the memory 8021 is also referred to as an internal memory, and is used for temporarily storing operation data in the processor 801 and data exchanged with an external memory 8022 such as a hard disk, and the processor 801 exchanges data with the external memory 8022 via the memory 8021.
In the embodiment of the present application, the memory 802 is specifically configured to store application program codes for executing the scheme of the present application, and the processor 801 controls the execution. That is, when the electronic device 800 is operating, communication between the processor 801 and the memory 802 via the bus 803 causes the processor 801 to execute the application code stored in the memory 802, thereby performing the methods described in any of the preceding embodiments.
The Memory 802 may be, but is not limited to, a random access Memory (Random Access Memory, RAM), a Read Only Memory (ROM), a programmable Read Only Memory (Programmable Read-Only Memory, PROM), an erasable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), an electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.
The processor 801 may be an integrated circuit chip with signal processing capabilities. The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It should be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation on the electronic device 800. In other embodiments of the application, electronic device 800 may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The disclosed embodiments also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of subtracting faces of a three-dimensional model in the method embodiments described above. Wherein the storage medium may be a volatile or nonvolatile computer readable storage medium.
The embodiments of the present disclosure further provide a computer program product, where the computer program product carries a program code, where instructions included in the program code may be used to perform a step of subtracting a surface of a three-dimensional model in the above method embodiments, and specifically refer to the above method embodiments, which are not described herein again.
Wherein the above-mentioned computer program product may be realized in particular by means of hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied as a computer storage medium, and in another alternative embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), or the like.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system and apparatus may refer to corresponding procedures in the foregoing method embodiments, which are not described herein again. In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present disclosure may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer readable storage medium executable by a processor. Based on such understanding, the technical solution of the present disclosure may be embodied in essence or a part contributing to the prior art or a part of the technical solution, or in the form of a software product stored in a storage medium, including several instructions for causing an electronic device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk.
Finally, it should be noted that: the foregoing examples are merely specific embodiments of the present disclosure, and are not intended to limit the scope of the disclosure, but the present disclosure is not limited thereto, and those skilled in the art will appreciate that while the foregoing examples are described in detail, it is not limited to the disclosure: any person skilled in the art, within the technical scope of the disclosure of the present disclosure, may modify or easily conceive changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features thereof; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the disclosure, and are intended to be included within the scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (10)

1. A method for subtracting a surface of a three-dimensional model, comprising:
acquiring an initial three-dimensional model and a target three-dimensional model, wherein the initial three-dimensional model comprises a plurality of grids; the target three-dimensional model is obtained by simplifying the grids of the initial three-dimensional model through a preset error measurement determining algorithm;
determining a physical distance between the target three-dimensional model and the initial three-dimensional model, determining a model error metric corresponding to the target three-dimensional model, and determining a face reduction distance between the target three-dimensional model and the initial three-dimensional model based on the physical distance and the model error metric; wherein the model error metric is derived based on the error metric for each mesh in the initial three-dimensional model simplification process, the physical distance being used to characterize the magnitude of shape differences between the target three-dimensional model and the initial three-dimensional model;
and determining whether a face reduction result of the target three-dimensional model meets a preset requirement or not based on the face reduction distance between the target three-dimensional model and the initial three-dimensional model.
2. The method according to claim 1, wherein in case the face reduction distance between the target three-dimensional model and the initial three-dimensional model is within a preset distance range, it is determined that the face reduction result of the target three-dimensional model meets the preset requirement.
3. The method of claim 1, wherein in the event that the face-subtracting distance between the target three-dimensional model and the initial three-dimensional model is not within a preset distance range, the method further comprises:
adjusting the preset error metric determination algorithm, and carrying out simplification processing on the grids of the initial three-dimensional model again based on the adjusted error metric determination algorithm to obtain a new target three-dimensional model;
and taking the new target three-dimensional model as the target three-dimensional model, and executing the step of determining the model type and model error measurement to which the target three-dimensional model belongs until the face reduction distance between the target three-dimensional model and the initial three-dimensional model is within the preset distance range.
4. A method according to any one of claims 1-3, wherein said determining a physical distance between said target three-dimensional model and said initial three-dimensional model comprises:
obtaining a model type of the target three-dimensional model;
based on the model type of the target three-dimensional model, a physical distance between the target three-dimensional model and the initial three-dimensional model is determined.
5. The method of claim 4, wherein the model type comprises a convex hull type; the determining the physical distance between the target three-dimensional model and the initial three-dimensional model based on the model type of the target three-dimensional model comprises:
And under the condition that the model type of the target three-dimensional model is the convex hull type, determining the physical distance between the target three-dimensional model and the initial three-dimensional model as zero.
6. The method of claim 4, wherein the model type comprises a concave packet type; the determining the physical distance between the target three-dimensional model and the initial three-dimensional model based on the model type of the target three-dimensional model comprises:
under the condition that the model type of the target three-dimensional model is the concave type, projecting each initial point on the initial three-dimensional model onto the target three-dimensional model, determining a first distance between the initial point and a projection point falling on the target three-dimensional model for each initial point, and generating a first physical distance based on each first distance;
projecting each target point on the target three-dimensional model onto the initial three-dimensional model, determining a second distance between the target point and a projection point falling on the initial three-dimensional model for each target point, and generating a second physical distance based on each second distance;
and determining the maximum value between the first physical distance and the second physical distance as the physical distance.
7. The method of claim 1, wherein determining whether the face reduction result of the target three-dimensional model meets a preset requirement based on the face reduction distance between the target three-dimensional model and the initial three-dimensional model comprises:
acquiring a preset distance range;
and judging whether the face reduction distance is within the preset distance range based on a binary search method, and determining that the face reduction result of the target three-dimensional model meets the preset requirement under the condition that the face reduction distance is within the preset distance range.
8. A face-subtracting device for a three-dimensional model, comprising:
the model acquisition module is used for acquiring an initial three-dimensional model and a target three-dimensional model, wherein the initial three-dimensional model comprises a plurality of grids; the target three-dimensional model is obtained by simplifying the grids of the initial three-dimensional model through a preset error measurement determining algorithm;
the distance determining module is used for determining the physical distance between the target three-dimensional model and the initial three-dimensional model and determining a model error metric corresponding to the target three-dimensional model, and determining a face reduction distance between the target three-dimensional model and the initial three-dimensional model based on the physical distance and the model error metric; wherein the model error metric is derived based on the error metric for each mesh in the initial three-dimensional model simplification process, the physical distance being used to characterize the magnitude of shape differences between the target three-dimensional model and the initial three-dimensional model;
The result determining module is used for determining whether the face reduction result of the target three-dimensional model meets the preset requirement or not based on the face reduction distance between the target three-dimensional model and the initial three-dimensional model.
9. An electronic device, comprising: a processor, a memory and a bus, said memory storing machine-readable requests executable by said processor, said processor and said memory communicating over the bus when the electronic device is running, said machine-readable requests when executed by said processor performing the steps of the method of face reduction of a three-dimensional model according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps of the method of subtracting faces of a three-dimensional model as claimed in any one of claims 1 to 7.
CN202310896437.7A 2023-07-20 2023-07-20 Face reduction method and device of three-dimensional model, electronic equipment and storage medium Pending CN116912416A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310896437.7A CN116912416A (en) 2023-07-20 2023-07-20 Face reduction method and device of three-dimensional model, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310896437.7A CN116912416A (en) 2023-07-20 2023-07-20 Face reduction method and device of three-dimensional model, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116912416A true CN116912416A (en) 2023-10-20

Family

ID=88352657

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310896437.7A Pending CN116912416A (en) 2023-07-20 2023-07-20 Face reduction method and device of three-dimensional model, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116912416A (en)

Similar Documents

Publication Publication Date Title
CN109523621B (en) Object loading method and device, storage medium and electronic device
US20190251657A1 (en) Method for detecting collision between cylindrical collider and convex body in real-time virtual scenario, terminal, and storage medium
CN111815755A (en) Method and device for determining shielded area of virtual object and terminal equipment
KR20160127030A (en) View independent 3d scene texturing
CN114187633B (en) Image processing method and device, and training method and device for image generation model
US9123162B2 (en) Integration cone tracing
Overbeck et al. A real-time beam tracer with application to exact soft shadows
CN111598986B (en) Virtual fluid surface rendering method, device, equipment and storage medium
CN113628317A (en) Rendering method, device and system
CN115082611B (en) Illumination rendering method, apparatus, device and medium
WO2023124676A1 (en) 3d model construction method, apparatus, and electronic device
CN114299220A (en) Data generation method, device, equipment, medium and program product of illumination map
CN109377552B (en) Image occlusion calculating method, device, calculating equipment and storage medium
CN114596401A (en) Rendering method, device and system
CN116993955A (en) Three-dimensional model heavy topology method, device, equipment and storage medium
US20140267357A1 (en) Adaptive importance sampling for point-based global illumination
CN111476872B (en) Image drawing method and image drawing device
CN116912416A (en) Face reduction method and device of three-dimensional model, electronic equipment and storage medium
US10861174B2 (en) Selective 3D registration
JP2015022761A (en) Image processing apparatus and method
CN114299216A (en) Method and device for determining light map resolution, electronic equipment and storage medium
WO2024109006A1 (en) Light source elimination method and rendering engine
Fu et al. Dynamic shadow rendering with shadow volume optimization
CN116824082B (en) Virtual terrain rendering method, device, equipment, storage medium and program product
Wang et al. Intermediate shadow maps for interactive many-light rendering

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