CN115222867A - Overlap detection method, overlap detection device, electronic equipment and storage medium - Google Patents

Overlap detection method, overlap detection device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115222867A
CN115222867A CN202210778651.8A CN202210778651A CN115222867A CN 115222867 A CN115222867 A CN 115222867A CN 202210778651 A CN202210778651 A CN 202210778651A CN 115222867 A CN115222867 A CN 115222867A
Authority
CN
China
Prior art keywords
processed
target array
dimensional texture
target
vertex
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
CN202210778651.8A
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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202210778651.8A priority Critical patent/CN115222867A/en
Publication of CN115222867A publication Critical patent/CN115222867A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Graphics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Geometry (AREA)
  • Multimedia (AREA)
  • Software Systems (AREA)
  • Image Generation (AREA)

Abstract

The embodiment of the application discloses an overlap detection method, an overlap detection device, electronic equipment and a storage medium. The method comprises the following steps: acquiring two-dimensional texture coordinates of the vertex of each polygonal surface in a surface expansion diagram of the three-dimensional model under a two-dimensional texture coordinate system; obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located based on the two-dimensional texture coordinates of the vertexes and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system; and obtaining the overlapping detection result of the surface development graph according to the number of the polygonal surfaces where the position coordinates of the target array elements are located. The embodiment of the application can improve the overlapping detection efficiency and reduce the detection cost.

Description

Overlap detection method, overlap detection device, electronic equipment and storage medium
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an overlap detection method, an overlap detection apparatus, an electronic device, and a storage medium.
Background
In the process of game development, three-dimensional models related to games are required to be made in digital asset creation software, and then are imported into a game engine, so that the manufactured three-dimensional models are placed in game stages, and the purpose of editing game scenes is achieved.
In the process of manufacturing the three-dimensional model, the three-dimensional model needs to be mapped, which is equivalent to wearing beautiful clothes on the three-dimensional model, and how to correctly map the three-dimensional model needs to depend on two-dimensional texture coordinates.
Sometimes, however, the mapper may overlap the two-dimensional texture coordinates due to errors and/or irregular operation, as shown in fig. 1.
The overlap of the two-dimensional texture coordinates may render the "clothing" of the three-dimensional model less than ideal. For example, a cube model is covered by a plurality of triangular faces, as shown in fig. 2, the ideal effect is that each triangular face of the cube model has a different color, but because two-dimensional texture coordinates overlap, when the two-dimensional texture coordinate system is used to color each triangular face, the overlapped part of the two triangular faces will appear mixed color, so that the "clothes" of the cube model cannot achieve the ideal effect, and therefore, it is necessary to perform overlap detection on the two-dimensional texture coordinates.
The existing overlap detection method is mainly checked by naked eyes or by means of 3dsMax software capable of performing two-dimensional texture coordinate overlap detection. However, in many cases, because the triangular surface of the three-dimensional model is very small, it is difficult for the naked eye to see whether the two-dimensional texture coordinate overlapping occurs, and thus, the detection of the overlapping of the two-dimensional texture coordinate by the naked eye has the problems of low precision and low efficiency. If the 3dsMax software is used for the overlapping detection of two-dimensional texture coordinates, the relevant personnel are required to firstly download and learn to use the 3dsMax software. In conclusion, the technical problems of low efficiency and high cost of two-dimensional texture coordinate overlapping detection exist in the prior art.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The embodiment of the application provides an overlap detection method, an overlap detection device, electronic equipment and a storage medium, which can improve the overlap detection efficiency and reduce the detection cost.
The embodiment of the application provides an overlap detection method, which comprises the following steps:
acquiring two-dimensional texture coordinates of the vertex of each polygonal surface in a surface expansion diagram of the three-dimensional model under a two-dimensional texture coordinate system;
based on the two-dimensional texture coordinates of the vertexes and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system, obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located;
and obtaining the overlapping detection result of the surface development graph according to the number of the polygonal surfaces where the position coordinates of the target array elements are located.
Optionally, the obtaining, based on the two-dimensional texture coordinates of the vertex and the position coordinates of the target array element in the target array in the two-dimensional texture coordinate system, the number of polygonal faces where the position coordinates of the target array element are located includes:
for a polygon surface to be processed in each polygon surface, determining whether the position coordinates of a target array element in the target array are in the polygon surface to be processed or not according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the position coordinates of the target array element in the target array in a two-dimensional texture coordinate system;
updating the current element value of the target array element of the position coordinate in the polygon surface to be processed until the polygon surface to be processed does not include the polygon surface to be processed, and obtaining the target element value of the target array element in the target array; the current element value is obtained when the previous polygon surface to be processed is processed;
and obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located according to the target element values of the target array elements in the target array.
Optionally, the determining, according to the two-dimensional texture coordinates of the vertex of the polygon to be processed and the position coordinates of the target array element in the target array in the two-dimensional texture coordinate system, whether the position coordinates of the target array element are within the polygon to be processed includes:
obtaining a vertex element vector between the vertex of the polygon surface to be processed and a target array element in the target array based on the two-dimensional texture coordinate of the vertex of the polygon surface to be processed and the position coordinate of the target array element in the two-dimensional texture coordinate system;
and determining whether the position coordinates of the target array element are in the polygon surface to be processed according to the vertex element vector between the vertex of the polygon surface to be processed and the target array element.
Optionally, the determining, according to the two-dimensional texture coordinates of the vertex of the polygon to be processed and the position coordinates of the target array element in the target array in the two-dimensional texture coordinate system, whether the position coordinates of the target array element are within the polygon to be processed includes:
obtaining the vertex coordinates of an enclosure box enclosing the polygonal surface to be processed according to the two-dimensional texture coordinates of the vertex of the polygonal surface to be processed;
determining whether the position coordinates of the target array elements are in the bounding box or not according to the vertex coordinates of the bounding box and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system; obtaining a vertex element vector between the vertex of the polygon surface to be processed and a target array element according to the two-dimensional texture coordinate of the vertex of the polygon surface to be processed and the position coordinate of the target array element for the target array element with the position coordinate in the bounding box;
and determining whether the position coordinates of the target array element are in the polygon surface to be processed according to the vertex element vector between the vertex of the polygon surface to be processed and the target array element.
Optionally, the obtaining, based on the two-dimensional texture coordinates of the vertex and the position coordinates of the target array element in the target array in the two-dimensional texture coordinate system, the number of polygonal faces where the position coordinates of the target array element are located includes:
for a polygon surface to be processed in each polygon surface, determining whether the position coordinates of the preliminary array elements are in the polygon surface to be processed or not according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the position coordinates of the preliminary array elements in the preliminary array in a two-dimensional texture coordinate system; the target array is constructed according to a first resolution, the preliminary array is constructed according to a second resolution, the first resolution is a target multiple of the second resolution, and the target multiple is an integer greater than 1;
according to the target times, carrying out subdivision processing on preliminary array elements of the position coordinates in the polygonal surface to be processed to obtain first target array elements corresponding to the preliminary array elements in the target array;
determining whether the position coordinates of the first target array elements are in the polygon surface to be processed, and updating the current element values of the first target array elements of which the position coordinates are in the polygon surface to be processed until each polygon surface does not include the polygon surface to be processed, so as to obtain the target element values of the target array elements in the target array; the current element value is obtained when the previous polygon surface to be processed is processed;
and obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located according to the target element values of the target array elements in the target array.
Optionally, the determining, according to the two-dimensional texture coordinates of the vertex of the polygon to be processed and the position coordinates of the preliminary array element in the preliminary array in the two-dimensional texture coordinate system, whether the position coordinates of the preliminary array element are within the polygon to be processed includes:
according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the offset value corresponding to the preliminary array, offsetting the polygon surface to be processed to obtain an offset surface corresponding to the polygon surface to be processed;
and determining whether the position coordinates of the preliminary array elements are on the offset surface or not based on the two-dimensional texture coordinates of the vertexes of the offset surface and the position coordinates of the preliminary array elements in the preliminary array in the two-dimensional texture coordinate system.
Optionally, the polygonal faces are triangular faces; the step of offsetting the polygon surfaces to be processed according to the two-dimensional texture coordinates of the vertexes of the polygon surfaces to be processed and the offset value corresponding to the preliminary array to obtain an offset surface corresponding to the polygon surfaces to be processed includes:
obtaining a two-dimensional texture coordinate of the inner center of the polygon surface to be processed according to the two-dimensional texture coordinate of the vertex of the polygon surface to be processed;
and offsetting the polygon surface to be processed according to the two-dimensional texture coordinates of the inner center of the polygon surface to be processed and the offset value corresponding to the preliminary array to obtain an offset surface corresponding to the polygon surface to be processed.
Optionally, the determining whether the position coordinate of the preliminary array element is on the offset surface based on the two-dimensional texture coordinate of the vertex of the offset surface and the position coordinate of the preliminary array element in the preliminary array in the two-dimensional texture coordinate system includes:
obtaining the vertex coordinates of a bounding box surrounding the offset surface based on the two-dimensional texture coordinates of the vertex of the offset surface;
obtaining a preliminary array element of the position coordinate in the bounding box based on the vertex coordinate of the bounding box;
and determining whether the position coordinates of the preliminary array element are in the offset plane or not based on the two-dimensional texture coordinates of the vertex of the offset plane and the position coordinates of the preliminary array element in the bounding box.
Optionally, the obtaining, according to the number of polygon surfaces where the position coordinates of the target array element are located, an overlap detection result of the surface development graph includes:
and if the number of the polygonal surfaces where the position coordinates of the target array elements are located is greater than or equal to a preset value, determining that the polygonal surfaces including the position coordinates in the surface development graph are overlapped.
An embodiment of the present application further provides an overlap detection device, including:
the acquisition unit is used for acquiring two-dimensional texture coordinates of the vertex of each polygonal surface in the surface expansion image of the three-dimensional model under a two-dimensional texture coordinate system;
the quantity unit is used for obtaining the quantity of polygonal surfaces where the position coordinates of the target array elements are located based on the two-dimensional texture coordinates of the vertexes and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system;
and the detection unit is used for obtaining the overlapping detection result of the surface development graph according to the number of the polygonal surfaces where the position coordinates of the target array elements are located.
Optionally, the number unit is further configured to:
for a polygon surface to be processed in each polygon surface, determining whether the position coordinates of a target array element in the target array are in the polygon surface to be processed according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the position coordinates of the target array element in the target array in a two-dimensional texture coordinate system;
updating the current element value of the target array element of the position coordinate in the polygon surface to be processed until the polygon surface to be processed does not include the polygon surface to be processed, and obtaining the target element value of the target array element in the target array; the current element value is obtained when the previous polygon surface to be processed is processed;
and obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located according to the target element values of the target array elements in the target array.
Optionally, the number unit is further configured to:
obtaining a vertex element vector between the vertex of the polygon surface to be processed and a target array element in the target array based on the two-dimensional texture coordinate of the vertex of the polygon surface to be processed and the position coordinate of the target array element in the two-dimensional texture coordinate system;
and determining whether the position coordinates of the target array element are in the polygon surface to be processed according to the vertex element vector between the vertex of the polygon surface to be processed and the target array element.
Optionally, the number unit is further configured to:
obtaining the vertex coordinates of an enclosure box enclosing the polygonal surface to be processed according to the two-dimensional texture coordinates of the vertex of the polygonal surface to be processed;
determining whether the position coordinates of the target array elements are in the bounding box or not according to the vertex coordinates of the bounding box and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system; obtaining a vertex element vector between the vertex of the polygon surface to be processed and a target array element according to the two-dimensional texture coordinate of the vertex of the polygon surface to be processed and the position coordinate of the target array element for the target array element with the position coordinate in the bounding box;
and determining whether the position coordinates of the target array element are in the polygon surface to be processed according to the vertex element vector between the vertex of the polygon surface to be processed and the target array element.
Optionally, the number unit is further configured to:
for a polygon surface to be processed in each polygon surface, determining whether the position coordinates of the preliminary array elements are in the polygon surface to be processed or not according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the position coordinates of the preliminary array elements in the preliminary array in a two-dimensional texture coordinate system; the target array is constructed according to a first resolution, the preliminary array is constructed according to a second resolution, the first resolution is a target multiple of the second resolution, and the target multiple is an integer greater than 1;
according to the target times, carrying out subdivision processing on preliminary array elements of the position coordinates in the polygonal surface to be processed to obtain first target array elements corresponding to the preliminary array elements in the target array;
determining whether the position coordinates of the first target array elements are in the polygon surface to be processed, and updating the current element values of the first target array elements of which the position coordinates are in the polygon surface to be processed until each polygon surface does not include the polygon surface to be processed, so as to obtain the target element values of the target array elements in the target array; the current element value is obtained when the previous polygon surface to be processed is processed;
and obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located according to the target element values of the target array elements in the target array.
Optionally, the number unit is further configured to:
according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the offset value corresponding to the preliminary array, offsetting the polygon surface to be processed to obtain an offset surface corresponding to the polygon surface to be processed;
and determining whether the position coordinates of the preliminary array elements are on the offset surface or not based on the two-dimensional texture coordinates of the vertexes of the offset surface and the position coordinates of the preliminary array elements in the preliminary array in the two-dimensional texture coordinate system.
Optionally, the polygonal faces are triangular faces; the quantity unit is further to:
obtaining a two-dimensional texture coordinate of the inner center of the polygon surface to be processed according to the two-dimensional texture coordinate of the vertex of the polygon surface to be processed;
and according to the two-dimensional texture coordinates of the inner center of the polygon surface to be processed and the deviation value corresponding to the preliminary array, performing deviation on the polygon surface to be processed to obtain a deviation surface corresponding to the polygon surface to be processed.
Optionally, the number unit is further configured to:
obtaining the vertex coordinates of a bounding box surrounding the offset surface based on the two-dimensional texture coordinates of the vertex of the offset surface;
obtaining a preliminary array element of the position coordinate in the bounding box based on the vertex coordinate of the bounding box;
and determining whether the position coordinates of the preliminary array element are in the offset plane or not based on the two-dimensional texture coordinates of the vertex of the offset plane and the position coordinates of the preliminary array element in the bounding box.
Optionally, the detection unit is further configured to:
and if the number of the polygonal surfaces where the position coordinates of the target array elements are located is greater than or equal to a preset value, determining that the polygonal surfaces including the position coordinates in the surface development graph are overlapped.
The embodiment of the application also provides electronic equipment, which comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to perform the steps of the overlap detection method as described in any of the above embodiments:
acquiring two-dimensional texture coordinates of the vertex of each polygonal surface in a surface expansion diagram of the three-dimensional model under a two-dimensional texture coordinate system;
obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located based on the two-dimensional texture coordinates of the vertexes and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system;
and obtaining the overlapping detection result of the surface development graph according to the number of the polygonal surfaces where the position coordinates of the target array elements are located.
An embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to perform the steps in the overlap detection method according to any one of the above embodiments:
acquiring two-dimensional texture coordinates of the vertex of each polygonal surface in a surface expansion diagram of the three-dimensional model under a two-dimensional texture coordinate system;
obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located based on the two-dimensional texture coordinates of the vertexes and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system;
and obtaining the overlapping detection result of the surface development graph according to the number of the polygonal surfaces where the position coordinates of the target array elements are located.
According to the method and the device, the two-dimensional texture coordinates of the vertex of each polygonal surface in the surface development graph of the three-dimensional model are firstly obtained, then the number of the polygonal surfaces where the position coordinates of the target array elements are located is obtained based on the two-dimensional texture coordinates of the vertex and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system, and finally the overlapping detection result of the surface development graph is obtained according to the number of the polygonal surfaces where the position coordinates of the target array elements are located. It can be understood that, if the overlap occurs, a position point in the two-dimensional texture coordinate system will be in a plurality of polygon surfaces, and equivalently, if the overlap occurs, the position coordinates of the target array element will inevitably be in a plurality of polygon surfaces, and then, in the surface development diagram, the number of polygon surfaces where the position coordinates are located is detected, so that the overlap detection is realized.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic illustration of an overlay provided by an embodiment of the present application;
FIG. 2 is a schematic diagram of a cube surface covered with a plurality of triangular faces according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of an overlap detection method according to an embodiment of the present application;
FIG. 4 is a schematic illustration of an embodiment of the present application showing no overlap;
FIG. 5 is a schematic illustration of an out-of-range scenario provided by an embodiment of the present application;
FIG. 6 is a schematic diagram of a target array element O in a triangular surface ABC provided by an embodiment of the present application;
FIG. 7 is a schematic diagram of a subdivision process provided by an embodiment of the present application;
FIG. 8 is a schematic diagram of a leak provided by an embodiment of the present application;
FIG. 9 is a schematic illustration of an offset provided by an embodiment of the present application;
FIG. 10 is a diagram illustrating the setting of an offset value according to an embodiment of the present disclosure;
FIG. 11 is a schematic view of an extreme triangular face provided by an embodiment of the present application;
FIG. 12 is a schematic diagram of determining two-dimensional texture coordinates of an extended vertex according to an embodiment of the present application;
fig. 13 is a schematic flowchart of an overlap detection method according to an embodiment of the present application;
fig. 14 is a schematic flowchart of an overlap detection method according to an embodiment of the present application;
fig. 15 is a schematic structural diagram of an overlap detection apparatus according to an embodiment of the present application;
fig. 16 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 17 is a schematic structural diagram of a composition of an overlap detection system according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. 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.
The embodiment of the application provides an overlap detection method, an overlap detection device, electronic equipment and a storage medium. Specifically, the overlap detection method according to the embodiment of the present application may be executed by an electronic device, where the electronic device may be a terminal or a server. The terminal may be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a Personal Computer (PC), a Personal Digital Assistant (PDA), and the like, and may further include a client, which may be an application client, a browser client carrying overlay detection software, or an instant messaging client. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN (Content Delivery Network), big data, an artificial intelligence platform, and the like.
For example, when the overlap detection method is executed in a terminal, the terminal device may store software capable of overlap detection, for example, a game engine. The terminal device may interact with the user through the graphical user interface, e.g. the user clicks an overlap detection button of the graphical user interface, thereby performing the overlap detection method. The manner in which the terminal device provides the graphical user interface to the user may include a variety of ways, for example, the graphical user interface may be rendered for display on a display screen of the terminal device or presented by holographic projection. For example, the terminal device may include a touch display screen for presenting a graphical user interface and receiving operation instructions generated by a user acting on the graphical user interface, and a processor for executing software capable of performing overlay detection, generating the graphical user interface, responding to the operation instructions, and controlling display of the graphical user interface on the touch display screen.
Referring to fig. 17, fig. 17 is a schematic diagram of an overlay detection system according to an embodiment of the present disclosure. The system may include at least one terminal 171, at least one server 172, at least one database 173, and a network. The terminal 171 held by the user can be connected to different servers through a network. The terminal 171 is any device having computing hardware capable of supporting and executing a software product capable of piggybacking overlay detection, such as a game engine. In addition, the terminal 171 has one or more multi-touch sensitive screens for sensing and obtaining input of a user through a touch or slide operation performed at a plurality of points of one or more touch display screens. In addition, when the system includes a plurality of terminals 171, a plurality of servers 172, and a plurality of networks, different terminals 171 may be connected to each other through different networks and through different servers 172. The Network may be a Wireless Network or a wired Network, for example, the Wireless Network is a WLAN (Wireless Local Area Network), a LAN (Local Area Network), a cellular Network, a 2G Network, a 3G Network, a 4G Network, a 5G Network, or the like. In addition, different terminals 171 may be connected to other terminals or a server using their own bluetooth network or a hotspot network. In addition, the system may include a plurality of databases 173, the plurality of databases 173 being coupled to different servers 172, and the overlap detection results may be stored in the databases 173.
The embodiment of the application provides an overlap detection method, which can be executed by a terminal or a server. The embodiment of the present application is described as an example in which the overlap detection method is executed by the terminal. As shown in fig. 3, the terminal obtains two-dimensional texture coordinates of a vertex of each polygonal surface in a surface development diagram of the three-dimensional model under a two-dimensional texture coordinate system; obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located based on the two-dimensional texture coordinates of the vertexes and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system; and obtaining the overlapping detection result of the surface development graph according to the number of the polygonal surfaces where the position coordinates of the target array elements are located.
The following is a detailed description of specific embodiments.
In the present embodiment, description will be made from the perspective of an overlap detection apparatus, which may be specifically integrated in an electronic device such as a terminal or a server.
Example one
Referring to fig. 3, fig. 3 is a schematic view illustrating an implementation flow of the overlap detection method according to the present embodiment, where the overlap detection method according to the present embodiment includes steps 301 to 303. The method comprises the following specific steps:
301, obtaining two-dimensional texture coordinates of the vertex of each polygonal surface in the surface expansion diagram of the three-dimensional model under a two-dimensional texture coordinate system.
The surface development view of the three-dimensional model is a development view of the surface texture of the three-dimensional model in a two-dimensional texture coordinate system, and as shown in fig. 4, the horizontal direction of the two-dimensional texture coordinate system is represented by U, and the vertical direction is represented by V. In the case of canonical operation, the surface development should be in the range of: 0< = U < =1 and 0< = V < =1, if the operation is not normal, may cause the out-of-bounds situation of the surface deployment map to occur, as shown in fig. 5.
The polygon surface means a surface formed of a polygon, and may be, for example, a triangular surface formed of a triangle or a quadrangular surface formed of a quadrangle, and if the polygon surface is the triangular surface, the vertex of the polygon surface is the vertex of the triangle, and if the polygon surface is the quadrangular surface, the vertex of the polygon surface is the vertex of the quadrangle.
If the overlap detection method provided in this embodiment is integrated into a game Engine, for example, the illusion Engine 4 (un real Engine 4, ue4), the two-dimensional texture coordinates of the vertex can be obtained by the following method: taking rendering data staticimeshrenderrdata of the three-dimensional model editeobject through editeobject- > renderrdata. Get () for the three-dimensional model editeobject currently being edited, that is, staticimeshrenderrdata = editeobject- > renderrdata. Get (); further, a multi-Detail Level (Level of Detail, LOD) is obtained from the rendering data through statICMeshRenderData- > LODResources [ LODLevel ]; acquiring a point buffer under multiple detail levels through IndexBuffer.GetAlranyView (), which specifically comprises the following steps: point buffer IndexBuffer = staticmeshrendedrdata- > LODResources [ LODLevel ]. Indexbuffer.getarranyview (); finally, acquiring the number of vertexes of the three-dimensional model EditObject currently being edited from a point buffer area through Num (), specifically, acquiring NumIndices = IndexBuffer. And finally, for each vertex, acquiring the two-dimensional texture coordinate of the vertex through a GetVertexUV function.
Step 302, obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located based on the two-dimensional texture coordinates of the vertexes and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system.
The target array is an array pre-created based on a certain resolution, for example, the target array is an array with a size of 1024 × 1024 pre-created based on a resolution of 1024. The purpose of creating the target array is to implement overlap detection, and it is understood that if overlap occurs, a position point in the two-dimensional texture coordinate system will be in multiple polygon surfaces, and then, in order to determine which position points in the two-dimensional texture coordinate system will have overlap of polygon surfaces, the creation of the target array is selected, so that one target array element in the target array corresponds to one position point in the two-dimensional texture coordinate system.
The target array includes a plurality of target array elements. For example, the size of the target array is 1024 × 1024, and the number of target array elements is 1024 × 1024. The target array element A may be represented by A (i, j), where i may be from 1 to 1024 and j may be from 1 to 1024.
In the case of canonical operation, the surface development lies in the range: 0< = U < =1 and 0< = V < =1, then, to make the target array coverage: 0< = U < =1 and 0< = V < =1 so that overlapping polygonal faces are not missed, improving detection accuracy, and when determining the position coordinates of a target array element in a two-dimensional texture coordinate system, for example, when determining the position coordinates of a target array element a (i, j) in a two-dimensional texture coordinate system, the position coordinates should be (i/resolution of the target array, j/resolution of the target array), but cannot be determined as (i/t times resolution of the target array, r times resolution of the j/target array), where t is an integer greater than 1 and r is an integer greater than 1, and if determining the position coordinates as (i/t times resolution of the target array, r times resolution of the j/target array), then the range cannot be covered: 0< = U < =1 and 0< = V < =1, only a part of the range 0< = U < =1 and 0< = V < =1 can be covered, so that detection of overlapped polygon surfaces is omitted, and detection accuracy is lowered. For example, the target tuple element a (512, 1024), and thus the position coordinates of the target tuple element a in the two-dimensional texture coordinate system should be determined to be (0.5,1), but cannot be determined to be (0.25,0.5).
And determining the number of polygon surfaces in which the position coordinates of the target array elements are located based on the two-dimensional texture coordinates of the vertexes and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system, wherein if the position coordinates of the target array elements are located in the N polygon surfaces, the number of the polygon surfaces in which the position coordinates of the target array elements are located is N, and N is an integer greater than or equal to 1.
And step 303, obtaining an overlapping detection result of the surface expansion diagram according to the number of the polygonal surfaces where the position coordinates of the target array elements are located.
The overlap detection result of the surface development map is a result of determining whether or not a plurality of polygon faces overlap in the surface development map. Wherein the plurality includes two and more than two; the overlap includes partial overlap and complete overlap.
In one embodiment, the overlay detection result of the surface development map is represented by the overlaid target array elements, for example, the overlay detection result of the surface development map is a (m, n) -T, meaning that T polygon surfaces are overlaid at the coordinate positions of the target array element a (m, n).
In one embodiment, the overlap detection result of the surface development diagram is represented by the overlapped polygon surfaces, and for example, the overlap detection result of the surface development diagram is P1-P2-P3, which means that the polygon surface P1, the polygon surface P2, and the polygon surface P3 are overlapped.
In order to facilitate the user to view the overlapping detection results of the surface development diagrams, in one embodiment, the overlapping detection results of the surface development diagrams are displayed; in another embodiment, the overlay detection result is marked in the surface development map, for example, the coordinate position of the target array element a (m, n) in the two-dimensional texture coordinate system is marked with red.
The overlap detection method of this embodiment first obtains two-dimensional texture coordinates of a vertex of each polygon surface in a surface development graph of the three-dimensional model, then obtains the number of polygon surfaces where the position coordinates of the target array elements are located based on the two-dimensional texture coordinates of the vertex and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system, and finally obtains an overlap detection result of the surface development graph according to the number of polygon surfaces where the position coordinates of the target array elements are located. It can be understood that, if the overlap occurs, a position point in the two-dimensional texture coordinate system will be in a plurality of polygon surfaces, and equivalently, if the overlap occurs, the position coordinates of the target array element will inevitably be in a plurality of polygon surfaces, and then, in the surface development diagram, the number of polygon surfaces where the position coordinates are located is detected, so that the overlap detection is realized.
Example two
And respectively processing each polygon surface, determining whether the target array element is in the polygon surface to be processed, and if so, immediately updating the current element value of the target array element, so that the target element value of the target array element can be obtained after the processing of all the polygon surfaces is finished, and the detection of the number of the polygon surfaces where the position coordinates of the target array element are positioned is realized. Specifically, step 302 includes: step 302A through step 302C.
Step 302A, for a polygon surface to be processed in each polygon surface, determining whether the position coordinates of the target array element are in the polygon surface to be processed according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the position coordinates of the target array element in the target array in the two-dimensional texture coordinate system.
The polygon to be processed is one polygon in each polygon in the surface development diagram of the three-dimensional model, and it is not yet determined whether there is a position coordinate of the target array element in the polygon, and thus, the polygon needs to be processed.
Determining whether the position coordinates of the target array element are within the polygon plane to be processed may include: determining whether a target array element in the target array is on an edge of the polygonal surface to be processed according to the two-dimensional texture coordinate of the vertex of the polygonal surface to be processed and the position coordinate of the target array element in the target array in the two-dimensional texture coordinate system, and if the target array element is on any edge, determining that the position coordinate of the target array element is not in the polygonal surface to be processed; if the sum of the areas is equal to the area of the polygon surface to be processed, the position coordinates of the target array elements are determined to be in the polygon surface to be processed, otherwise, the position coordinates of the target array elements are determined not to be in the polygon surface to be processed. As shown in fig. 6, when the polygonal surface is a triangular surface ABC, the target array element is O, and if O is not on the side AB, the side BC, or the side AC, and S (OAB) + S (OBC) + S (OAC) = S (ABC), S (XYZ) represents the area of the triangle XYZ, the target array element O is determined to be within the triangular surface ABC. In this way, it may be determined whether the position coordinates of each target array element in the target array are within the polygon plane.
Step 302B, updating the current element values of the target array elements of the position coordinates in the polygon surface to be processed until each polygon surface does not include the polygon surface to be processed, and obtaining the target element values of the target array elements in the target array; the current element value is obtained when the last polygon to be processed is processed.
And the target element value is an element value used for determining the number of polygonal surfaces where the position coordinates of the target array elements are located.
And updating the current element value of the target array element of the position coordinate in the polygon surface to be processed, and keeping the current element value of the target array element of the position coordinate not in the polygon surface to be processed unchanged.
In one embodiment, if the initial element value is not 0, updating the current element value of the target array element whose position coordinate is within the polygon plane to be processed includes: and multiplying the current element value of the target array element of the position coordinate in the polygon surface to be processed by a first preset value. The initial element value refers to an initial element value of the target array element, that is, an element value when any polygon surface in each polygon surface in the three-dimensional model has not been processed yet.
In another embodiment, updating the current element value of the target array element with the position coordinate in the polygon plane to be processed includes: and adding a second preset value to the current element value of the target array element of the position coordinate in the polygon surface to be processed.
How to obtain the target element value is described in the following manner of updating the second preset value. For a first polygon surface to be processed in each polygon surface of the three-dimensional model, since the first polygon surface to be processed does not have a previous polygon surface to be processed corresponding to the first polygon surface, the current element value of each target array element in the target array is an initial element value, for example, the initial element value is 0, assuming that a second preset value is 1, if it is determined that the position coordinate of the target array element a is within the first polygon surface to be processed, the current element value of the target array element a is updated to be 0, and the updated value is 1 (thus, when processing a second polygon surface to be processed in each polygon surface of the three-dimensional model, the current element value of the target array element a is 1), and if it is determined that the position coordinate of the target array element B is not within the first polygon surface to be processed, the current element value of the target array element B is kept unchanged (thus, when processing a second polygon surface to be processed in each polygon surface of the three-dimensional model, the current element value of the target array element B is 0). Processing a second polygon to be processed in each polygon surface of the three-dimensional model, if the position coordinate of the target array element a is in the second polygon surface to be processed, updating the current element value 1 of the target array element a to obtain 2 (so that when processing a third polygon surface to be processed in each polygon surface of the three-dimensional model, the current element value of the target array element a is 2), if it is determined that the position coordinate of the target array element B is not in the second polygon surface to be processed, continuing to keep the initial element value of the target array element B unchanged (so that when processing a third polygon surface to be processed in each polygon surface of the three-dimensional model, the current element value of the target array element B is 0), whereas if it is determined that the position coordinate of the target array element B is in the second polygon surface to be processed, updating the current element value 0 of the target array element B to obtain 1 (so that when processing a third polygon surface to be processed in each polygon surface of the three-dimensional model, the current element value of the target array element B is 1). And continuously executing the method until each polygonal surface of the three-dimensional model does not comprise the polygonal surface to be processed, and obtaining the target element value of the target array element in the target array.
Step 302C, obtaining the number of polygon surfaces where the position coordinates of the target array elements are located according to the target element values of the target array elements in the target array.
If the element values are updated according to the first preset value and the initial element values are the first preset value, the number of polygon surfaces where the position coordinates of the target array elements are located is as follows:
Figure BDA0003723023660000161
where d is a first predetermined value, M is a target element value, for example, the first predetermined value and the initial element value are both equal to 2, and the target element value is 8, the number of polygon surfaces where the position coordinates of the target array element are located is 2.
If the element values are updated according to the second preset value, the number of polygonal surfaces where the position coordinates of the target array elements are located is as follows: (M-y)/h, where M is the target element value, h is the second preset value, y is the initial element value, for example, the second preset value h is 1, the initial element value y is 0, and the target element value M is 3, then the number of polygon surfaces where the position coordinates of the target array element are located is 3.
EXAMPLE III
Compared with an area summing mode, the method for judging whether the position coordinate is in the polygon surface is more efficient. Step 302A, comprising: step A and step B.
And A, obtaining a vertex element vector between the vertex of the polygon surface to be processed and a target array element based on the two-dimensional texture coordinate of the vertex of the polygon surface to be processed and the position coordinate of the target array element in the target array in the two-dimensional texture coordinate system.
The vertex element vector is a vector between a vertex and a target array element.
How to obtain the vertex element vector is described below by taking a polygonal surface as a triangular surface as an example.
Suppose that 3 vertexes of the polygon surface to be processed are A, B and C, respectively, and the two-dimensional texture coordinates of the 3 vertexes are: (0.1), (0.3,0.3), (0.4,0.1), the target array element is a target array element q, the position coordinate of the target array element q in the two-dimensional texture coordinate system is (0.2,0.15), and thus, the vertex element vector between vertex a and target array element q
Figure BDA0003723023660000171
Comprises the following steps: (-0.1, -0.05), vertex element vector between vertex B and target array element q
Figure BDA0003723023660000172
Comprises the following steps: (0.1,0.15), vertex element vector between vertex C and target array element q
Figure BDA0003723023660000173
Comprises the following steps: (0.2, -0.05).
And B, determining whether the position coordinates of the target array elements are in the polygon surface to be processed or not according to the vertex element vectors between the vertexes of the polygon surface to be processed and the target array elements.
Calculating cross multiplication between two vertex element vectors according to a clockwise sequence to obtain a cross multiplication result; if the cross multiplication results corresponding to the polygon surface to be processed have the same sign, the position coordinates of the target array elements are in the polygon surface to be processed; otherwise, the target array elementThe position coordinates of the elements are not within the polygon plane to be processed. E.g. computing
Figure BDA0003723023660000174
Ride across
Figure BDA0003723023660000175
The cross product result is-0.01, calculate
Figure BDA0003723023660000176
Ride across
Figure BDA0003723023660000177
The cross product result is-0.035, calculate
Figure BDA0003723023660000178
Ride across
Figure BDA0003723023660000179
And the cross multiplication result is-0.005, and the target array element q is determined to be in the polygon surface ABC to be processed because the three cross multiplication results are all negative signs.
Example four
In order to improve the overlapping detection efficiency, a bounding box with a polygonal surface is constructed, whether a target array element in the bounding box is in the polygonal surface is judged, and the target array element which is not in the bounding box is directly skipped, so that the overlapping detection efficiency is improved. Step 302A, comprising: step a to step d.
Step a, obtaining the vertex coordinates of the bounding box surrounding the polygon surface to be processed according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed.
And the bounding box is a surface surrounding the polygonal surface.
The vertex coordinates of the bounding box refer to a minimum U coordinate, a minimum V coordinate, a maximum U coordinate, and a maximum V coordinate of the bounding box in the two-dimensional texture coordinate system, and the two-dimensional texture coordinates of several vertices of the bounding box in the two-dimensional texture coordinate system can be obtained through the vertex coordinates of the bounding box, for example, the bounding box has 4 vertices, and the two-dimensional texture coordinates of the 4 vertices in the two-dimensional texture coordinate system are respectively: (minimum U coordinate, minimum V coordinate), (minimum U coordinate, maximum V coordinate), (maximum U coordinate, minimum V coordinate).
The following describes how to obtain the vertex coordinates of the bounding box by taking the polygon surface to be processed as a triangular surface as an example. The polygon ABC to be processed can be processed based on a trinocular operator, and the vertex coordinates of the bounding box of the polygon ABC to be processed are obtained. Wherein, the form of the trinocular operator is: ab: c, if a is true, the result is b, and if a is false, the result is c.
Suppose vertex A (U) cornerA ,V cornerA ) Vertex B (U) cornerB ,V cornerB ) Vertex C (U) cornerC ,V cornerC ) The minimum U coordinate is denoted by minU, the minimum V coordinate is denoted by minV, the maximum U coordinate is denoted by maxU, and the maximum V coordinate is denoted by maxV, so:
minU=(U cornerA <U cornerB )?(U cornerA <U cornerC ?U cornerA :U cornerC ):(U cornerB <U cornerC ?U cornerB :U cornerC );
minV=(V cornerA <V cornerB )?(V cornerA <V cornerC ?V cornerA :V cornerC ):(V cornerB <V cornerC ?V cornerB :V cornerC );
maxU=(U cornerA >U cornerB )?(U cornerA >U cornerC ?U cornerA :U cornerC ):(U cornerB >U cornerC ?U cornerB :U cornerC );
maxV=(V cornerA >V cornerB )?(V cornerA >V cornerC ?V cornerA :V cornerC ):(V cornerB >V cornerC ?V cornerB :V cornerC )。
for example, A (U) cornerA ,V cornerA ) Is (0.5,0.1), B (U) cornerB ,V cornerB ) Is (0.1,0.7), C (U) cornerC ,V cornerC ) Is (0.6,0.3), then minU =0.1, maxu =0.6, minv =0.1, maxv =0.7.
And b, determining whether the position coordinates of the target array elements are in the bounding box or not according to the vertex coordinates of the bounding box and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system.
If the U coordinate in the position coordinates of the target array element is smaller than or equal to the minimum U coordinate, or the U coordinate in the position coordinates of the target array element is larger than or equal to the maximum U coordinate, determining that the position coordinates of the target array element are not in the bounding box; otherwise, if the V coordinate in the position coordinates of the target array element is less than or equal to the minimum V coordinate, or the V coordinate in the position coordinates of the target array element is greater than or equal to the maximum V coordinate, determining that the position coordinates of the target array element are not in the bounding box; otherwise, determining the position coordinates of the target array element to be in the bounding box.
And c, obtaining a vertex element vector between the vertex of the polygon surface to be processed and the target array element according to the two-dimensional texture coordinate of the vertex of the polygon surface to be processed and the position coordinate of the target array element for the target array element with the position coordinate in the bounding box.
The implementation of "obtaining the vertex element vector between the vertex of the polygon to be processed and the target array element according to the two-dimensional texture coordinates of the vertex of the polygon to be processed and the position coordinates of the target array element" in step c may refer to the foregoing embodiments, and details are not described here.
And d, determining whether the position coordinates of the target array element are in the polygon surface to be processed or not according to the vertex element vector between the vertex of the polygon surface to be processed and the target array element.
The implementation of step d can refer to the foregoing embodiments, and will not be described in detail here.
EXAMPLE five
In order to improve the overlapping detection efficiency, firstly, rough detection is carried out in a preliminary array, if a certain preliminary array element in the preliminary array is detected to be in a polygonal surface, the preliminary array element is subdivided, a first target array element corresponding to the preliminary array element in a target array is found, and finally, whether the first target array element is in the polygonal surface or not is determined, so that an overlapping detection result is obtained. Step 302, comprising: step 302a to step 302d.
302a, for a polygon surface to be processed in each polygon surface, determining whether the position coordinates of a primary array element in a primary array are in the polygon surface to be processed or not according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the position coordinates of the primary array element in the primary array in a two-dimensional texture coordinate system; the target array is constructed according to a first resolution, the preliminary array is constructed according to a second resolution, the first resolution is a target multiple of the second resolution, and the target multiple is an integer greater than 1.
For example, the first resolution of the target array is 1024, the second resolution of the preliminary array is 256, and the target multiple is 4. It will be appreciated that the larger the target times, the coarser will be the overlap detection in the preliminary array.
In step 302a, "determining whether the position coordinates of the preliminary array elements are within the polygon surface to be processed according to the two-dimensional texture coordinates of the vertices of the polygon surface to be processed and the position coordinates of the preliminary array elements in the preliminary array in the two-dimensional texture coordinate system" may refer to the foregoing embodiments, and will not be described in detail herein.
And 302b, subdividing the preliminary array elements of the position coordinates in the polygon surface to be processed according to the target times to obtain first target array elements corresponding to the preliminary array elements in the target array.
The first target array element refers to a target array element in the target array corresponding to the preliminary array element.
Because the preliminary array elements are in the polygon surface to be processed, in order to obtain a more accurate overlap detection result, it is further necessary to determine whether the first target array element corresponding to the preliminary array element in the target array is in the polygon surface to be processed, and therefore, the preliminary array element of the position coordinate in the polygon surface to be processed is subdivided to obtain the first target array element corresponding to the preliminary array element in the target array.
The following describes how to obtain the first target array element in the target array corresponding to the preliminary array element.
In one embodiment: multiplying the U coordinate in the position coordinates of the preliminary array elements by the resolution of the preliminary array to obtain an abscissa i in the element coordinates of the preliminary array elements, and multiplying the V coordinate in the position coordinates of the preliminary array elements by the resolution of the preliminary array to obtain an ordinate j in the element coordinates of the preliminary array elements; multiplying the abscissa i by a target time to obtain a minimum abscissa; adding 1 to the abscissa i, multiplying by the target time to obtain an upper limit abscissa, and subtracting 1 from the upper limit abscissa to obtain a maximum abscissa; multiplying the ordinate j by the target time to obtain a minimum ordinate; adding 1 to the ordinate j, multiplying by the target time to obtain an upper limit ordinate, and subtracting 1 from the upper limit ordinate to obtain a maximum ordinate; determining the target array elements of which the element coordinates meet a second preset condition in the target array as first target array elements, wherein the first preset condition is as follows: an abscissa in the element coordinates is greater than or equal to the minimum abscissa, and an abscissa in the element coordinates is less than or equal to the maximum abscissa, and an ordinate in the element coordinates is greater than or equal to the minimum ordinate, and an ordinate in the element coordinates is less than or equal to the maximum ordinate.
As shown in fig. 7, the size of the preliminary array is 4 × 4 (i.e., the second resolution is), the size of the target array is 16 × 16 (i.e., the first resolution is 16), the target multiple is 4, the position coordinate of the preliminary array element H is (2/4,3/4), and thus the element coordinate of the preliminary array element H is (2,3); multiplying 2 by the target times 4 to obtain a minimum abscissa 8; adding 1 to 2, multiplying by the target times 4 to obtain an upper limit abscissa 12, and subtracting 1 from the upper limit abscissa 12 to obtain a maximum abscissa 11; multiplying 3 by the target times 4 to obtain a minimum ordinate 12; and adding 1 to 3, multiplying by the target multiple 4 to obtain an upper limit ordinate 16, and subtracting 1 from the upper limit ordinate 16 to obtain a maximum ordinate 15. Then, the element coordinates of the first target array element in the target array corresponding to the preliminary array element H are: (8, 12), (9, 12), (10, 12), (11, 12), (8, 13), (9, 13), (10, 13), (11, 13), (8, 14), (9, 14), (10, 14), (11, 14), (8, 15), (9, 15), (10, 15), (11, 15). The element coordinates of the first target array element are divided by the resolution 16 corresponding to the target array to obtain the position coordinates of the first target array element.
In another embodiment, the U coordinate in the position coordinates of the preliminary array elements is taken as the minimum U; taking a V coordinate in the position coordinates of the preliminary array elements as a minimum V; obtaining a maximum U according to the target times and the minimum U; obtaining a maximum V according to the target times and the minimum V; determining the target array elements of which the position coordinates meet a second preset condition in the target array as first target array elements, wherein the second preset condition is as follows: the U coordinate in the position coordinates is greater than or equal to the minimum U, and the U coordinate in the position coordinates is less than or equal to the maximum U, and the V coordinate in the position coordinates is greater than or equal to the minimum V, and the V coordinate in the position coordinates is less than or equal to the maximum V.
For example, the position coordinates of the preliminary array element H is (2/4,3/4), and thus the minimum U is 2/4; the minimum V is 3/4; and respectively multiplying the numerator and the denominator of the minimum U by the target times to obtain a conversion result corresponding to the minimum U: 8/16, multiplying the numerator and the denominator of the minimum V by the target times respectively to obtain a conversion result corresponding to the minimum V: 12/16, for the conversion result, add to the molecule: target fold-1, yielding: max U = (8+4-1)/16, max: v = (12 + 4-1)/16; thus, the position coordinates of the first target array element in the target array corresponding to the preliminary array element H are (8/16, 12/16), (9/16, 12/16), (10/16, 12/16), (11/16, 12/16), (8/16, 13/16), (9/16, 13/16), (10/16, 13/16), (11/16, 13/16), (8/16, 14/16), (9/16, 14/16), (10/16, 14/16), (11/16, 14/16), (8/16, 15/16), (9/16, 15/16), (10/16, 15/16), (11/16, 15/16), and 15/16).
Step 302c, determining whether the position coordinate of the first target array element is in the polygon surface to be processed, and updating the current element value of the first target array element of the position coordinate in the polygon surface to be processed until each polygon surface does not include the polygon surface to be processed, so as to obtain the target element value of the target array element in the target array; the current element value is obtained when the last polygon to be processed is processed.
The implementation of step 302c can refer to the foregoing embodiments, and will not be described in detail here.
And step 302d, obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located according to the target element values of the target array elements in the target array.
The implementation of step 302d can refer to the foregoing embodiments, and is not described in detail here.
EXAMPLE six
As shown in fig. 8, the preliminary array element (2,3) in the preliminary array is not in the triangle plane, and if the preliminary array element (2,3) is not in the triangle plane in the fifth embodiment, the next preliminary array element is directly determined, for example, the preliminary array element (3,3) is determined, so that the determination result of the target array elements K, O, L and P is not in the polygon plane, and the target array elements K, O, L and P are actually in the polygon plane, which is defined as a missing point phenomenon, and the occurrence of the missing point phenomenon may reduce the overlap detection accuracy. In order to prevent the missing dot phenomenon from occurring and improve the overlay detection accuracy, the polygon surfaces are shifted, as shown in fig. 9, the triangle with the larger area is the shift plane of the triangle with the smaller area, and the shift plane includes the preliminary array element (2,3), so that the detection of the target array elements K, O, L and P is not missed. Step 302a includes step one and step two.
And step one, according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the offset value corresponding to the preliminary array, offsetting the polygon surface to be processed to obtain an offset surface corresponding to the polygon surface to be processed.
The offset value corresponding to the preliminary array is a value which is set for the preliminary array in advance and used for offsetting the vertex of the polygon surface to be processed, and can be understood as follows, after offsetting each vertex of the polygon surface to be processed, connecting each vertex after offsetting, so that the offset surface corresponding to the polygon surface to be processed can be obtained.
The setting of the offset value is described by taking 256 as an example of the resolution corresponding to the preliminary array. As shown in fig. 10, the distance between the vertex M of the polygon to be processed MNF and the preliminary array element U is less than half the length of the diagonal:
Figure BDA0003723023660000221
if the offset value is set to
Figure BDA0003723023660000222
The preliminary array element U will be highly likely to appear in the offset plane of the polygon surface to be processed MNF, but in reality, even if the offset value is set to be
Figure BDA0003723023660000223
When the offset is performed along the inner center S toward the vertex M, the preliminary array element U still does not appear in the corresponding offset plane, and then, the offset value is further adjusted to be larger, and the offset value is adjusted to be the length of the diagonal line
Figure BDA0003723023660000224
Then, the preliminary array element U appears in the offset plane M ' N ' F ', and in effect, the offset value is set to the length of the diagonal line
Figure BDA0003723023660000225
Many triangle faces of different shapes all can hold preliminary array element U in after the skew, then, can set up the corresponding deviant of preliminary array as:
Figure BDA0003723023660000226
the resolution for the/preliminary array, in this example:
Figure BDA0003723023660000227
however, for some triangles with more extreme shapes, as shown in FIG. 11, the triangle is shaped according to
Figure BDA0003723023660000228
After the offset, the preliminary array element U is still not in the offset plane, and a missing dot phenomenon still occurs, so that, to avoid such an extreme situation, the overlap detection accuracy is improved, and the offset value corresponding to the preliminary array may be further set to 2/the resolution corresponding to the preliminary array, in this example: 2/256.
And secondly, determining whether the position coordinates of the preliminary array elements are on the offset surface or not based on the two-dimensional texture coordinates of the vertexes of the offset surface and the position coordinates of the preliminary array elements in the preliminary array in the two-dimensional texture coordinate system.
The implementation of step two can refer to the foregoing embodiments, and will not be described in detail herein.
EXAMPLE seven
The polygonal surface is a triangular surface. When the triangular surface is shifted, the vertices of the triangular surface are shifted by the same shifting method, specifically, in a direction from the center toward the vertices. The method comprises the following steps: step 1.1 and step 1.2.
Step 1.1, obtaining a two-dimensional texture coordinate of the inner center of the polygon surface to be processed according to the two-dimensional texture coordinate of the vertex of the polygon surface to be processed.
The inner center of the triangular surface is the intersection point of three angular bisectors of the triangle, and the distances from the inner center of the triangle to the three sides of the triangle are equal.
How to obtain the two-dimensional texture coordinates of the inner center is explained below. According to the two-dimensional texture coordinate between any two vertexes in the triangular surface, the length of the side where any two vertexes are located at the same time is obtained; and obtaining the two-dimensional texture coordinate of the inner center of the triangular surface according to the lengths of the three sides of the triangular surface and the two-dimensional texture coordinates of the three vertexes of the triangular surface.
For example, assume that the two-dimensional texture coordinates of three vertices of a triangular surface are a (U1, V1), B (U2, V2), and C (U3, V3), respectively, and the two-dimensional texture coordinate of the center of the triangular surface is (U1, V2) m ,V m ) The length of the edge on which vertex a and vertex B are both located is denoted AB, and, thus,
Figure BDA0003723023660000231
the length of the edge on which vertex B and vertex C are simultaneously located is denoted BC, and, thus,
Figure BDA0003723023660000232
Figure BDA0003723023660000233
the length of the edge on which vertex C and vertex a are simultaneously located is denoted AC, and, thus,
Figure BDA0003723023660000234
thus, U m =(BC×U1+CA×U2+AB×U3)/(BC+CA+AB),V m =(BC×V1+CA×V2+AB×V3)/(BC+CA+AB)。
And step 1.2, according to the two-dimensional texture coordinates of the inner center of the polygon surface to be processed and the offset value corresponding to the preliminary array, offsetting the polygon surface to be processed to obtain an offset surface corresponding to the polygon surface to be processed.
For example, by shifting vertex a, vertex a' after the vertex a is shifted, which is the extended vertex corresponding to vertex a, can be obtained.
Offsetting the triangular surface according to the inner center and the offset value, comprising: and according to the two-dimensional texture coordinate of the inner center of the polygon to be processed and the two-dimensional texture coordinate of the target vertex in the polygon to be processed, offsetting the target vertex by an offset value along the direction from the inner center to the target vertex to obtain an extended vertex corresponding to the target vertex. Wherein the target vertex is one of three vertices of the polygon to be processed.
In one embodiment, as shown in FIG. 12, the inner center of the triangular surface is assumed to be B (U) m ,V m ) The vertex A (U1, V1) and the corresponding outward-expanding vertex C (U1) of the vertex A c ,V c ). For triangular AOC there are: d 2 +c 2 =m 2 For triangle AOC and triangle PAB, there are: a/b = c/d,wherein a = | U1-U m |,b=|V1-V m |,c=|U c -U1|,d=|V c V1|, and thus, the two-dimensional texture coordinates of the extended vertex C corresponding to the vertex a can be obtained. In the same manner, two-dimensional texture coordinates of the extended vertex corresponding to the vertex B and the vertex C of the triangular surface can also be obtained.
In another embodiment, a vector from the inner center B to the vertex A is obtained according to the two-dimensional texture coordinates of the inner center B of the triangular surface and the two-dimensional texture coordinates of the vertex A
Figure BDA0003723023660000241
Calculating a vector
Figure BDA0003723023660000242
The direction vector of (2):
Figure BDA0003723023660000243
outward expansion vertex
Figure BDA0003723023660000244
Wherein m is an offset value corresponding to the preliminary array.
Example eight
In order to reduce the processing amount of the preliminary array elements, the overlapping detection efficiency is improved. Step two, comprising: step 2.1 to step 2.3.
And 2.1, obtaining the vertex coordinates of the bounding box surrounding the offset surface based on the two-dimensional texture coordinates of the vertex of the offset surface.
The implementation of step 2.1 can be referred to the previous embodiments and will not be described in detail here.
And 2.2, obtaining a preliminary array element of the position coordinate in the bounding box based on the vertex coordinate of the bounding box.
The vertex coordinates of the bounding box of the offset plane refer to the minimum U coordinate, the minimum V coordinate, the maximum U coordinate, and the maximum V coordinate of the bounding box of the offset plane in the two-dimensional texture coordinate system.
The following describes how to obtain preliminary array elements with position coordinates within the bounding box of the offset plane.
Obtaining a starting abscissa, an end abscissa, a starting ordinate and an end ordinate according to the minimum U coordinate, the minimum V coordinate, the maximum U coordinate and the maximum V coordinate of the bounding box of the offset plane in the two-dimensional texture coordinate system; thus, the position coordinates are the preliminary array elements within the bounding box of the offset plane: the abscissa in the element coordinates is greater than or equal to the starting abscissa, the abscissa in the element coordinates is less than or equal to the end abscissa, the ordinate in the element coordinates is greater than or equal to the starting ordinate, and the ordinate in the element coordinates is less than or equal to the end ordinate.
For example, assuming that the bounding box of the offset plane is represented by P-minU, P-maxU, P-minV, and P-maxV in the two-dimensional texture coordinate system, respectively, and the start abscissa, end abscissa, start ordinate, and end ordinate are represented by icart, iEnd, jStart, and jEnd, respectively, then P-minU, P-maxU, and P-maxV are multiplied by the resolution corresponding to the preliminary array, respectively, to obtain the first element abscissa corresponding to P-minU, and the second element abscissa corresponding to P-maxU, and the first element ordinate corresponding to P-minV, and the second element ordinate corresponding to P-maxV in the preliminary array, and to obtain the three-mesh operator, in order not to exceed the boundary, the bounding box of the offset plane is further required to obtain: iStart = (first element abscissa > minimum abscissa corresponding to preliminary array)? First element abscissa: the minimum abscissa corresponding to the preliminary array; iEnd = (second element abscissa < maximum abscissa corresponding to preliminary array)? Second element abscissa: the maximum horizontal coordinate corresponding to the preliminary array; jStart = (first element ordinate > minimum ordinate corresponding to preliminary array)? First element ordinate: the minimum vertical coordinate corresponding to the preliminary array; jEnd = (second element ordinate < maximum ordinate corresponding to preliminary array)? Second element ordinate: the maximum ordinate corresponding to the preliminary array. For example, the resolution corresponding to the preliminary array is 256, and thus the minimum abscissa corresponding to the preliminary array may be 0, and correspondingly, the maximum abscissa corresponding to the preliminary array may be 253, the minimum ordinate corresponding to the preliminary array may be 0, and correspondingly, the maximum ordinate corresponding to the preliminary array may be 253.
And 2.3, determining whether the position coordinates of the initial array elements are in the offset plane or not based on the two-dimensional texture coordinates of the vertexes of the offset plane and the position coordinates of the initial array elements in the bounding box.
The implementation of step 2.3 can be referred to the foregoing embodiments and will not be described in detail here.
Example nine
And obtaining an overlapping detection result according to the number of the polygonal surfaces where the position coordinates of the target array elements are located. Step 303, comprising: and if the number of the polygonal surfaces where the position coordinates of the target array elements are located is greater than or equal to a preset value, determining that the polygonal surfaces including the position coordinates in the surface development graph are overlapped.
The preset value is a preset value, and in a scenario where accurate detection of the overlay is required, the preset value may be set to 2, and in a scenario where coarse detection of the overlay is required, the preset value may also be set to an integer greater than 2.
The overlap detection result of the surface development graph can be represented by the overlapped polygon faces and the target array elements, for example, the overlap detection result of the surface development graph is as follows: a (m, n) -P1-P2-P3 means that the polygon plane P1, the polygon plane P2, and the polygon plane P3 overlap at the position coordinates of the target array element a (m, n) in the two-dimensional texture coordinate system.
Example ten
Referring to fig. 13, fig. 13 is a schematic flow chart of an implementation of the overlap detection method according to the embodiment of the present application. The specific process of the method can be as follows:
step 1301, acquiring two-dimensional texture coordinates of the vertex of each polygonal surface in the surface expansion diagram of the three-dimensional model under a two-dimensional texture coordinate system.
And 1302, obtaining vertex coordinates of a bounding box surrounding the polygon surfaces to be processed according to the two-dimensional texture coordinates of the vertexes of the polygon surfaces to be processed for the polygon surfaces to be processed in each polygon surface.
Step 1303, determining whether the position coordinates of the target array elements are in the bounding box or not according to the vertex coordinates of the bounding box and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system; and for the target array elements with the position coordinates in the bounding box, obtaining vertex element vectors between the vertexes of the polygon surfaces to be processed and the target array elements according to the two-dimensional texture coordinates of the vertexes of the polygon surfaces to be processed and the position coordinates of the target array elements.
And 1304, determining whether the position coordinates of the target array element are in the polygon surface to be processed according to the vertex element vector between the vertex of the polygon surface to be processed and the target array element.
Step 1305, updating the current element value of the target array element of the position coordinate in the polygon surface to be processed until each polygon surface does not include the polygon surface to be processed, and obtaining the target element value of the target array element in the target array; the current element value is obtained when the last polygon to be processed is processed.
Step 1306, obtaining the number of polygon surfaces where the position coordinates of the target array elements are located according to the target element values of the target array elements in the target array.
Step 1307, if the number of the polygon surfaces where the position coordinates of the target array elements are located is greater than or equal to the preset value, determining that the polygon surfaces including the position coordinates in the surface development graph are overlapped.
EXAMPLE eleven
Referring to fig. 14, fig. 14 is a schematic flow chart of an implementation of the overlap detection method according to the embodiment of the present application. The specific process of the method can be as follows:
and 1401, acquiring two-dimensional texture coordinates of the vertex of each polygonal surface in the surface expansion diagram of the three-dimensional model under a two-dimensional texture coordinate system.
And 1402, offsetting the polygon surface to be processed in each polygon surface according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the offset value corresponding to the preliminary array to obtain an offset surface corresponding to the polygon surface to be processed.
1403, obtaining vertex coordinates of a bounding box surrounding the offset plane based on the two-dimensional texture coordinates of the vertex of the offset plane; obtaining a preliminary array element of the position coordinate in the bounding box based on the vertex coordinate of the bounding box; determining whether the position coordinates of the preliminary array element are within the offset plane based on the two-dimensional texture coordinates of the vertex of the offset plane and the position coordinates of the preliminary array element within the bounding box.
And 1404, subdividing the preliminary array elements of the position coordinates in the polygon surface to be processed according to the target times to obtain first target array elements corresponding to the preliminary array elements in the target array.
Step 1405, determining whether the position coordinate of the first target array element is in the polygon surface to be processed, and updating the current element value of the first target array element of the position coordinate in the polygon surface to be processed until each polygon surface does not include the polygon surface to be processed, so as to obtain the target element value of the target array element in the target array; the current element value is obtained when the last polygon to be processed is processed.
And step 1406, obtaining the number of polygon surfaces where the position coordinates of the target array elements are located according to the target element values of the target array elements in the target array.
And step 1407, if the number of the polygon surfaces where the position coordinates of the target array elements are located is greater than or equal to a preset value, determining that the polygon surfaces including the position coordinates in the surface development graph are overlapped.
Example twelve
In order to better implement the above method, an overlap detection apparatus is further provided in the embodiment of the present application, please refer to fig. 15, and fig. 15 is a schematic structural diagram of the overlap detection apparatus provided in the embodiment of the present application. The overlap detection device may include:
an obtaining unit 1510 is configured to obtain two-dimensional texture coordinates of a vertex of each polygon surface in the surface development diagram of the three-dimensional model in the two-dimensional texture coordinate system.
The number unit 1520, configured to obtain the number of polygon surfaces where the position coordinates of the target array element are located based on the two-dimensional texture coordinates of the vertex and the position coordinates of the target array element in the target array in the two-dimensional texture coordinate system.
The detecting unit 1530 is configured to obtain an overlap detection result of the surface development diagram according to the number of polygon surfaces where the position coordinates of the target array element are located.
Optionally, the quantity unit 1520 is further to:
for the polygon surface to be processed in each polygon surface, determining whether the position coordinates of the target array elements are in the polygon surface to be processed or not according to the two-dimensional texture coordinates of the vertexes of the polygon surface to be processed and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system;
updating the current element value of the target array element of the position coordinate in the polygon surface to be processed until each polygon surface does not comprise the polygon surface to be processed, and obtaining the target element value of the target array element in the target array; the current element value is obtained when the previous polygon surface to be processed is processed;
and obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located according to the target element values of the target array elements in the target array.
Optionally, the quantity unit 1520 is further to:
obtaining a vertex element vector between the vertex of the polygonal surface to be processed and a target array element based on the two-dimensional texture coordinate of the vertex of the polygonal surface to be processed and the position coordinate of the target array element in the target array in the two-dimensional texture coordinate system;
and determining whether the position coordinates of the target array elements are in the polygon surface to be processed or not according to the vertex element vectors between the vertexes of the polygon surface to be processed and the target array elements.
Optionally, the quantity unit 1520 is further to:
obtaining the vertex coordinates of an enclosure box enclosing the polygonal surface to be processed according to the two-dimensional texture coordinates of the vertex of the polygonal surface to be processed;
determining whether the position coordinates of the target array elements are in the bounding box or not according to the vertex coordinates of the bounding box and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system; for a target array element of which the position coordinate is in the bounding box, obtaining a vertex element vector between the vertex of the polygon surface to be processed and the target array element according to the two-dimensional texture coordinate of the vertex of the polygon surface to be processed and the position coordinate of the target array element;
and determining whether the position coordinates of the target array element are in the polygon surface to be processed according to the vertex element vector between the vertex of the polygon surface to be processed and the target array element.
Optionally, the quantity unit 1520 is further to:
for the polygon surface to be processed in each polygon surface, determining whether the position coordinates of the primary array elements are in the polygon surface to be processed or not according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the position coordinates of the primary array elements in the primary array in the two-dimensional texture coordinate system; the target array is constructed according to a first resolution, the preliminary array is constructed according to a second resolution, the first resolution is a target multiple of the second resolution, and the target multiple is an integer greater than 1;
according to the target times, carrying out subdivision processing on the preliminary array elements of the position coordinates in the polygonal plane to be processed to obtain first target array elements corresponding to the preliminary array elements in the target array;
determining whether the position coordinates of the first target array elements are in a polygon surface to be processed or not, updating the current element values of the first target array elements of the position coordinates in the polygon surface to be processed until each polygon surface does not include the polygon surface to be processed, and obtaining the target element values of the target array elements in the target array; the current element value is obtained when the previous polygon surface to be processed is processed;
and obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located according to the target element values of the target array elements in the target array.
Optionally, the quantity unit 1520 is further configured to:
according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the offset value corresponding to the preliminary array, offsetting the polygon surface to be processed to obtain an offset surface corresponding to the polygon surface to be processed;
and determining whether the position coordinates of the preliminary array elements are on the offset surface or not based on the two-dimensional texture coordinates of the vertexes of the offset surface and the position coordinates of the preliminary array elements in the preliminary array in the two-dimensional texture coordinate system.
Optionally, the polygonal faces are triangular faces; the quantity unit 1520 is also to:
obtaining a two-dimensional texture coordinate of the inner center of the polygon surface to be processed according to the two-dimensional texture coordinate of the vertex of the polygon surface to be processed;
and offsetting the polygon surface to be processed according to the two-dimensional texture coordinates of the inner center of the polygon surface to be processed and the offset value corresponding to the preliminary array to obtain an offset surface corresponding to the polygon surface to be processed.
Optionally, the quantity unit 1520 is further to:
obtaining the vertex coordinates of a bounding box surrounding the offset surface based on the two-dimensional texture coordinates of the vertex of the offset surface;
obtaining a preliminary array element of the position coordinate in the bounding box based on the vertex coordinate of the bounding box;
determining whether the position coordinates of the preliminary array element are within the offset plane based on the two-dimensional texture coordinates of the vertex of the offset plane and the position coordinates of the preliminary array element within the bounding box.
Optionally, the detection unit 1530 is further configured to:
and if the number of the polygonal surfaces where the position coordinates of the target array elements are located is greater than or equal to a preset value, determining that the polygonal surfaces including the position coordinates in the surface development graph are overlapped.
In a specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and the specific implementation of the above units may refer to the foregoing method embodiments, which are not described herein again.
The overlap detection device provided by the embodiment of the application obtains two-dimensional texture coordinates of the vertex of each polygonal surface in a surface expansion diagram of a three-dimensional model under a two-dimensional texture coordinate system; obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located based on the two-dimensional texture coordinates of the vertexes and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system; and obtaining the overlapping detection result of the surface development graph according to the number of the polygonal surfaces where the position coordinates of the target array elements are located.
As can be seen from the above, in the embodiment of the present application, if the overlap occurs, a position point in the two-dimensional texture coordinate system will be in a plurality of polygonal surfaces, which is equivalent to that, if the overlap occurs, the position coordinates of the target array element will inevitably be in a plurality of polygonal surfaces, and then, in the surface development diagram, the number of polygonal surfaces where the position coordinates are located is detected, so that the overlap detection is implemented.
Thirteen examples
Correspondingly, the embodiment of the present application further provides an electronic device, where the electronic device may be a terminal or a server, and the terminal may be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a game machine, a Personal computer, and a Personal Digital Assistant (PDA).
As shown in fig. 16, fig. 16 is a schematic structural diagram of an electronic device according to an embodiment of the present application, where the electronic device 1600 includes a processor 1601 having one or more processing cores, a memory 1602 having one or more computer-readable storage media, and a computer program stored in the memory 1602 and capable of running on the processor. The processor 1601 is electrically connected to the memory 1602. Those skilled in the art will appreciate that the electronic device configurations shown in the figures do not constitute limitations of the electronic device, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
The processor 1601 is a control center of the electronic device 1600, and is connected to various parts of the electronic device 1600 through various interfaces and lines, and executes various functions of the electronic device 1600 and processes data by running or loading software programs and/or modules stored in the memory 1602 and calling data stored in the memory 1602, thereby performing overall monitoring of the electronic device 1600.
In this embodiment, the processor 1601 in the electronic device 1600 loads instructions corresponding to processes of one or more application programs into the memory 1602 according to the following steps, and the processor 1601 executes the application programs stored in the memory 1602, so as to implement various functions:
acquiring two-dimensional texture coordinates of the vertex of each polygonal surface in a surface expansion diagram of the three-dimensional model under a two-dimensional texture coordinate system;
based on the two-dimensional texture coordinates of the vertexes and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system, obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located;
and obtaining the overlapping detection result of the surface expansion diagram according to the number of the polygonal surfaces where the position coordinates of the target array elements are located.
Optionally, obtaining, based on the two-dimensional texture coordinates of the vertex and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system, the number of polygonal surfaces where the position coordinates of the target array elements are located, includes:
for the polygon surface to be processed in each polygon surface, determining whether the position coordinates of the target array elements are in the polygon surface to be processed or not according to the two-dimensional texture coordinates of the vertexes of the polygon surface to be processed and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system;
updating the current element value of the target array element of the position coordinate in the polygon surface to be processed until each polygon surface does not comprise the polygon surface to be processed, and obtaining the target element value of the target array element in the target array; the current element value is obtained when the previous polygon surface to be processed is processed;
and obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located according to the target element values of the target array elements in the target array.
Optionally, determining, according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the position coordinates of the target array element in the target array in the two-dimensional texture coordinate system, whether the position coordinates of the target array element are in the polygon surface to be processed includes:
obtaining a vertex element vector between the vertex of the polygonal surface to be processed and a target array element based on the two-dimensional texture coordinate of the vertex of the polygonal surface to be processed and the position coordinate of the target array element in the target array in the two-dimensional texture coordinate system;
and determining whether the position coordinates of the target array elements are in the polygon surface to be processed or not according to the vertex element vectors between the vertexes of the polygon surface to be processed and the target array elements.
Optionally, determining, according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the position coordinates of the target array element in the target array in the two-dimensional texture coordinate system, whether the position coordinates of the target array element are in the polygon surface to be processed includes:
obtaining the vertex coordinates of an enclosure box enclosing the polygonal surface to be processed according to the two-dimensional texture coordinates of the vertex of the polygonal surface to be processed;
determining whether the position coordinates of the target array elements are in the bounding box or not according to the vertex coordinates of the bounding box and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system;
for a target array element of which the position coordinate is in the bounding box, obtaining a vertex element vector between the vertex of the polygon surface to be processed and the target array element according to the two-dimensional texture coordinate of the vertex of the polygon surface to be processed and the position coordinate of the target array element;
and determining whether the position coordinates of the target array element are in the polygon surface to be processed according to the vertex element vector between the vertex of the polygon surface to be processed and the target array element.
Optionally, obtaining, based on the two-dimensional texture coordinates of the vertex and the position coordinates of the target array element in the target array in the two-dimensional texture coordinate system, the number of polygonal surfaces where the position coordinates of the target array element are located, includes:
for the polygon surface to be processed in each polygon surface, determining whether the position coordinates of the primary array elements are in the polygon surface to be processed or not according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the position coordinates of the primary array elements in the primary array in the two-dimensional texture coordinate system; the target array is constructed according to a first resolution, the preliminary array is constructed according to a second resolution, the first resolution is a target multiple of the second resolution, and the target multiple is an integer greater than 1;
according to the target times, carrying out subdivision processing on the preliminary array elements of the position coordinates in the polygonal surface to be processed to obtain first target array elements corresponding to the preliminary array elements in the target array;
determining whether the position coordinates of the first target array elements are in a polygon surface to be processed or not, updating the current element values of the first target array elements of the position coordinates in the polygon surface to be processed until each polygon surface does not include the polygon surface to be processed, and obtaining the target element values of the target array elements in the target array; the current element value is obtained when the previous polygon surface to be processed is processed;
and obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located according to the target element values of the target array elements in the target array.
Optionally, determining whether the position coordinates of the preliminary array element are in the polygon surface to be processed according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the position coordinates of the preliminary array element in the preliminary array in the two-dimensional texture coordinate system, includes:
according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the offset value corresponding to the preliminary array, offsetting the polygon surface to be processed to obtain an offset surface corresponding to the polygon surface to be processed;
and determining whether the position coordinates of the preliminary array elements are on the offset surface or not based on the two-dimensional texture coordinates of the vertexes of the offset surface and the position coordinates of the preliminary array elements in the preliminary array in the two-dimensional texture coordinate system.
Optionally, the polygonal faces are triangular faces; according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the offset value corresponding to the preliminary array, the polygon surface to be processed is offset to obtain an offset surface corresponding to the polygon surface to be processed, and the method comprises the following steps:
obtaining a two-dimensional texture coordinate of the inner center of the polygon surface to be processed according to the two-dimensional texture coordinate of the vertex of the polygon surface to be processed;
and offsetting the polygon surface to be processed according to the two-dimensional texture coordinates of the inner center of the polygon surface to be processed and the offset value corresponding to the preliminary array to obtain an offset surface corresponding to the polygon surface to be processed.
Optionally, determining whether the position coordinate of the preliminary array element is on the offset plane based on the two-dimensional texture coordinate of the vertex of the offset plane and the position coordinate of the preliminary array element in the preliminary array in the two-dimensional texture coordinate system includes:
obtaining the vertex coordinates of a bounding box surrounding the offset surface based on the two-dimensional texture coordinates of the vertex of the offset surface;
obtaining a preliminary array element of the position coordinate in the bounding box based on the vertex coordinate of the bounding box;
determining whether the position coordinates of the preliminary array element are within the offset plane based on the two-dimensional texture coordinates of the vertex of the offset plane and the position coordinates of the preliminary array element within the bounding box.
Optionally, obtaining an overlap detection result of the surface development graph according to the number of polygon surfaces where the position coordinates of the target array element are located, where the overlap detection result includes:
and if the number of the polygonal surfaces where the position coordinates of the target array elements are located is greater than or equal to a preset value, determining that the polygonal surfaces including the position coordinates in the surface development graph are overlapped.
Therefore, in the embodiment of the present application, if overlapping occurs, a position point in a two-dimensional texture coordinate system will be in a plurality of polygon surfaces, which is equivalent to that, if overlapping occurs, the position coordinates of a target array element will inevitably be in a plurality of polygon surfaces, and then, in a surface development diagram, the number of polygon surfaces where the position coordinates are located is detected, so that overlapping detection is implemented.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Optionally, as shown in fig. 16, the electronic device 1600 further includes: a touch display 1603, a radio frequency circuit 1604, an audio circuit 1605, an input unit 1606, and a power supply 1607. The processor 1601 is electrically connected to the touch display 1603, the rf circuit 1604, the audio circuit 1605, the input unit 1606, and the power supply 1607, respectively. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 16 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The touch-sensitive display screen 1603 can be used for displaying a graphical user interface and receiving operation instructions generated by a user on the graphical user interface. Touch display screen 1603 may include a display panel and a touch panel. The display panel may be used, among other things, to display information entered by or provided to a user and various graphical user interfaces of the electronic device, which may be made up of graphics, text, icons, video, and any combination thereof. Alternatively, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. The touch panel may be used to collect touch operations of a user (for example, operations of the user on or near the touch panel by using a finger, a stylus pen, or any other suitable object or accessory) and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Alternatively, the touch panel may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, and sends the touch point coordinates to the processor 1601, and can receive and execute commands sent from the processor 1601. The touch panel may cover the display panel, and when the touch panel detects a touch operation thereon or nearby, the touch panel transmits the touch operation to the processor 1601 to determine the type of the touch event, and then the processor 1601 provides a corresponding visual output on the display panel according to the type of the touch event. In the embodiment of the present application, a touch panel and a display panel may be integrated into the touch display screen 1603 to implement input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two separate components to perform the input and output functions. That is, the touch display panel 1603 may also be used as a part of the input unit 1606 to implement an input function.
In this embodiment, a game application is executed by the processor 1601 to generate a graphical user interface on the touch display 1603, where a virtual scene on the graphical user interface includes at least one skill control area, and the skill control area includes at least one skill control. The touch display screen 1603 is used for presenting a graphical user interface and receiving operation instructions generated by a user acting on the graphical user interface.
The rf circuit 1604 may be used for transceiving rf signals to establish wireless communication with a network device or other electronic devices via wireless communication, and for transceiving signals with the network device or other electronic devices.
The audio circuit 1605 may be used to provide an audio interface between a user and the electronic device through speakers and microphones. The audio circuit 1605 can transmit the electrical signal converted from the received audio data to the speaker, and the electrical signal is converted into a sound signal by the speaker for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 1605 and then converted into audio data, which is then processed by the audio data output processor 1601 and then sent to another electronic device via the rf circuit 1604 or output to the memory 1602 for further processing. The audio circuit 1605 may also include an earbud jack to provide communication of a peripheral headset with the electronic device.
The input unit 1606 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
Power supply 1607 is used to power the various components of electronic device 1600. Optionally, the power supply 1607 may be logically connected to the processor 1601 by a power management system, so that the power management system may manage charging, discharging, and power consumption. The power supply 1607 may also include any component including one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown in fig. 16, the electronic device 1600 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, etc., which are not described in detail herein.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
Example fourteen
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer programs can be loaded by a processor to execute the steps in any of the overlap detection methods provided by the embodiments of the present application. For example, the computer program may perform the steps of:
acquiring two-dimensional texture coordinates of the vertex of each polygonal surface in a surface expansion diagram of the three-dimensional model under a two-dimensional texture coordinate system;
based on the two-dimensional texture coordinates of the vertexes and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system, obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located;
and obtaining the overlapping detection result of the surface development graph according to the number of the polygonal surfaces where the position coordinates of the target array elements are located.
Optionally, obtaining, based on the two-dimensional texture coordinates of the vertex and the position coordinates of the target array element in the target array in the two-dimensional texture coordinate system, the number of polygonal surfaces where the position coordinates of the target array element are located, includes:
for the polygon surface to be processed in each polygon surface, determining whether the position coordinates of the target array elements are in the polygon surface to be processed or not according to the two-dimensional texture coordinates of the vertexes of the polygon surface to be processed and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system;
updating the current element value of the target array element of the position coordinate in the polygon surface to be processed until each polygon surface does not comprise the polygon surface to be processed, and obtaining the target element value of the target array element in the target array; the current element value is obtained when the previous polygon surface to be processed is processed;
and obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located according to the target element values of the target array elements in the target array.
Optionally, determining whether the position coordinate of the target array element is within the polygon surface to be processed according to the two-dimensional texture coordinate of the vertex of the polygon surface to be processed and the position coordinate of the target array element in the target array in the two-dimensional texture coordinate system, includes:
obtaining a vertex element vector between the vertex of the polygonal surface to be processed and a target array element based on the two-dimensional texture coordinate of the vertex of the polygonal surface to be processed and the position coordinate of the target array element in the target array in the two-dimensional texture coordinate system;
and determining whether the position coordinates of the target array elements are in the polygon surface to be processed or not according to the vertex element vectors between the vertexes of the polygon surface to be processed and the target array elements.
Optionally, determining whether the position coordinate of the target array element is within the polygon surface to be processed according to the two-dimensional texture coordinate of the vertex of the polygon surface to be processed and the position coordinate of the target array element in the target array in the two-dimensional texture coordinate system, includes:
obtaining the vertex coordinates of an enclosure box enclosing the polygonal surface to be processed according to the two-dimensional texture coordinates of the vertex of the polygonal surface to be processed;
determining whether the position coordinates of the target array elements are in the bounding box or not according to the vertex coordinates of the bounding box and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system; for a target array element of which the position coordinate is in the bounding box, obtaining a vertex element vector between the vertex of the polygon surface to be processed and the target array element according to the two-dimensional texture coordinate of the vertex of the polygon surface to be processed and the position coordinate of the target array element;
and determining whether the position coordinates of the target array elements are in the polygon surface to be processed or not according to the vertex element vectors between the vertexes of the polygon surface to be processed and the target array elements.
Optionally, obtaining, based on the two-dimensional texture coordinates of the vertex and the position coordinates of the target array element in the target array in the two-dimensional texture coordinate system, the number of polygonal surfaces where the position coordinates of the target array element are located, includes:
for the polygon surface to be processed in each polygon surface, determining whether the position coordinates of the primary array elements are in the polygon surface to be processed or not according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the position coordinates of the primary array elements in the primary array in the two-dimensional texture coordinate system; the target array is constructed according to a first resolution, the preliminary array is constructed according to a second resolution, the first resolution is a target multiple of the second resolution, and the target multiple is an integer greater than 1;
according to the target times, carrying out subdivision processing on the preliminary array elements of the position coordinates in the polygonal surface to be processed to obtain first target array elements corresponding to the preliminary array elements in the target array;
determining whether the position coordinates of the first target array elements are in a polygon surface to be processed or not, updating the current element values of the first target array elements of the position coordinates in the polygon surface to be processed until each polygon surface does not include the polygon surface to be processed, and obtaining the target element values of the target array elements in the target array; the current element value is obtained when the previous polygon surface to be processed is processed;
and obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located according to the target element values of the target array elements in the target array.
Optionally, determining whether the position coordinates of the preliminary array element are within the polygon surface to be processed according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the position coordinates of the preliminary array element in the preliminary array in the two-dimensional texture coordinate system, includes:
according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the offset value corresponding to the preliminary array, offsetting the polygon surface to be processed to obtain an offset surface corresponding to the polygon surface to be processed;
and determining whether the position coordinates of the preliminary array elements are on the offset surface or not based on the two-dimensional texture coordinates of the vertexes of the offset surface and the position coordinates of the preliminary array elements in the preliminary array in the two-dimensional texture coordinate system.
Optionally, the polygonal faces are triangular faces; according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the offset value corresponding to the preliminary array, the polygon surface to be processed is offset to obtain an offset surface corresponding to the polygon surface to be processed, and the method comprises the following steps:
obtaining a two-dimensional texture coordinate of the inner center of the polygon surface to be processed according to the two-dimensional texture coordinate of the vertex of the polygon surface to be processed;
and offsetting the polygon surface to be processed according to the two-dimensional texture coordinates of the inner center of the polygon surface to be processed and the offset value corresponding to the preliminary array to obtain an offset surface corresponding to the polygon surface to be processed.
Optionally, determining whether the position coordinate of the preliminary array element is on the offset plane based on the two-dimensional texture coordinate of the vertex of the offset plane and the position coordinate of the preliminary array element in the preliminary array in the two-dimensional texture coordinate system includes:
obtaining the vertex coordinates of a bounding box surrounding the offset surface based on the two-dimensional texture coordinates of the vertex of the offset surface;
obtaining a preliminary array element of the position coordinate in the bounding box based on the vertex coordinate of the bounding box;
determining whether the position coordinates of the preliminary array element are within the offset plane based on the two-dimensional texture coordinates of the vertex of the offset plane and the position coordinates of the preliminary array element within the bounding box.
Optionally, obtaining an overlap detection result of the surface development graph according to the number of polygon surfaces where the position coordinates of the target array element are located, where the overlap detection result includes:
and if the number of the polygonal surfaces where the position coordinates of the target array elements are located is greater than or equal to a preset value, determining that the polygonal surfaces including the position coordinates in the surface development graph are overlapped.
As can be seen from the above description, in the embodiment of the present application, if an overlap occurs, a position point in a two-dimensional texture coordinate system will be in a plurality of polygon surfaces, which is equivalent to that, if an overlap occurs, the position coordinates of a target array element will inevitably be in a plurality of polygon surfaces, and then, in a surface development diagram, the number of polygon surfaces where the position coordinates are located is detected, so that overlap detection is implemented.
Wherein the storage medium may include: read Only Memory (ROM), random Access Memory (RAM), magnetic or optical disks, and the like.
Since the computer program stored in the storage medium can execute the steps in any of the overlap detection methods provided in the embodiments of the present application, beneficial effects that can be achieved by any of the overlap detection methods provided in the embodiments of the present application can be achieved, and detailed descriptions thereof are omitted here for the sake of detail in the foregoing embodiments.
The above detailed description is provided for an overlap detection method, an apparatus, a computer-readable storage medium, and an electronic device according to embodiments of the present application, and specific examples are applied herein to explain the principles and implementations of the present application, and the descriptions of the above embodiments are only used to help understand the method and the core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (12)

1. An overlay detection method, comprising:
acquiring two-dimensional texture coordinates of the vertex of each polygonal surface in a surface expansion diagram of the three-dimensional model under a two-dimensional texture coordinate system;
obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located based on the two-dimensional texture coordinates of the vertexes and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system;
and obtaining the overlapping detection result of the surface expansion diagram according to the number of the polygonal surfaces where the position coordinates of the target array elements are located.
2. The overlap detection method according to claim 1, wherein obtaining the number of polygon surfaces in which the position coordinates of the target array element are located based on the two-dimensional texture coordinates of the vertex and the position coordinates of the target array element in the target array in the two-dimensional texture coordinate system comprises:
for a polygon surface to be processed in each polygon surface, determining whether the position coordinates of a target array element in the target array are in the polygon surface to be processed according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the position coordinates of the target array element in the target array in a two-dimensional texture coordinate system;
updating the current element value of the target array element of the position coordinate in the polygon surface to be processed until each polygon surface does not comprise the polygon surface to be processed, and obtaining the target element value of the target array element in the target array; the current element value is obtained when the previous polygon surface to be processed is processed;
and obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located according to the target element values of the target array elements in the target array.
3. The overlap detection method according to claim 2, wherein the determining whether the position coordinate of the target array element is within the polygon surface to be processed according to the two-dimensional texture coordinate of the vertex of the polygon surface to be processed and the position coordinate of the target array element in the target array in the two-dimensional texture coordinate system comprises:
obtaining a vertex element vector between the vertex of the polygon surface to be processed and a target array element in the target array based on the two-dimensional texture coordinate of the vertex of the polygon surface to be processed and the position coordinate of the target array element in the two-dimensional texture coordinate system;
and determining whether the position coordinates of the target array element are in the polygon surface to be processed according to the vertex element vector between the vertex of the polygon surface to be processed and the target array element.
4. The overlap detection method according to claim 2, wherein the determining whether the position coordinate of the target array element is within the polygon surface to be processed according to the two-dimensional texture coordinate of the vertex of the polygon surface to be processed and the position coordinate of the target array element in the target array in the two-dimensional texture coordinate system comprises:
obtaining the vertex coordinates of an enclosure box enclosing the polygonal surface to be processed according to the two-dimensional texture coordinates of the vertex of the polygonal surface to be processed;
determining whether the position coordinates of the target array elements are in the bounding box or not according to the vertex coordinates of the bounding box and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system;
obtaining a vertex element vector between the vertex of the polygon surface to be processed and a target array element according to the two-dimensional texture coordinate of the vertex of the polygon surface to be processed and the position coordinate of the target array element for the target array element with the position coordinate in the bounding box;
and determining whether the position coordinates of the target array element are in the polygon surface to be processed according to the vertex element vector between the vertex of the polygon surface to be processed and the target array element.
5. The overlap detection method according to claim 1, wherein obtaining the number of polygon surfaces in which the position coordinates of the target array element are located based on the two-dimensional texture coordinates of the vertex and the position coordinates of the target array element in the target array in the two-dimensional texture coordinate system comprises:
for a polygon surface to be processed in each polygon surface, determining whether the position coordinates of a preliminary array element in a preliminary array are in the polygon surface to be processed or not according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the position coordinates of the preliminary array element in the preliminary array in a two-dimensional texture coordinate system; the target array is constructed according to a first resolution, the preliminary array is constructed according to a second resolution, the first resolution is a target multiple of the second resolution, and the target multiple is an integer greater than 1;
according to the target times, carrying out subdivision processing on preliminary array elements of the position coordinates in the polygonal surface to be processed to obtain first target array elements corresponding to the preliminary array elements in the target array;
determining whether the position coordinate of the first target array element is in the polygon surface to be processed, and updating the current element value of the first target array element of the position coordinate in the polygon surface to be processed until each polygon surface does not include the polygon surface to be processed, so as to obtain the target element value of the target array element in the target array; the current element value is obtained when the previous polygon surface to be processed is processed;
and obtaining the number of polygonal surfaces where the position coordinates of the target array elements are located according to the target element values of the target array elements in the target array.
6. The overlap detection method according to claim 5, wherein the determining whether the position coordinates of the preliminary array element are within the polygon surface to be processed according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the position coordinates of the preliminary array element in the preliminary array in the two-dimensional texture coordinate system comprises:
according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the offset value corresponding to the preliminary array, offsetting the polygon surface to be processed to obtain an offset surface corresponding to the polygon surface to be processed;
and determining whether the position coordinates of the preliminary array elements are on the offset surface or not based on the two-dimensional texture coordinates of the vertexes of the offset surface and the position coordinates of the preliminary array elements in the preliminary array in the two-dimensional texture coordinate system.
7. The overlay detection method of claim 6 wherein said polygonal faces are triangular faces; the offsetting the polygon surface to be processed according to the two-dimensional texture coordinates of the vertex of the polygon surface to be processed and the offset value corresponding to the preliminary array to obtain an offset surface corresponding to the polygon surface to be processed includes:
obtaining a two-dimensional texture coordinate of the inner center of the polygon surface to be processed according to the two-dimensional texture coordinate of the vertex of the polygon surface to be processed;
and offsetting the polygon surface to be processed according to the two-dimensional texture coordinates of the inner center of the polygon surface to be processed and the offset value corresponding to the preliminary array to obtain an offset surface corresponding to the polygon surface to be processed.
8. The overlay detection method of claim 6 wherein determining whether the position coordinates of the preliminary array element are on the offset surface based on the two-dimensional texture coordinates of the vertices of the offset surface and the position coordinates of the preliminary array element in the preliminary array in the two-dimensional texture coordinate system comprises:
obtaining the vertex coordinates of a bounding box surrounding the offset surface based on the two-dimensional texture coordinates of the vertex of the offset surface;
obtaining a preliminary array element of the position coordinate in the bounding box based on the vertex coordinate of the bounding box;
and determining whether the position coordinates of the preliminary array element are in the offset plane or not based on the two-dimensional texture coordinates of the vertex of the offset plane and the position coordinates of the preliminary array element in the bounding box.
9. The overlap detection method according to any one of claims 1 to 8, wherein obtaining the overlap detection result of the surface development diagram according to the number of polygonal surfaces in which the position coordinates of the target array element are located includes:
and if the number of the polygonal surfaces where the position coordinates of the target array elements are located is greater than or equal to a preset value, determining that the polygonal surfaces including the position coordinates in the surface development graph are overlapped.
10. An overlay detection apparatus, comprising:
the acquisition unit is used for acquiring two-dimensional texture coordinates of the vertex of each polygonal surface in the surface expansion image of the three-dimensional model under a two-dimensional texture coordinate system;
the quantity unit is used for obtaining the quantity of polygonal surfaces where the position coordinates of the target array elements are located based on the two-dimensional texture coordinates of the vertexes and the position coordinates of the target array elements in the target array in the two-dimensional texture coordinate system;
and the detection unit is used for obtaining the overlapping detection result of the surface development graph according to the number of the polygonal surfaces where the position coordinates of the target array elements are located.
11. An electronic device comprising a processor and a memory, the memory storing a plurality of instructions; the processor loads instructions from the memory to perform the steps in the overlap detection method of any one of claims 1 to 9.
12. A computer readable storage medium storing instructions adapted to be loaded by a processor to perform the steps of the overlap detection method according to any one of claims 1 to 9.
CN202210778651.8A 2022-06-30 2022-06-30 Overlap detection method, overlap detection device, electronic equipment and storage medium Pending CN115222867A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210778651.8A CN115222867A (en) 2022-06-30 2022-06-30 Overlap detection method, overlap detection device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210778651.8A CN115222867A (en) 2022-06-30 2022-06-30 Overlap detection method, overlap detection device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115222867A true CN115222867A (en) 2022-10-21

Family

ID=83609897

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210778651.8A Pending CN115222867A (en) 2022-06-30 2022-06-30 Overlap detection method, overlap detection device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115222867A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118154748A (en) * 2024-05-11 2024-06-07 山东捷瑞数字科技股份有限公司 Multi-model overlap detection early warning method and system based on three-dimensional engine

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118154748A (en) * 2024-05-11 2024-06-07 山东捷瑞数字科技股份有限公司 Multi-model overlap detection early warning method and system based on three-dimensional engine

Similar Documents

Publication Publication Date Title
CN112138386A (en) Volume rendering method and device, storage medium and computer equipment
EP4290464A1 (en) Image rendering method and apparatus, and electronic device and storage medium
CN111445563A (en) Image generation method and related device
CN112717414A (en) Game scene editing method and device, electronic equipment and storage medium
CN112750190B (en) Three-dimensional thermodynamic diagram generation method, device, equipment and storage medium
CN115222867A (en) Overlap detection method, overlap detection device, electronic equipment and storage medium
CN117455753B (en) Special effect template generation method, special effect generation device and storage medium
CN113645476A (en) Picture processing method and device, electronic equipment and storage medium
CN112734900A (en) Baking method, baking device, baking equipment and computer-readable storage medium of shadow map
CN116212374A (en) Model processing method, device, computer equipment and storage medium
CN113350792B (en) Contour processing method and device for virtual model, computer equipment and storage medium
CN114663560A (en) Animation realization method and device of target model, storage medium and electronic equipment
CN114266849A (en) Model automatic generation method and device, computer equipment and storage medium
CN113797531A (en) Method and device for realizing occlusion rejection, computer equipment and storage medium
CN115880402A (en) Flow animation generation method and device, electronic equipment and readable storage medium
CN114972701A (en) Method and device for determining post-processing area, computer equipment and storage medium
US20240257436A1 (en) Image rendering method and apparatus, electronic device, and storage medium
CN116310038A (en) Model rendering method, device, electronic equipment and computer readable storage medium
CN114494551A (en) Three-dimensional model map processing method and device, computer equipment and storage medium
CN115712427A (en) Rectangular control rendering method and device, electronic equipment and storage medium
CN115564884A (en) Map processing method and device, computer equipment and storage medium
CN115984528A (en) Mapping generation method and device for virtual model, computer equipment and storage medium
CN115501589A (en) Model rendering method and device, electronic equipment and storage medium
CN116958429A (en) Virtual model generation method and device, computer equipment and storage medium
CN115845364A (en) Rendering method and device of virtual object, computer equipment and 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