Data processing method and device, electronic equipment and storage medium

By obtaining and updating the moving position of the target model and performing model motion according to the safe distance conditions, the time-consuming problem of setting up complex colliders in the prior art is solved, and the real physical effect of the rapid simulation model is achieved.

CN119992021APending Publication Date: 2025-05-13NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411930768.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

When simulating model motion, the prior art requires the installation of complex colliders, which leads to cumbersome and time-consuming operations, making it difficult to quickly achieve real physical effects.

Method used

By obtaining the model vertex and initial vertex parameters of the target model, physical motion simulation is performed, the reference point position is determined, and the motion position is updated according to the safe distance conditions to achieve safe motion of the model.

Benefits of technology

It reduces the time it takes to simulate the effect of the model during movement, avoids the time cost of using the collider, and improves the physical effect performance and accuracy of the model in virtual scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119992021A_ABST
    Figure CN119992021A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device, electronic equipment and a computer readable storage medium, and the method comprises the steps: obtaining a to-be-moved target model, wherein the target model comprises a plurality of model vertexes; acquiring initial vertex parameters of the model vertexes, and performing physical motion simulation on the model vertexes based on the initial vertex parameters to obtain motion positions of the model vertexes; determining a reference point position corresponding to the model vertex based on the initial vertex parameter; if the distance between the motion position and the reference point position does not meet the safe distance condition corresponding to the reference point position, updating the motion position to obtain a target position of which the model vertex meets the safe distance condition; and controlling the target model to move based on the target position of the model vertex. According to the embodiment of the invention, the time for simulating the effect of the model during movement can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a data processing method, device, electronic device and storage medium. Background Art

[0002] Under the tide of the Internet, entertainment projects are becoming more and more important in people's lives. In order to meet the needs of scene effect presentation in some entertainment projects (such as animated movies and games), it is necessary to set some collision bodies on the models in the scene, such as spheres, capsules, etc., so that in actual operation, the collision effect of the model can be realized by collision detection between collision bodies, so as to simulate the deformation that may occur when the model is hit, so as to enable the model to present more realistic physical effects in the game.

[0003] Currently, when setting a collision body for a character, the size and position of the collision body need to be set, which is a relatively complicated operation. As a result, it takes a lot of time to simulate the effect of the model when it is in motion, such as when it is hit by a collision. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, device, electronic device and storage medium, which can reduce the time required to simulate the effect of a model in motion.

[0005] In a first aspect, an embodiment of the present application provides a data processing method, the method comprising:

[0006] Acquire a target model to be moved, wherein the target model includes a plurality of model vertices;

[0007] Acquire initial vertex parameters of the model vertices, and perform physical motion simulation on the model vertices based on the initial vertex parameters to obtain motion positions of the model vertices;

[0008] Based on the initial vertex parameters, determine the reference point position corresponding to the model vertex;

[0009] If the distance between the moving position and the reference point position does not meet the safety distance condition corresponding to the reference point position, the moving position is updated to obtain the target position of the model vertex that meets the safety distance condition;

[0010] Based on the target positions of the vertices of the model, the target model is controlled to move.

[0011] In a second aspect, an embodiment of the present application provides a data processing device, the device comprising:

[0012] A model acquisition module, used to acquire a target model to be moved, wherein the target model includes a plurality of model vertices;

[0013] A parameter acquisition module, used to acquire initial vertex parameters of the above-mentioned model vertices, and based on the above-mentioned initial vertex parameters, perform physical motion simulation on the above-mentioned model vertices to obtain the motion positions of the above-mentioned model vertices;

[0014] A position determination module, used to determine the reference point position corresponding to the above model vertex based on the above initial vertex parameters;

[0015] A position updating module, for updating the above-mentioned moving position if the distance between the above-mentioned moving position and the above-mentioned reference point position does not meet the safety distance condition corresponding to the above-mentioned reference point position, so as to obtain the target position of the above-mentioned model vertex that meets the safety distance condition;

[0016] The model motion module is used to control the movement of the target model based on the target position of the model vertices.

[0017] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory storing a plurality of instructions; a processor loads instructions from the memory to execute the steps of any data processing method provided in the embodiment of the present application.

[0018] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a plurality of instructions, and the instructions are suitable for a processor to load to execute the steps of any data processing method provided in the embodiment of the present application.

[0019] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the steps of any data processing method provided in the embodiment of the present application.

[0020] By adopting the scheme of the embodiment of the present application, a target model to be moved including multiple model vertices can be obtained, and then the initial vertex parameters of the above-mentioned model vertices are obtained, and based on the above-mentioned initial vertex parameters, the physical motion simulation of the above-mentioned model vertices is performed to obtain the movement position of the above-mentioned model vertices, and then based on the above-mentioned initial vertex parameters, the reference point position corresponding to the above-mentioned model vertex is determined, and a judgment is made based on the reference point position. If the distance between the above-mentioned movement position and the above-mentioned reference point position does not meet the safety distance condition corresponding to the above-mentioned reference point position, the above-mentioned movement position is updated to obtain the target position of the above-mentioned model vertex that meets the safety distance condition. Finally, based on the target position of the above-mentioned model vertex, the above-mentioned target model is controlled to move, so as to obtain the position of the model vertex of the model when it is in motion by directly judging the movement position of the model vertex and updating the movement position of the model vertex when the movement position does not meet the corresponding safety distance condition, so as to avoid the time required to use the collision body, so as to reduce the time required to simulate the effect of the model when it is in motion. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 It is a schematic diagram of an embodiment of the data processing method provided in the embodiments of the present application;

[0023] Figure 2 is a schematic diagram of a hair model provided in an embodiment of the present application;

[0024] Figure 3 is a schematic diagram of reference point positions provided in an embodiment of the present application;

[0025] Figure 4 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;

[0026] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application. At the same time, in the description of the embodiments of the present application, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0028] Embodiments of the present application provide a data processing method, device, electronic device, and computer-readable storage medium.

[0029] Specifically, this embodiment will be described from the perspective of a data processing device, which can be integrated into an electronic device, that is, the data processing method of the embodiment of the present application can be executed by an electronic device, and optionally, the electronic device can include: a terminal device. The terminal device can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, a game console, or a personal computer (PC) and other devices.

[0030] The data processing method provided in the embodiment of the present application can be applied to a data processing system. The data processing system may include a player terminal device and a server, and the terminal may be a device including both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. The player terminal device and the server may perform two-way communication via a network.

[0031] Optionally, the server may be an independent server, or a server network or server cluster composed of servers, including but not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server composed of multiple servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.

[0032] The following is a detailed description in conjunction with the accompanying drawings. In this embodiment, the execution subject is a terminal device as an example. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments. Although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that shown in the accompanying drawings.

[0033] The data processing method of this embodiment obtains a target model to be moved, wherein the target model includes multiple model vertices; obtains initial vertex parameters of the model vertices, and based on the initial vertex parameters, performs physical motion simulation on the model vertices to obtain the movement positions of the model vertices; based on the initial vertex parameters, determines the reference point positions corresponding to the model vertices; if the distance between the movement position and the reference point position does not meet the safety distance condition corresponding to the reference point position, updates the movement position to obtain the target position of the model vertex that meets the safety distance condition; based on the target position of the model vertex, controls the target model to move, which can reduce the time required to simulate the effect of the model in motion.

[0034] Please refer to Figure 1 Taking a terminal as an example, this embodiment provides a data processing method. The specific process of the data processing method can be as follows: Step 101 to Step 105, wherein:

[0035] Step 101: Obtain a target model to be moved, wherein the target model includes a plurality of model vertices.

[0036] Among them, the above-mentioned target model is a model that needs to move in the virtual scene. For example, the target model can be a cloth model such as a character's clothing, a scene curtain, etc. The target model can have multiple model vertices, and the vertex positions of at least some of the model vertices change to prompt the target model to appear to move in the virtual scene.

[0037] It should be noted that, since the target model is generally driven to move by the model joints of the target model when it moves in the virtual scene, at least some of the above-mentioned multiple model vertices are located on the model joints of the target model, so that the movement position of the model parts associated with the model joints in the target model can be obtained by calculating the movement position of the model joints of the target model.

[0038] For example, if the target model is a character costume, the model joints may be clothing areas such as hands, feet, arms, etc. in the character costume.

[0039] In this embodiment, the terminal can provide a game engine to simulate and calculate the movement and collision effects of the target model in the game engine. For example, when the target model is a cloth model, the terminal can solve the real-time collision through the cloth to simulate the deformation of the cloth model when it is hit, so that the cloth model can present a more realistic physical effect in the virtual scene.

[0040] Step 102: Acquire initial vertex parameters of the model vertices, and perform physical motion simulation on the model vertices based on the initial vertex parameters to obtain motion positions of the model vertices.

[0041] The above-mentioned initial vertex parameters are used to indicate the relevant parameters of the model vertex on the target model, and the initial vertex parameters include but are not limited to the initial position, vertex normal, initial motion speed, etc. The above-mentioned initial position can be presented in the form of coordinates, the above-mentioned vertex normal can be presented in the form of a vector, and the above-mentioned vertex normal can be presented in the form of the vertical component of the vertex normal on different coordinate axes, which can be set according to the needs and are not limited here.

[0042] For example, the above vertex normal can be described as (A, B, C), where A, B, and C are the vertical components of the vertex normal on different coordinate axes, respectively.

[0043] The above-mentioned movement position refers to the position of the model vertex after movement.

[0044] In this embodiment, the terminal obtains initial vertex parameters of the model vertices, and uses the initial vertex parameters to perform physical motion simulation on the motion of the model vertices in the virtual scene to obtain the motion positions of the model vertices.

[0045] In some embodiments, since the above-mentioned initial vertex parameters may include vertex normals, the vertex normals may be used to judge the safety conditions of the calculated motion positions of the model vertices. Since the target model may be driven to move by the model joints when it moves, and at least some of the above-mentioned multiple model vertices are located on the model joints of the target model, the normals of the model vertices may be adjusted based on the model joints of the target model.

[0046] Specifically, when the above-mentioned target model includes a model joint and the above-mentioned model vertex is on the above-mentioned model joint, the above-mentioned acquisition of the initial vertex parameters of the above-mentioned model vertex may include: the terminal may generate the initial normal of the above-mentioned model vertex based on the model surface where the model vertex is located on the target model, and then the terminal may adjust the direction of the above-mentioned initial normal based on the joint position of the above-mentioned model joint to obtain the vertex normal of the above-mentioned model vertex.

[0047] Among them, the terminal can adjust the normal direction of the initial normal of the model vertex to be outward along the center of the model joint based on the center position of the model joint, so as to obtain the vertex normal of the model vertex after the direction is adjusted.

[0048] Specifically, the terminal may use a game engine or digital content creation software (Digital Content Creation, DCC) to adjust the normal direction of the initial normal.

[0049] For example, Figure 2 The vertex normals of the hair model are shown pointing outward from the center of the model joint of the hair model.

[0050] In some embodiments, the terminal may use a physical simulation method to simulate the physical motion of the model vertices, such as using a position-based dynamics (PBD) algorithm, which is a simulation algorithm based on the physical behavior and motion of the object. The principle of the PBD algorithm is to directly control the position of the particle and simulate the model motion based on at least one corresponding function that constrains the position and rotation.

[0051] Specifically, the above-mentioned initial vertex parameters include an initial position and an initial movement speed. The above-mentioned physical movement simulation of the above-mentioned model vertices based on the above-mentioned initial vertex parameters to obtain the movement position of the above-mentioned model vertices may include: the terminal may obtain the environmental parameters of the environment in which the above-mentioned target model is located, and then the terminal may attenuate the above-mentioned initial movement speed based on the above-mentioned environmental parameters to obtain the target movement speed of the above-mentioned model vertices. Finally, the terminal may simulate the movement position of the above-mentioned model vertices based on the above-mentioned initial position and the above-mentioned target movement speed.

[0052] The above environmental parameters include, but are not limited to, gravity parameters, air resistance parameters, mass parameters, position parameters of other collision bodies in the environment, etc.

[0053] Optionally, the terminal may also perform constraint calculation on the movement positions of the model vertices to further restrict the movement positions of the model vertices, thereby obtaining the final movement positions of the model vertices.

[0054] In some embodiments, the above-mentioned physical motion simulation of the above-mentioned model vertices based on the above-mentioned initial vertex parameters to obtain the motion position of the above-mentioned model vertices may include: the terminal may obtain the motion direction of the above-mentioned target model, and then the terminal may simulate the motion position of the above-mentioned model vertices based on the above-mentioned motion direction, the above-mentioned initial position and the above-mentioned target motion speed.

[0055] Step 103: Based on the initial vertex parameters, determine the reference point position corresponding to the model vertex.

[0056] In this embodiment, the terminal can obtain a reference point for judging the movement position of the model vertex based on the initial vertex parameters of the model vertex, so as to clarify whether the movement position of the model vertex is safe or whether there is an abnormal risk based on the reference point position corresponding to the reference point, that is, the movement position of the model vertex can be restricted based on the reference point position.

[0057] In some embodiments, since the above-mentioned initial vertex parameters may include an initial position, determining the reference point position corresponding to the above-mentioned model vertex based on the above-mentioned initial vertex parameters may include: using the above-mentioned initial position as the above-mentioned reference point position, thereby judging whether the moving position of the model vertex is safe based on the initial position of the model vertex, that is, clarifying whether the movement of the model vertex is safe.

[0058] In some embodiments, when the target model is cloth or other model that needs to have a binding relationship with another model, such as when the cloth model is a virtual garment, the cloth model needs to have a binding relationship with the character model. Therefore, the terminal needs to set anti-collision reference points for the model vertices to judge the model vertices based on the anti-collision reference points to avoid the model vertices from penetrating the model when moving, such as the cloth model passing through the body area of ​​the character model when moving.

[0059] Among them, the reference point position of the anti-collision reference point of the model vertex can be inferred according to the discovery direction of the model vertex to limit the moving distance of the model vertex.

[0060] Specifically, the above-mentioned initial vertex parameters may include an initial position and a vertex normal. The above-mentioned determination of the reference point position corresponding to the above-mentioned model vertex based on the above-mentioned initial vertex parameters may include: the terminal may normalize the above-mentioned vertex normal to obtain a target normal vector, and then the terminal may determine the reference point position of the anti-collision reference point corresponding to the above-mentioned model vertex based on the above-mentioned initial position, the above-mentioned target normal vector and a preset reverse stop distance value.

[0061] The normalization is to divide a vector by its modulus (length) so that the length of the vector becomes 1. In addition, the terminal may use a normalize function to normalize the vertex normal to obtain a target normal vector.

[0062] For example, if the normal direction of the vertex normal in the world space can be described as (A, B, C), and A, B and C are the vertical components of the vertex normal on different coordinate axes, then the length of the vertex normal vector can be calculated, and then (A, B, C) can be divided by the length to obtain the normalized target normal vector to obtain a world space normal vector with a length of 1.

[0063] Among them, the above-mentioned preset stop distance value can be obtained based on the size of the anti-collision body indicated by the user for the anti-collision point reference point, and the preset safety defense distance between the anti-collision bodies. By setting the size of the anti-collision body, the user can more intuitively control and adjust the reference point position and related parameters.

[0064] The size of the anti-collision body may be the radius of the anti-collision body, the maximum distance from the center to the edge of the anti-collision body, etc., which may be specifically set according to the shape of the anti-collision body and is not limited here.

[0065] Specifically, the terminal may calculate the sum of the size of the anti-collision body and the safety defense distance as the preset backstop distance value.

[0066] For example, if the anti-collision body is set to be a sphere, the radius of the anti-collision body is Backstop Radius, and the safety defense distance is Backstop Distance, then the preset backstop distance value may be Backstop Radius+Backstop Distance.

[0067] Specifically, the above-mentioned determination of the reference point position of the anti-collision reference point corresponding to the above-mentioned model vertex based on the above-mentioned initial position, the above-mentioned target normal vector and the preset backstop distance value may include: the terminal may calculate the second product between the above-mentioned target normal vector and the above-mentioned preset backstop distance value, so as to use the difference between the above-mentioned initial position and the above-mentioned second product as the reference point position of the above-mentioned anti-collision reference point.

[0068] Exemplarily, if the initial position is set to pointA and the target normal vector is normalDirWS, then the reference point position of the anti-collision reference point may be pointA-normalDirWS*preset backstop distance value.

[0069] Step 104: If the distance between the moving position and the reference point position does not meet the safety distance condition corresponding to the reference point position, the moving position is updated to obtain the target position of the model vertex that meets the safety distance condition.

[0070] In this embodiment, the terminal determines whether the distance between the moving position of the model vertex and the reference point position obtained above meets the corresponding safety distance conditions to determine whether the moving position of the model vertex needs to be updated. That is, if the distance between the moving position of the model vertex and the reference point position obtained above meets the corresponding safety distance conditions, it means that the movement of the model vertex is safe and there is no need to update the moving position of the model vertex; if the distance between the moving position of the model vertex and the reference point position obtained above does not meet the corresponding safety distance conditions, it means that the movement of the model vertex is unsafe, so the moving position of the model vertex needs to be updated to obtain the target position of the model vertex that meets the safety distance conditions.

[0071] In some embodiments, when the above-mentioned initial position is used as the reference point position, the distance between the above-mentioned moving position and the above-mentioned reference point position does not meet the safety distance condition corresponding to the above-mentioned reference point position, which may include: the distance between the above-mentioned moving position and the above-mentioned initial position is greater than the preset target safety distance.

[0072] For example, Figure 3As shown, the initial position can be set as pointA, the moving position as pointA1, and the preset target safety distance as MaxDistance. Then, the distance between pointA and pointA1 is calculated to compare the distance between pointA and pointA1 with MaxDistance, so as to determine whether the distance between the moving position and the initial position meets the safety distance condition corresponding to the initial position. Figure 3 pointA1 is not shown.

[0073] Among them, if the distance is less than or equal to MaxDistance, it means that the distance between the above-mentioned moving position and the above-mentioned initial position meets the safety distance condition corresponding to the above-mentioned initial position; if the distance is greater than MaxDistance, it means that the distance between the above-mentioned moving position and the above-mentioned initial position does not meet the safety distance condition corresponding to the above-mentioned initial position.

[0074] The terminal may use the Distance function to calculate the distance between pointA and pointA1, that is, use Distance(pointA, pointA1) to obtain the distance between pointA and pointA1.

[0075] In some embodiments, when the reference point position of the above-mentioned anti-collision reference point is used as the reference point position, the distance between the above-mentioned motion position and the above-mentioned reference point position does not meet the safety distance condition corresponding to the above-mentioned reference point position, which may include: the distance between the above-mentioned motion position and the reference point position of the above-mentioned anti-collision reference point is less than the above-mentioned preset stop distance value.

[0076] For example, Figure 3 As shown, the motion position can be set as pointA1, the reference point position of the anti-collision reference point can be set as pointB, the preset backstop distance value is Backstop Radius+Backstop Distance, and then the distance between pointA1 and pointB is calculated to judge the distance between pointA1 and pointB with Backstop Radius+BackstopDistance, so as to clarify whether the distance between the above motion position and the reference point position of the above anti-collision reference point meets the safety distance condition corresponding to the reference point position of the above anti-collision reference point.

[0077] Among them, if the distance is less than Backstop Radius + Backstop Distance, it means that the distance between the above-mentioned moving position and the reference point position of the above-mentioned anti-collision reference point does not meet the safety distance condition corresponding to the reference point position of the above-mentioned anti-collision reference point; and if the distance is greater than or equal to Backstop Radius + Backstop Distance, it means that the distance between the above-mentioned moving position and the reference point position of the above-mentioned anti-collision reference point meets the safety distance condition corresponding to the reference point position of the above-mentioned anti-collision reference point.

[0078] The terminal may use the Distance function to calculate the distance between pointA1 and pointB, that is, use Distance(pointA1, pointB) to obtain the distance between pointA1 and pointB.

[0079] In some embodiments, the above-mentioned updating of the above-mentioned moving position to obtain the target position of the above-mentioned model vertex that meets the safety distance condition may include: the terminal may obtain the positional relationship between the above-mentioned moving position and the above-mentioned reference point position, and then the terminal may update the above-mentioned moving position based on the above-mentioned positional relationship and the above-mentioned safety distance condition to obtain the target position of the above-mentioned model vertex.

[0080] Among them, the above-mentioned position relationship can be the direction vector between the above-mentioned movement position and the above-mentioned reference point position, the distance between the above-mentioned movement position and the above-mentioned reference point position, etc., which can be set specifically according to needs and is not limited here.

[0081] In some embodiments, when the above-mentioned initial position is used as the reference point position, the above-mentioned obtaining of the positional relationship between the above-mentioned moving position and the above-mentioned reference point position may include: the terminal may obtain a first direction vector between the above-mentioned moving position and the above-mentioned initial position, and then, the terminal may normalize the above-mentioned first direction vector to obtain a normalized first target direction vector, and the above-mentioned first target direction vector is used to indicate the positional relationship between the above-mentioned moving position and the above-mentioned initial position.

[0082] The terminal may obtain the first direction vector by calculating the difference between the moving position and the initial position.

[0083] Exemplarily, the terminal may use the normalize function to normalize the first direction vector. If the initial position is set to pointA, the moving position is pointA1, and the first direction vector between pointA and pointA1 is pointA1-pointA, then normalize(pointA1-pointA) may be used to obtain the normalized first target direction vector.

[0084] In some embodiments, the above-mentioned moving position is updated based on the above-mentioned position relationship and the above-mentioned safety distance condition to obtain the target position of the above-mentioned model vertex, which may include: the terminal may calculate the first product between the above-mentioned first target direction vector and the above-mentioned preset target safety distance, and then the terminal may use the sum of the above-mentioned initial position and the above-mentioned first product as the target position of the above-mentioned model vertex, so that the target position of the model vertex can be limited to a safety range with the initial position as the center and the preset target safety distance as the radius.

[0085] Exemplarily, if the initial position is set to pointA, the first target direction vector obtained based on the normalize function is pointA1ADir, and the preset target safety distance is MaxDistance, then the target position can be pointA+pointA1Adir*MaxDistance.

[0086] In some embodiments, when the reference point position of the anti-collision reference point is used as the reference point position, the above-mentioned acquisition of the positional relationship between the above-mentioned motion position and the above-mentioned reference point position may include: the terminal may acquire a second direction vector between the above-mentioned motion position and the reference point position of the above-mentioned anti-collision reference point, and then the terminal may normalize the above-mentioned second direction vector to obtain a normalized second target direction vector, and the above-mentioned second target direction vector is used to indicate the positional relationship between the above-mentioned motion position and the reference point position of the above-mentioned anti-collision reference point.

[0087] The terminal may obtain the second direction vector by calculating the difference between the motion position and the reference point position of the anti-collision reference point.

[0088] Exemplarily, the terminal can use the normalize function to normalize the above-mentioned second direction vector. If the motion position is set to pointA1, the reference point position of the above-mentioned anti-collision reference point is pointB, and the second direction vector between pointA1 and pointB is pointA1-pointB, then normalize(pointA1-pointB) can be used to obtain the normalized second target direction vector.

[0089] In some embodiments, the above-mentioned motion position is updated based on the above-mentioned position relationship and the above-mentioned safety distance condition to obtain the target position of the above-mentioned model vertex, which may include: the terminal may calculate the third product between the above-mentioned second target direction vector and the above-mentioned preset stop distance value, and then the terminal may use the sum of the reference point position of the above-mentioned anti-collision reference point and the above-mentioned third product as the target position of the above-mentioned model vertex, so that the target position of the model vertex can be limited to outside the range with the reference point position of the anti-collision reference point as the center of the circle and the preset stop distance value as the radius.

[0090] Exemplarily, if the reference point position of the anti-collision reference point is set to pointB, the second target direction vector is pointA1BDir, and the preset backstop distance value is Backstop Radius+Backstop Distance, then the target position may be pointB+pointA1BDir*(Backstop Radius+Backstop Distance).

[0091] In some embodiments, when the initial position and the reference point position of the anti-collision reference point are both used as the reference point position, the terminal may first judge the motion position based on the initial position to determine whether to update the motion position based on the judgment result, and obtain the motion position after the first processing, which may be an updated motion position or an unupdated motion position. Then, the terminal judges the motion position after the first processing based on the reference point position of the anti-collision reference point to determine whether to continue to update the motion position after the first processing based on the judgment result, thereby obtaining the target position of the model vertex.

[0092] For example, Figure 3 As shown, Figure 3 PointA and pointB in are both reference points. Figure 3 The position in is the reference point position, and the target position must be inside the solid circle with pointA as the center and outside the solid circle with pointB as the center.

[0093] Step 105: Based on the target positions of the vertices of the model, control the target model to move.

[0094] In this embodiment, the terminal does not need to set a collision body on the model in advance. Instead, during real-time movement, the terminal limits the movement distance and position of the model vertices through safety distance conditions to determine the target position of the model vertices, thereby controlling the movement of the target model based on the target position of each model vertex.

[0095] It is understandable that by calculating the safe movement position of the model vertices to drive the movement of the target model, the relevant staff is avoided from having to operate the complex process of setting up collision bodies on the target model in advance, thereby reducing the time required to simulate the effect of the model being hit. In addition, it also avoids the situation where the collision body cannot wrap the corresponding position of the model well, such as the main movement joints of the model, and avoids the accuracy and range required for collision detection of the collision body. This embodiment can handle more complex model collision effects, avoids the time cost of setting up collision bodies and debugging, and at the same time ensures the authenticity of the scene and improves the physical effect performance and accuracy of the model in the virtual scene.

[0096] In addition, in terms of performance, the more complex real-time collision detection calculations between vertices and collision bodies are reduced and replaced with simple coordinate position restrictions, which greatly reduces the performance consumption during the actual model operation (such as the cloth model during solution operation).

[0097] In some embodiments, the method may further include: if the distance between the moving position and the reference point position meets the safety distance condition corresponding to the reference point position, then based on the moving position, controlling the target model to move.

[0098] From the above content, it can be seen that by obtaining a target model to be moved that includes multiple model vertices, then obtaining the initial vertex parameters of the above model vertices, and based on the above initial vertex parameters, performing physical motion simulation on the above model vertices to obtain the movement positions of the above model vertices, and then based on the above initial vertex parameters, determining the reference point positions corresponding to the above model vertices, so as to make a judgment based on the reference point position, if the distance between the above movement position and the above reference point position does not meet the safety distance condition corresponding to the above reference point position, then updating the above movement position to obtain the target position of the above model vertex that meets the safety distance condition, and finally, based on the target position of the above model vertex, controlling the above target model to move, thereby directly judging the movement positions of the model vertices, and updating the movement positions of the model vertices when the movement positions do not meet the corresponding safety distance conditions, to obtain the positions of the model vertices of the model when in motion, which can avoid the time required to use collision bodies, thereby reducing the time required to simulate the effect of the model in motion.

[0099] This embodiment also provides a data processing device, which can be integrated into a terminal device. Figure 4 As shown, the data processing device may include:

[0100] A model acquisition module 401 is used to acquire a target model to be moved, wherein the target model includes a plurality of model vertices;

[0101] The parameter acquisition module 402 is used to acquire the initial vertex parameters of the model vertices, and based on the initial vertex parameters, perform physical motion simulation on the model vertices to obtain the motion positions of the model vertices;

[0102] A position determination module 403 is used to determine the reference point position corresponding to the above model vertex based on the above initial vertex parameters;

[0103] A position updating module 404 is used to update the moving position if the distance between the moving position and the reference point position does not meet the safety distance condition corresponding to the reference point position, so as to obtain a target position of the model vertex that meets the safety distance condition;

[0104] The model movement module 405 is used to control the target model to move based on the target positions of the model vertices.

[0105] In some embodiments, the initial vertex parameters include an initial position and an initial motion speed, and the parameter acquisition module 402 is specifically used to:

[0106] Obtain environmental parameters of the environment in which the target model is located;

[0107] Attenuating the initial motion speed based on the environmental parameters to obtain a target motion speed of the model vertex;

[0108] The movement position of the model vertex is simulated based on the initial position and the target movement speed.

[0109] In some embodiments, the initial vertex parameters include vertex normals, the target model includes model joints, the model vertices are located on the model joints, and the parameter acquisition module 402 is specifically used to:

[0110] Generate initial normals for the vertices of the above model;

[0111] Based on the joint positions of the model joints, the directions of the initial normals are adjusted to obtain vertex normals of the model vertices.

[0112] In some embodiments, the location updating module 404 is specifically used to:

[0113] Obtaining a positional relationship between the motion position and the reference point position;

[0114] Based on the above positional relationship and the above safety distance condition, the above motion position is updated to obtain the target position of the above model vertex.

[0115] In some embodiments, the initial vertex parameters include an initial position, and the position determination module 403 is specifically used to:

[0116] The above initial position is used as the above reference point position;

[0117] The distance between the above-mentioned moving position and the above-mentioned reference point position does not meet the safety distance condition corresponding to the above-mentioned reference point position, including: the distance between the above-mentioned moving position and the above-mentioned initial position is greater than the preset target safety distance.

[0118] In some embodiments, the location updating module 404 is specifically used to:

[0119] Obtaining a first direction vector between the moving position and the initial position;

[0120] The first direction vector is normalized to obtain a normalized first target direction vector, where the first target direction vector is used to indicate a positional relationship between the moving position and the initial position.

[0121] In some embodiments, the location updating module 404 is specifically used to:

[0122] Calculating a first product between the first target direction vector and the preset target safety distance;

[0123] The sum of the initial position and the first product is used as the target position of the model vertex.

[0124] In some embodiments, the initial vertex parameters include an initial position and a vertex normal, and the position determination module 403 is specifically used to:

[0125] Normalize the above vertex normals to obtain the target normal vector;

[0126] Based on the initial position, the target normal vector and the preset backstop distance value, the reference point position of the anti-collision reference point corresponding to the model vertex is determined.

[0127] In some embodiments, the location determination module 403 is specifically used to:

[0128] Calculating a second product between the target normal vector and the preset backstop distance value;

[0129] The difference between the initial position and the second product is used as the reference point position of the anti-collision reference point.

[0130] In some embodiments, the distance between the above-mentioned moving position and the above-mentioned reference point position does not meet the safety distance condition corresponding to the above-mentioned reference point position, including: the distance between the above-mentioned moving position and the reference point position of the above-mentioned anti-collision reference point is less than the above-mentioned preset stop distance value.

[0131] In some embodiments, the location updating module 404 is specifically used to:

[0132] Acquire a second direction vector between the motion position and the reference point position of the anti-collision reference point;

[0133] The second direction vector is normalized to obtain a normalized second target direction vector, where the second target direction vector is used to indicate a positional relationship between the motion position and a reference point position of the anti-collision reference point.

[0134] In some embodiments, the location updating module 404 is specifically used to:

[0135] Calculating a third product between the second target direction vector and the preset backstop distance value;

[0136] The sum of the reference point position of the anti-collision reference point and the third product is used as the target position of the model vertex.

[0137] In some embodiments, the data processing device further includes a model control module, and the model control module is specifically used to:

[0138] If the distance between the above-mentioned moving position and the above-mentioned reference point position meets the safety distance condition corresponding to the above-mentioned reference point position, the above-mentioned target model is controlled to move based on the above-mentioned moving position.

[0139] From the above content, it can be seen that by obtaining a target model to be moved that includes multiple model vertices, then obtaining the initial vertex parameters of the above model vertices, and based on the above initial vertex parameters, performing physical motion simulation on the above model vertices to obtain the movement positions of the above model vertices, and then based on the above initial vertex parameters, determining the reference point positions corresponding to the above model vertices, so as to make a judgment based on the reference point position, if the distance between the above movement position and the above reference point position does not meet the safety distance condition corresponding to the above reference point position, then updating the above movement position to obtain the target position of the above model vertex that meets the safety distance condition, and finally, based on the target position of the above model vertex, controlling the above target model to move, thereby directly judging the movement positions of the model vertices, and updating the movement positions of the model vertices when the movement positions do not meet the corresponding safety distance conditions, to obtain the positions of the model vertices of the model when in motion, which can avoid the time required to use collision bodies, thereby reducing the time required to simulate the effect of the model in motion.

[0140] Accordingly, an embodiment of the present application further provides an electronic device, which may be a terminal, and the terminal may be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA) and other terminal devices. Alternatively, the electronic device may be a server.

[0141] like Figure 5 As shown, Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer-readable storage media, and a computer program stored in the memory 502 and executable on the processor. The processor 501 is electrically connected to the memory 502. Those skilled in the art will appreciate that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or arrange components differently.

[0142] The processor 501 is the control center of the electronic device 500, and uses various interfaces and lines to connect various parts of the entire electronic device 500. By running or loading software programs and / or units stored in the memory 502, and calling data stored in the memory 502, the processor 501 executes various functions of the electronic device 500 and processes data, thereby monitoring the electronic device 500 as a whole. The processor 501 can be a central processing unit CPU, a graphics processing unit GPU, a network processor (Network Processor, NP), etc., and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application.

[0143] In the embodiment of the present application, the processor 501 in the electronic device 500 will load instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 will run the application programs stored in the memory 502 to implement various functions, such as:

[0144] Acquire a target model to be moved, wherein the target model includes a plurality of model vertices;

[0145] Acquire initial vertex parameters of the model vertices, and perform physical motion simulation on the model vertices based on the initial vertex parameters to obtain motion positions of the model vertices;

[0146] Based on the initial vertex parameters, determine the reference point position corresponding to the model vertex;

[0147] If the distance between the moving position and the reference point position does not meet the safety distance condition corresponding to the reference point position, the moving position is updated to obtain the target position of the model vertex that meets the safety distance condition;

[0148] Based on the target positions of the vertices of the model, the target model is controlled to move.

[0149] Therefore, the electronic device 500 provided in this embodiment can bring about the following technical effect: reducing the time required to simulate the effect of the model when it is in motion.

[0150] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0151] Optional, such as Figure 5 As shown, the electronic device 500 further includes: a touch screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. The processor 501 is electrically connected to the touch screen 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507, respectively. Those skilled in the art can understand that Figure 5 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0152] The touch display screen 503 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 503 may include a display panel and a touch panel. Among them, the display panel may be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, and these graphical user interfaces may be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel may be used to collect the user's touch operation on or near it (such as the user using any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 501, and can receive the command sent by the processor 501 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 501 to determine the type of touch event, and then the processor 501 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 503 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 503 can also be used as a part of the input unit 506 to realize the input function.

[0153] The radio frequency circuit 504 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and to send and receive signals between the network device or other electronic devices.

[0154] The audio circuit 505 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 505 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 505 and converted into audio data, and then the audio data is output to the processor 501 for processing, and then sent to another electronic device through the radio frequency circuit 504, or the audio data is output to the memory 502 for further processing. The audio circuit 505 may also include an earplug jack to provide communication between an external headset and an electronic device.

[0155] The input unit 506 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0156] The power supply 507 is used to supply power to various components of the electronic device 500. Optionally, the power supply 507 can be logically connected to the processor 501 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 507 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0157] although Figure 5 Not shown, the electronic device 500 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0158] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0159] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0160] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored, and the computer program can be loaded by a processor to execute any data processing method provided in the embodiment of the present application. The computer program can execute the steps of the following data processing method:

[0161] Acquire a target model to be moved, wherein the target model includes a plurality of model vertices;

[0162] Acquire initial vertex parameters of the model vertices, and perform physical motion simulation on the model vertices based on the initial vertex parameters to obtain motion positions of the model vertices;

[0163] Based on the initial vertex parameters, determine the reference point position corresponding to the model vertex;

[0164] If the distance between the moving position and the reference point position does not meet the safety distance condition corresponding to the reference point position, the moving position is updated to obtain the target position of the model vertex that meets the safety distance condition;

[0165] Based on the target positions of the vertices of the model, the target model is controlled to move.

[0166] It can be seen that the computer program can be loaded by the processor to execute any data processing method provided in the embodiments of the present application, thereby bringing about the following technical effects: reducing the time required to simulate the effect of the model in motion.

[0167] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0168] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0169] Since the computer program stored in the computer-readable storage medium can execute any data processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any data processing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0170] According to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the methods provided in various optional implementations of the above embodiments.

[0171] In the above data processing device, computer-readable storage medium, electronic device, and computer program product embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process and beneficial effects of the above-described data processing device, computer-readable storage medium, computer program product, electronic device, and its corresponding units can refer to the description of the data processing method in the above embodiment, and will not be repeated here.

[0172] The above is a detailed introduction to a data processing method, device, electronic device, computer-readable storage medium and computer program product provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A data processing method, characterized in that: The method comprises: Acquire a target model to be moved, wherein the target model includes a plurality of model vertices; Acquiring initial vertex parameters of the model vertices, and based on the initial vertex parameters, performing physical motion simulation on the model vertices to obtain motion positions of the model vertices; Based on the initial vertex parameters, determining the reference point position corresponding to the model vertex; If the distance between the moving position and the reference point position does not meet the safety distance condition corresponding to the reference point position, the moving position is updated to obtain the target position of the model vertex that meets the safety distance condition; Based on the target positions of the model vertices, the target model is controlled to move.

2. The data processing method according to claim 1, characterized in that: The initial vertex parameters include an initial position and an initial motion speed. Based on the initial vertex parameters, the physical motion simulation of the model vertex is performed to obtain the motion position of the model vertex, including: Obtaining environmental parameters of the environment in which the target model is located; Attenuating the initial motion speed based on the environmental parameters to obtain a target motion speed of the model vertex; The movement position of the model vertex is simulated based on the initial position and the target movement speed.

3. The data processing method according to claim 1, characterized in that: The initial vertex parameters include vertex normals, the target model includes model joints, the model vertices are located on the model joints, and obtaining the initial vertex parameters of the model vertices includes: generating initial normals of the vertices of the model; Based on the joint positions of the model joints, the directions of the initial normals are adjusted to obtain vertex normals of the model vertices.

4. The data processing method according to any one of claims 1 to 3, characterized in that: The updating of the movement position to obtain the target position of the model vertex that meets the safety distance condition includes: Acquire a positional relationship between the motion position and the reference point position; Based on the positional relationship and the safety distance condition, the movement position is updated to obtain the target position of the model vertex.

5. The data processing method according to claim 4, characterized in that: The initial vertex parameters include an initial position, and determining the reference point position corresponding to the model vertex based on the initial vertex parameters includes: Taking the initial position as the reference point position; The distance between the moving position and the reference point position does not meet the safety distance condition corresponding to the reference point position, including: The distance between the moving position and the initial position is greater than a preset target safety distance.

6. The data processing method according to claim 5, characterized in that: The acquiring the positional relationship between the motion position and the reference point position comprises: Acquire a first direction vector between the moving position and the initial position; The first direction vector is normalized to obtain a normalized first target direction vector, where the first target direction vector is used to indicate a positional relationship between the moving position and the initial position.

7. The data processing method according to claim 6, characterized in that: The updating of the motion position based on the position relationship and the safety distance condition to obtain the target position of the model vertex includes: Calculating a first product between the first target direction vector and the preset target safety distance; The sum of the initial position and the first product is used as the target position of the model vertex.

8. The data processing method according to claim 4, characterized in that: The initial vertex parameters include an initial position and a vertex normal, and determining the reference point position corresponding to the model vertex based on the initial vertex parameters includes: Normalizing the vertex normal to obtain a target normal vector; Based on the initial position, the target normal vector and a preset backstop distance value, a reference point position of the anti-collision reference point corresponding to the model vertex is determined.

9. The data processing method according to claim 8, characterized in that: The step of determining the reference point position of the anti-collision reference point corresponding to the model vertex based on the initial position, the target normal vector and a preset backstop distance value comprises: Calculating a second product between the target normal vector and the preset backstop distance value; The difference between the initial position and the second product is used as the reference point position of the anti-collision reference point.

10. The data processing method according to claim 8, characterized in that: The distance between the moving position and the reference point position does not meet the safety distance condition corresponding to the reference point position, including: The distance between the moving position and the reference point position of the anti-collision reference point is less than the preset backstop distance value.

11. The data processing method according to claim 10, characterized in that: The acquiring the positional relationship between the motion position and the reference point position comprises: Acquire a second direction vector between the motion position and a reference point position of the anti-collision reference point; The second direction vector is normalized to obtain a normalized second target direction vector, where the second target direction vector is used to indicate a positional relationship between the motion position and a reference point position of the anti-collision reference point.

12. The data processing method according to claim 11, characterized in that: The updating of the motion position based on the position relationship and the safety distance condition to obtain the target position of the model vertex includes: calculating a third product between the second target direction vector and the preset backstop distance value; The sum of the reference point position of the anti-collision reference point and the third product is used as the target position of the model vertex.

13. The data processing method according to any one of claims 1 to 3, characterized in that: The method further comprises: If the distance between the moving position and the reference point position meets the safety distance condition corresponding to the reference point position, the target model is controlled to move based on the moving position.

14. A data processing device, characterized in that: The device comprises: A model acquisition module, used to acquire a target model to be moved, wherein the target model includes a plurality of model vertices; A parameter acquisition module, used to acquire initial vertex parameters of the model vertices, and based on the initial vertex parameters, perform physical motion simulation on the model vertices to obtain motion positions of the model vertices; A position determination module, used to determine the reference point position corresponding to the model vertex based on the initial vertex parameters; A position updating module, configured to update the moving position if the distance between the moving position and the reference point position does not meet the safety distance condition corresponding to the reference point position, so as to obtain a target position of the model vertex that meets the safety distance condition; The model motion module is used to control the target model to move based on the target position of the model vertex.

15. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the data processing method according to any one of claims 1 to 13.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps of the data processing method according to any one of claims 1 to 13.