Method, apparatus and device for moving a position applied to a geometric surface
By acquiring data information from particles and geometric models, the direction of downward flow of gravity in the plane is determined, the vertex closest to the direction of gravity in the triangular face where the particle is located is found, and its edges are split into N segments. This solves the problem of lacking high-precision surface movement of the triangular face of the geometric model in the existing technology, and achieves a high-precision fitting effect.
Patent Information
- Application Number
- CN202211520620.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-30
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2042-11-30
AI Technical Summary
There is a lack of high-precision solutions for moving triangular surfaces of geometric models in the current technology.
By acquiring data information from particles and geometric models, the direction of downward flow of gravity in the plane is determined. The vertex of the triangle containing the particle that is closest to the direction of gravity is found, and these two sides are divided into N segments. Based on the position of each segment vertex and the position and speed of the particle, the movement position of the particle in the next frame is determined.
It achieves high-precision motion tracking of the triangular surface of the fitted geometric model.
Smart Images

Figure CN115797441B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of this application relate to the field of data processing, and more particularly to methods, apparatuses, devices, and computer-readable storage devices for position movement applied to geometric surfaces. Background Technology
[0002] Real-time animation, also known as algorithmic animation, uses various algorithms to control the motion of moving objects. In real-time animation, the computer calculates and displays the animation effect simultaneously. Real-time animation generally does not involve large amounts of animation data; instead, it processes limited data rapidly and displays the results in real time. The response time of real-time animation is related to many factors, such as the computer's processing speed, hardware and software capabilities, the complexity of the scene, and the size of the screen. Game software predominantly uses real-time animation.
[0003] In the existing technology, there is no high-precision moving scheme for conforming to the triangular surface of the geometric model. Summary of the Invention
[0004] According to an embodiment of this application, a position movement scheme applied to a geometric surface is provided.
[0005] In a first aspect of this application, a method for position movement applied to a geometric surface is provided. The method includes:
[0006] Acquire data information about particles and geometric models;
[0007] Based on the data information of the particles and geometric model, the direction of downward flow of planar gravity is determined;
[0008] Based on the downward direction of gravity in the plane, determine the vertex of the triangular face where the particle is located that is closest to the direction of gravity;
[0009] Divide the two edges of the triangle that connect the vertex closest to the direction of gravity into N segments. Based on the position of each vertex and the position and speed of the particle, determine the particle's movement position in the next frame; N is a positive integer.
[0010] Furthermore, the data for the particle and geometric model includes:
[0011] Information on particle movement speed, particle position, and vertex information of the triangle facets of the particle's fit to the geometric model;
[0012] The center point of the triangular facet is the particle position.
[0013] Furthermore, determining the direction of downward flow of planar gravity based on the data information includes:
[0014] The orientation of the plane is determined based on the vertex and center point information of the triangle.
[0015] Based on the plane direction, the direction of downward flow of gravity in the plane is determined.
[0016] Further, determining the direction of downward flow of planar gravity based on the planar direction includes:
[0017] The normal direction of the plane is determined based on the direction from the center point of the triangle to any two vertices of the triangle.
[0018] Based on the normal direction and the direction of particle gravity, the direction of downward flow of gravity in the plane is determined.
[0019] Furthermore, determining the particle's movement position in the next frame based on the position of each vertex segment, as well as the particle's position and movement speed, includes:
[0020] Based on the coordinates of each vertex and the particle position, determine the position closest to the particle's movement position;
[0021] The particle's next frame position is determined based on the position closest to the particle's moving position, the particle's position, and the particle's moving speed.
[0022] Furthermore, it also includes:
[0023] If the particle moves beyond the range of the triangle in the next frame, the particle is moved to the edge of the triangle.
[0024] If the distance between the particle and any vertex of the triangle is less than a threshold, then traverse the triangle and search for the two triangles with the largest and second largest products between the vertex and the gravity point.
[0025] The particle's movement position in the next frame is determined based on the two triangles with the largest and second largest products between the vertex and the gravity point.
[0026] Furthermore, it also includes:
[0027] If the distance between the particle and any vertex of the triangle is greater than a threshold, then based on the triangle, query the adjacent triangles to determine the triangle with the same edge as the particle.
[0028] The movement position of the particle in the next frame is determined based on the triangular face that is the same as the edge where the particle is located.
[0029] In a second aspect of this application, a position moving device applied to a geometric surface is provided. The device includes:
[0030] The acquisition module is used to acquire data information about particles and geometric models.
[0031] The first determining module is used to determine the direction of the downward flow of gravity in the plane based on the data information of the particles and the geometric model;
[0032] The second determining module is used to determine the vertex of the triangular face where the particle is located that is closest to the direction of gravity, based on the downward flow direction of gravity in the plane;
[0033] The position determination module is used to divide the two edges connecting the vertex closest to the direction of gravity in the triangle into N segments, and determine the movement position of the particle in the next frame based on the position of each vertex, as well as the position and movement speed of the particle; N is a positive integer.
[0034] In a third aspect of this application, an electronic device is provided. The electronic device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the program to implement the method described above.
[0035] In a fourth aspect of this application, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the method according to the first aspect of this application.
[0036] The position movement method applied to a geometric surface provided in this application embodiment acquires data information of particles and geometric models; determines the downward flow direction of gravity in the plane based on the data information of particles and geometric models; determines the vertex of the triangular face where the particle is located that is closest to the direction of gravity based on the downward flow direction of gravity in the plane; divides the two edges of the triangular face that connect the vertex closest to the direction of gravity into N segments, and determines the movement position of the particle in the next frame based on the position of each segment vertex, as well as the position and movement speed of the particle; N is a positive integer, realizing high-precision movement tracking of the triangular face of the geometric model.
[0037] It should be understood that the description in the Summary Section is not intended to limit the key or essential features of the embodiments of this application, nor is it intended to restrict the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description
[0038] The above and other features, advantages, and aspects of the embodiments of this application will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:
[0039] Figure 1 A flowchart illustrating a position movement method applied to a geometric surface according to an embodiment of this application is shown;
[0040] Figure 2 A block diagram of a position moving device applied to a geometric surface according to an embodiment of this application is shown;
[0041] Figure 3 A schematic diagram of a terminal device or server suitable for implementing embodiments of this application is shown. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0043] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0044] Figure 1 A flowchart of a position movement method applied to a geometric surface according to an embodiment of the present disclosure is shown. The method includes:
[0045] S110 acquires data information about particles and geometric models.
[0046] The method disclosed herein is implemented using UEniagara.
[0047] In some embodiments, the data for the particle and geometry model includes:
[0048] Information on particle movement speed, particle position, and vertex information of the triangle facets of the particle's fit to the geometric model;
[0049] The center point of the triangular facet is the particle position.
[0050] Furthermore, examples are provided to illustrate the data for the aforementioned particles and geometric models:
[0051] Ver0Dot is the dot product of vertex X0-P and the direction of gravity (Ver1Dot and Ver2Dot are similar);
[0052] StartVertex0 is the vertex index (StartVertex1 and StartVertex2 are similar);
[0053] Position000 is the vertex position;
[0054] Dirtion0 is the direction of the X0-P vector;
[0055] StartTri_Index is the triangular face index;
[0056] Valid is a boolean indicating whether to use the current query.
[0057] Furthermore, the data of the geometric model includes a large amount of vertex information.
[0058] S120, based on the data information of the particles and geometric model, determine the direction of the downward flow of gravity in the plane.
[0059] In some embodiments, the planar orientation is calculated based on the positions of the three vertices. That is, the normal is obtained by performing a cross product of the directions from the center point of the triangle to any two vertices of the triangle using the IM Three PosSolve Plan Normal function.
[0060] Furthermore, if the product of the triangle face normal direction and the centroid direction is greater than a preset value (e.g., 0.35), it indicates that the directions are approximately parallel, triggering a drop bool.
[0061] In some embodiments, the direction of gravity with the largest dot product of the normal direction and the gravity direction is calculated based on the normal direction and the gravity direction. That is, according to the left-hand screw rule, assuming Gravity_dir = float3(0,0,-1) and Plan_Normal is 0,1,0, then the cross product of gravity and the plane normal is 1,0,0; 0,1,0 cross product of 1,0,0 = (0,0,-1) == Plan_Down_Dir; where Plan_Down_Dir is the downward flow direction of gravity on the plane.
[0062] S130, based on the downward flow direction of gravity in the plane, determine the vertex of the triangular face where the particle is located that is closest to the direction of gravity.
[0063] In some embodiments, the product of the vector from the particle position to the vertex and Plan_Dorwn_dir is calculated respectively, and the vertex with the largest dot product with Plan_Dorwn_dir is determined. This vertex is the vertex closest to the direction of gravity in the triangle (the two comparisons of Ver0Dot and StartVertex0 and Position0 are definitely the vertices closest to the direction of gravity).
[0064] S140, divide the two edges of the triangle face that connect the vertex closest to the direction of gravity into N segments, and determine the movement position of the particle in the next frame based on the position of each vertex and the position and movement speed of the particle; N is a positive integer.
[0065] In some embodiments, the two sides of the triangular face that connect the vertex closest to the direction of gravity are divided into N equal segments, and the direction from the particle position to the vertex of each segment is calculated; N is a positive integer and can be determined according to the scaling ratio of the geometric model.
[0066] Furthermore, the direction from the particle's position to each vertex is multiplied by the downward direction of the plane to obtain the vertex with the largest multiplication result, and this vertex is used as the direction of movement.
[0067] Furthermore, based on the direction of movement, as well as the position and speed of the particle, the movement position of the particle in the next frame is determined.
[0068] In some embodiments, if the position of the particle in the next frame is outside the triangle, that is, the particle's next frame is outside the range of the triangle, then the particle is moved to the edge of the triangle.
[0069] If the distance between the particle and any vertex of the triangle is less than a threshold, then traverse the triangle and search for the two triangles with the largest and second largest products between the vertex and the gravity point.
[0070] The particle's movement position in the next frame is determined based on the two triangles with the largest and second largest products between the vertex and the gravity point.
[0071] If the distance between the particle and any vertex of the triangle is greater than a threshold, then based on the triangle, query the adjacent triangles to determine the triangle with the same edge as the particle.
[0072] The movement position of the particle in the next frame is determined based on the triangular face that is the same as the edge where the particle is located.
[0073] According to the embodiments of this disclosure, the following technical effects are achieved:
[0074] It achieves high-precision motion tracking of the triangular surface of the fitted geometric model.
[0075] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0076] The above is an introduction to the method embodiments. The following describes the solution described in this application through device embodiments.
[0077] Figure 2A block diagram of a position moving device 200 applied to a geometric surface according to an embodiment of this application is shown as follows. Figure 2 As shown, the device 200 includes:
[0078] Acquisition module 210 is used to acquire data information of particles and geometric models;
[0079] The first determining module 220 is used to determine the direction of the downward flow of gravity in the plane based on the data information of the particles and the geometric model;
[0080] The second determining module 230 is used to determine the vertex of the triangular face where the particle is located that is closest to the direction of gravity, based on the downward flow direction of gravity in the plane.
[0081] The position determination module 240 is used to divide the two edges connecting the vertex closest to the direction of gravity in the triangular face into N segments, and determine the movement position of the particle in the next frame based on the position of each vertex, as well as the position and movement speed of the particle; N is a positive integer.
[0082] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the described module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0083] Figure 3 A schematic diagram of a terminal device or server suitable for implementing embodiments of this application is shown.
[0084] like Figure 3 As shown, the terminal device or server 300 includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage section 308 into a random access memory (RAM) 303. The RAM 303 also stores various programs and data required for the operation of the system 300. The CPU 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0085] The following components are connected to I / O interface 305: an input section 306 including a keyboard, mouse, etc.; an output section 307 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 310 is also connected to I / O interface 305 as needed. A removable medium 311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 310 as needed so that computer programs read from it can be installed into storage section 308 as needed.
[0086] Specifically, according to embodiments of this application, the above method flow steps can be implemented as a computer software program. For example, embodiments of this application include a computer program product comprising a computer program carried on a machine-readable medium, the computer program containing program code for performing the methods shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by central processing unit (CPU) 301, it performs the functions defined in the system of this application.
[0087] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0088] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0089] The units or modules described in the embodiments of this application can be implemented in software or hardware. The described units or modules can also be located in a processor. The names of these units or modules do not, in certain circumstances, constitute a limitation on the unit or module itself.
[0090] In another aspect, this application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable storage medium stores one or more programs that, when used by one or more processors, execute the methods described in this application.
[0091] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the foregoing application concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions claimed in this application.
Claims
1. A method for position movement applied to a geometric surface, characterized in that, include: Acquire data information about particles and geometric models; Based on the data information of the particles and geometric model, the direction of downward flow of planar gravity is determined; Based on the downward direction of gravity in the plane, determine the vertex of the triangular face where the particle is located that is closest to the direction of gravity; Divide the two edges of the triangle face that connect the vertex closest to the direction of gravity into N segments. Based on the position of each vertex segment, as well as the position and speed of the particle, determine the particle's movement position in the next frame; N is a positive integer. The data information of the particles and geometric models includes: Information on particle movement speed, particle position, and vertex information of the triangle facets of the particle's fit to the geometric model; The center point of the triangular facet is the particle position; Determining the direction of downward flow of planar gravity based on the data information includes: The orientation of the plane is determined based on the vertex and center point information of the triangle. Based on the aforementioned planar orientation, the direction of downward flow of planar gravity is determined; Determining the direction of downward flow of gravity in the plane based on the plane direction includes: The normal direction of the plane is determined based on the direction from the center point of the triangle to any two vertices of the triangle. Based on the normal direction and the direction of particle gravity, the direction of downward flow of gravity in the plane is determined.
2. The method according to claim 1, characterized in that, Determining the particle's movement position in the next frame based on the position of each vertex segment, as well as the particle's position and movement speed, includes: Based on the coordinates of each vertex and the particle position, determine the position closest to the particle's movement position; The particle's next frame position is determined based on the position closest to the particle's moving position, the particle's position, and the particle's moving speed.
3. The method according to claim 2, characterized in that, Also includes: If the particle moves beyond the range of the triangle in the next frame, the particle is moved to the edge of the triangle. If the distance between the particle and any vertex of the triangle is less than a threshold, then traverse the triangle and search for the two triangles with the largest and second largest products between the vertex and the gravity point. The particle's movement position in the next frame is determined based on the two triangles with the largest and second largest products between the vertex and the gravity point.
4. The method according to claim 3, characterized in that, Also includes: If the distance between the particle and any vertex of the triangle is greater than a threshold, then based on the triangle, query the adjacent triangles to determine the triangle with the same edge as the particle. The movement position of the particle in the next frame is determined based on the triangular face that is the same as the edge where the particle is located.
5. A positioning device applied to a geometric surface, characterized in that, include: The acquisition module is used to acquire data information about particles and geometric models. The first determining module is used to determine the direction of the downward flow of gravity in the plane based on the data information of the particles and the geometric model; The second determining module is used to determine the vertex of the triangular face where the particle is located that is closest to the direction of gravity, based on the downward flow direction of gravity in the plane; The position determination module is used to divide the two edges connecting the vertex closest to the direction of gravity in the triangular face into N segments, and determine the movement position of the particle in the next frame based on the position of each vertex, as well as the position and movement speed of the particle; N is a positive integer; The data information of the particles and geometric models includes: Information on particle movement speed, particle position, and vertex information of the triangle facets of the particle's fit to the geometric model; The center point of the triangular facet is the particle position; Determining the direction of downward gravitational flow in the plane based on the data information from the particles and geometric model includes: The orientation of the plane is determined based on the vertex and center point information of the triangle. Based on the aforementioned planar orientation, the direction of downward flow of planar gravity is determined; Determining the direction of downward flow of gravity in the plane based on the plane direction includes: The normal direction of the plane is determined based on the direction from the center point of the triangle to any two vertices of the triangle. Based on the normal direction and the direction of particle gravity, the direction of downward flow of gravity in the plane is determined.
6. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 4.
7. A computer-readable storage device having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
An algorithm for moving along the surface of a three-dimensional model based on triangle adjacency information
CN109191551A
Animation generation method, animation playing method and related devices
CN112037311A