Motion control method and device for static grid model, equipment and medium
By generating a particle position texture from particle motion to drive static grid models, the method addresses the limitations of traditional particle systems, enabling dynamic responsiveness and enhanced visual effects in static grid models.
Patent Information
- Application Number
- CN202510376980.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-07-15
AI Technical Summary
Traditional particle systems cannot directly drive the motion of the static mesh model, resulting in a single performance effect of the static model and lack of flexibility in real-time interaction.
By generating rendering target maps and particle position maps, the motion of the static mesh model is driven by the particle's motion position, including generating rendering target maps, obtaining texture maps of the static mesh model, sampling and processing texture information, and building a surface feature matrix to control the motion of the static mesh model.
The dynamic effects of the static mesh model are realized, enriching its performance effects, allowing it to follow the special particle motion, and enhancing interactivity and dynamic response capabilities.
Smart Images

Figure CN120305688A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of model rendering, and in particular, to a method, device, equipment and medium for controlling the movement of a static mesh model. Background Art
[0002] In game development, in order to enhance the visual effect and the player interaction experience, the physical effects (such as flames, water flows, fragmentation special effects, etc.) are often simulated through a particle system. Such simulations rely on the movement trajectories and dynamic calculations of the particles themselves. For example, the collision detection between particles, velocity decay, or force response (such as wind force, gravity) are used to represent dynamic effects. However, the core limitation of the traditional particle system is that its data carrier is the discrete "point" attribute, while the conventional static models in the game are composed of continuous mesh vertices. There are essential differences in the data structure and rendering logic between the two. Although the particle special effects can simulate dynamic elements (such as smoke diffusion), they cannot directly drive the deformation of the static model vertices, so that the objects that need to respond dynamically (such as fluttering flags, destructible walls) still rely on pre-baked animations or rigid physical simulations, lacking the flexibility of real-time interaction, resulting in a relatively single performance effect of the static model. Summary of the Invention
[0003] The purpose of the present invention is to provide a method, device, equipment and medium for controlling the movement of a static mesh model in view of the above-mentioned deficiencies in the prior art, so as to drive the movement of the static mesh model by using the movement of the particles, endow the static model with dynamic effects, and enrich the performance effect of the static mesh model.
[0004] To achieve the above purpose, the technical solutions adopted in the embodiments of the present application are as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for controlling the movement of a static mesh model, the method including:
[0006] Generating a rendering target texture map according to the movement positions of multiple particles;
[0007] Generating a particle position texture map corresponding to the static mesh model according to the rendering target texture map and the static mesh model, where the particle position texture map includes: target texture coordinates corresponding to the multiple particles;
[0008] Driving the static mesh model to move according to the particle position texture map.
[0009] In an optional implementation manner, the generating a rendering target texture map according to the movement positions of multiple particles includes:
[0010] Generating the rendering target texture map according to the movement positions of the multiple particles and the number of particles.
[0011] In an alternative embodiment, generating the particle position map corresponding to the static mesh model based on the rendering target map and the static mesh model includes:
[0012] Obtaining the texture map to be sampled of the static mesh model in a preset extension direction according to the local coordinates of the static mesh model;
[0013] Sampling the rendering target map according to the texture map to be sampled to generate the particle position map corresponding to the static mesh model.
[0014] In an alternative embodiment, obtaining the texture map to be sampled of the static mesh model in a preset extension direction according to the local coordinates of the static mesh model includes:
[0015] Obtaining the texture map of the static mesh model according to the local coordinates of the static mesh model and the boundary range of the static mesh model;
[0016] Obtaining the texture map to be sampled from the texture map of the static mesh model.
[0017] In an alternative embodiment, sampling the rendering target map according to the texture map to be sampled to generate the particle position map corresponding to the static mesh model includes:
[0018] Normalizing the movement positions of the multiple particles in the rendering target map according to the size of the rendering target map to generate the movement spacing of the multiple particles;
[0019] Processing the texture map to be sampled according to a preset texture range to obtain a processed texture map;
[0020] Aligning each texture coordinate in the processed texture map with the movement spacing of the multiple particles to obtain the initial texture coordinates corresponding to the multiple particles;
[0021] Offsetting the initial texture coordinates corresponding to each particle by a partial movement spacing corresponding to each particle to obtain the target texture coordinates corresponding to each particle;
[0022] Generating the particle position map according to the target texture coordinates corresponding to the multiple particles.
[0023] In an alternative embodiment, generating the particle position map according to the target texture coordinates corresponding to the multiple particles includes:
[0024] Determining whether the target texture coordinates corresponding to the multiple particles exceed the preset texture range;
[0025] If none of them exceeds the preset texture range, generate the particle position map according to the target texture coordinates corresponding to the multiple particles.
[0026] In an alternative embodiment, the generating the particle position map according to the target texture coordinates corresponding to the multiple particles further includes:
[0027] If the target texture coordinates corresponding to the target particles exceed the preset texture range, scale the target texture coordinates corresponding to the multiple particles so that the texture coordinates corresponding to each particle after scaling are all within the preset texture range;
[0028] Generate the particle position map according to the texture coordinates corresponding to each particle after scaling.
[0029] In an alternative embodiment, the driving the static mesh model to move according to the particle position map includes:
[0030] Construct the surface feature matrix of the static mesh model according to the particle position map;
[0031] Drive the static mesh model to move according to the surface feature matrix, the local coordinates of the static mesh model, and the target texture coordinates corresponding to the multiple particles in the particle position map.
[0032] In an alternative embodiment, the constructing the surface feature matrix of the static mesh model according to the particle position map includes:
[0033] Determine the tangent vectors of the vertices in the static mesh model according to the target texture coordinates corresponding to two adjacent particles in the particle position map;
[0034] Use the cross product algorithm to determine the binormal vectors and normal vectors of the vertices according to the tangent vectors of the vertices;
[0035] Construct the surface feature matrix of the static mesh model according to the tangent vectors, binormal vectors and normal vectors of the vertices.
[0036] In an alternative embodiment, the driving the static mesh model to move according to the surface feature matrix, the local coordinates of the static mesh model, and the target texture coordinates corresponding to the multiple particles in the particle position map includes:
[0037] Multiply the local coordinates of the static mesh model by the surface feature matrix and add the target texture coordinates corresponding to the multiple particles in the particle position map to drive the static mesh model to move.
[0038] Second aspect, the embodiments of the present application further provide a motion control device for a static mesh model, the device includes:
[0039] A generation module, configured to generate a rendering target texture map according to the motion positions of multiple particles;
[0040] The generation module is further configured to generate a particle position texture map corresponding to the static mesh model according to the rendering target texture map and the static mesh model, and the particle position texture map includes: target texture coordinates corresponding to the multiple particles;
[0041] A driving module, configured to drive the static mesh model to move according to the particle position texture map.
[0042] Third aspect, the embodiments of the present application further provide an electronic device, including: a processor, a storage medium, and a bus. The storage medium stores program instructions executable by the processor. When the electronic device runs, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to perform the steps of the motion control method of the static mesh model according to any one of the first aspects.
[0043] Fourth aspect, the embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it performs the steps of the motion control method of the static mesh model according to any one of the first aspects.
[0044] The beneficial effects of the present application are:
[0045] The embodiments of the present application provide a motion control method, device, device and medium for a static mesh model. The method includes: generating a rendering target texture map according to the motion positions of multiple particles, then generating a particle position texture map corresponding to the static mesh model according to the rendering target texture map and the static mesh model. The particle position texture map includes: target texture coordinates corresponding to multiple particles, and finally driving the static mesh model to move according to the particle position texture map. The method of the present application generates a particle position texture map corresponding to the static mesh model according to the rendering target texture map and the static mesh model, and then drives the static mesh model to move. By using the motion of particles to control the motion of the static mesh model, a dynamic effect is given to the static model, thereby enriching the rendering effect of the static mesh model. Description of the Drawings
[0046] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the embodiments. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0047] Figure 1 One of the flow diagrams of a motion control method for a static mesh model provided by an embodiment of the present application;
[0048] Figure 2 A schematic diagram of a rendered target texture map provided by an embodiment of the present application;
[0049] Figure 3 Two of the flow diagrams of a motion control method for a static mesh model provided by an embodiment of the present application;
[0050] Figure 4 Three of the flow diagrams of a motion control method for a static mesh model provided by an embodiment of the present application;
[0051] Figure 5 A schematic diagram of a static mesh model provided by an embodiment of the present application;
[0052] Figure 6 A schematic diagram of a texture map to be sampled provided by an embodiment of the present application;
[0053] Figure 7 Four of the flow diagrams of a motion control method for a static mesh model provided by an embodiment of the present application;
[0054] Figure 8 Five of the flow diagrams of a motion control method for a static mesh model provided by an embodiment of the present application;
[0055] Figure 9 Six of the flow diagrams of a motion control method for a static mesh model provided by an embodiment of the present application;
[0056] Figure 10 Seven of the flow diagrams of a motion control method for a static mesh model provided by an embodiment of the present application;
[0057] Figure 11 An effect diagram of a motion control method for a static mesh model provided by an embodiment of the present application;
[0058] Figure 12 A schematic diagram of the functional modules of a motion control device for a static mesh model provided by an embodiment of the present application;
[0059] Figure 13 Schematic diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0060] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some but not all of the embodiments of the present invention.
[0061] Therefore, the detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application claimed, but merely represents selected embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the scope of protection of the present application.
[0062] In the description of the present application, it should be noted that if terms such as "upper", "lower", etc. indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, or the orientation or positional relationship in which the product of this application is usually placed during use, it is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation to the present application.
[0063] In addition, terms such as "first", "second", etc. in the description and claims of the present invention and the above accompanying drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order different from those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0064] It should be noted that the features in the embodiments of the present application can be combined with each other without conflict.
[0065] During the game development process, the implementation of particles based on the particle system cannot be directly applied to the conventional static mesh models in the game, which will result in a relatively single performance effect of the static mesh model. Therefore, in order to enrich the performance effect of the static mesh model and achieve the deformation movement of the static mesh model, the embodiments of the present application provide a method for controlling the movement of a static mesh model. By the movement positions of multiple particles, a rendering target texture map is generated, and then according to the rendering target texture map and the static mesh model, a particle position texture map corresponding to the static mesh model is generated. The particle position texture map includes: target texture coordinates corresponding to multiple particles. Finally, according to the particle position texture map, the static mesh model is driven to move, realizing the movement of the static mesh model following the particle special effects and enriching the performance effect of the static mesh model.
[0066] The following will explain in detail a method for controlling the movement of a static mesh model provided by the embodiments of the present application with specific examples in combination with the accompanying drawings. Figure 1 It is one of the flow schematic diagrams of a method for controlling the movement of a static mesh model provided by the embodiments of the present application; Figure 2 It is a schematic diagram of a rendering target texture map provided by the embodiments of the present application. As Figure 1 shown, the method includes:
[0067] S101. Generate a rendering target texture map according to the movement positions of multiple particles.
[0068] In this embodiment, a particle is a basic element in the particle system. Each particle will have its own movement trajectory in three-dimensional space, and these particles can represent various parts of a virtual object, molecules in a fluid, etc. Each particle has a corresponding three-dimensional space position, and the position of the particle will continuously change with time.
[0069] The rendering target texture map is a texture image, which is used to store specific information. The movement position information of multiple particles is encoded into the texture map to obtain the rendering target texture map.
[0070] Optionally, generate a rendering target texture map according to the movement positions of multiple particles and the number of particles.
[0071] Obtain the movement positions of multiple particles and fill them into the rendering target RenderTarget to obtain the rendering target texture map. Specifically, first create a rendering target. In the size Size of the rendering target, X represents the number of particles, and Y represents 1. Then write the movement positions of multiple particles into the rendering target RenderTarget to obtain the rendering target texture map.
[0072] Exemplarily, the rendering target texture map is as Figure 2 shown. Each grid in the horizontal row corresponds to a particle. In the rendering target texture map, X is the number of particles, and Y is 1.
[0073] S102. Generate a particle position map corresponding to the static mesh model based on the rendering target map and the static mesh model.
[0074] Among them, the particle position map includes: target texture coordinates corresponding to multiple particles.
[0075] Specifically, first obtain the static mesh model. The static mesh model is a three-dimensional model composed of a set of vertices and faces. Usually, it is fixed and does not have the ability of dynamic deformation. The static mesh model can be a strip-shaped static mesh model, such as buildings, trees, etc.
[0076] The particle position map is used to store the target texture coordinates of the particles corresponding to each vertex on the static mesh model. First, establish the correspondence between the vertices of the static mesh model and the particles. Then, according to the particle position information stored in the rendering target map, find the texture coordinates of the corresponding particles for each vertex. Store these texture coordinates in the particle position map.
[0077] S103. Drive the static mesh model to move according to the particle position map.
[0078] After obtaining the particle position map, change the vertex positions of the static mesh model according to the particle position map, so as to achieve the motion effect of the static mesh model. Exemplarily, by sampling the particle position map, obtain the texture coordinates of the particles corresponding to each vertex. Then, according to these texture coordinates, obtain the actual position information of the particles from the rendering target map. Finally, superimpose the vertex positions of the static mesh model with the positions of the corresponding particles, so that the static mesh model is deformed and moves.
[0079] In summary, the embodiment of the present application provides a method for controlling the motion of a static mesh model. The method includes: generating a rendering target map according to the motion positions of multiple particles, then generating a particle position map corresponding to the static mesh model according to the rendering target map and the static mesh model. The particle position map includes: target texture coordinates corresponding to multiple particles. Finally, drive the static mesh model to move according to the particle position map. The method of the present application generates a particle position map corresponding to the static mesh model according to the rendering target map and the static mesh model, and then drives the static mesh model to move. By using the motion of the particles to control the motion of the static mesh model, a dynamic effect is given to the static model, thereby enriching the rendering effect of the static mesh model.
[0080] Based on the above embodiments, the embodiment of the present application provides another possible implementation manner of a model rendering method for a target virtual object by generating a particle position map corresponding to the static mesh model. Figure 3It is the second flowchart of a motion control method for a static mesh model provided by an embodiment of the present application. As shown in Figure 3 shown, according to the rendered target texture map and the static mesh model, a particle position texture map corresponding to the static mesh model is generated, including:
[0081] S201. According to the local coordinates of the static mesh model, obtain the texture map to be sampled in the preset extension direction of the static mesh model.
[0082] In this embodiment, obtain the static mesh model, and obtain the local coordinates of the static mesh model in the material, that is, the position in the local space coordinate system. In this local space coordinate system, the vertex positions of the static mesh model are represented by coordinate values relative to the origin of the model itself. The local coordinates determine the relative position relationship of each part of the static mesh model and are the basic geometric information of the model.
[0083] Among them, the preset extension direction is a specific direction preset according to the motion requirements of the static mesh model. For example, in three-dimensional space, it may be along the x-axis, y-axis or z-axis direction, or a custom vector direction. Selecting the preset extension direction is to determine the range and method of obtaining the texture map on the model.
[0084] According to the local coordinates of the static mesh model and the preset extension direction, extract the texture information of a specific area from the static mesh model to form the texture map to be sampled. For example, if the preset extension direction is along the positive z-axis direction of the model, then the texture map to be sampled is the texture image of the model in the positive x-axis direction.
[0085] S202. According to the texture map to be sampled, sample the rendered target texture map to generate a particle position texture map corresponding to the static mesh model.
[0086] Specifically, the rendered target texture map records the motion position information of multiple particles. Sampling the rendered target texture map means extracting specific information from the rendered target texture map. According to the texture coordinates in the texture map to be sampled, perform a sampling operation on the previously obtained rendered target texture map to obtain the position information of each particle.
[0087] By processing and integrating the position information of each particle obtained by sampling, convert it into a particle position texture map corresponding to the static mesh model. In this texture map, each pixel stores the particle position information related to the vertices of the static mesh model, so that the static mesh model can be driven to move according to the particle position information subsequently.
[0088] In the method provided in this embodiment, according to the local coordinates of the static mesh model, the texture map to be sampled in the preset extension direction of the static mesh model is obtained. Then, according to the texture map to be sampled, the rendering target map is sampled to generate the particle position map corresponding to the static mesh model, establishing a mapping relationship between the vertices of the static mesh model and the particle positions, providing key data support for realizing the motion control of the static mesh model.
[0089] Based on the above embodiment, the embodiment of the present application provides another possible implementation method for rendering the model of the target virtual object by obtaining the texture map to be sampled. Figure 4 This is the third schematic diagram of the process of a motion control method for a static mesh model provided by the embodiment of the present application. Figure 5 This is a schematic diagram of a static mesh model provided by the embodiment of the present application. Figure 6 This is a schematic diagram of a texture map to be sampled provided by the embodiment of the present application. As Figure 4 shown, according to the local coordinates of the static mesh model, obtaining the texture map to be sampled in the preset extension direction of the static mesh model includes:
[0090] S301. Obtain the texture map of the static mesh model according to the local coordinates of the static mesh model and the boundary range of the static mesh model.
[0091] S302. Obtain the texture map to be sampled from the texture map of the static mesh model.
[0092] In this embodiment, the static mesh model has a series of vertex coordinates in the local space coordinate system. These coordinates determine the shape and structure of the model and are the basic geometric information of the model. For example, for a simple cube model, each vertex has clear x, y, and z coordinate values in the local coordinate system, and these coordinate values describe the relative positions of the corners of the cube.
[0093] The boundary range of the static mesh model defines the spatial range of the static mesh model in the local space coordinate system and can be represented by the minimum coordinate value and the maximum coordinate value. For example, for a strip-shaped static mesh model placed in the local space coordinate system, as Figure 5 shown, the boundary range can be the vertex coordinates of the smallest cube containing this strip-shaped static mesh model. Through the boundary range, the size and position limits of the strip-shaped static mesh model in space can be determined. Then, through the local coordinates and the boundary range, the specific position of each pixel on the texture image corresponding to the model surface can be determined, so as to obtain the texture map that completely covers the model surface.
[0094] Based on the preset extension direction of the static mesh model, extract the coordinate components corresponding to the preset extension direction from the local coordinates. As Figure 5As shown, the preset extension direction of the strip-shaped static mesh model is the vertical direction. If the vertical direction is the z-axis direction, the z-axis coordinates of each vertex are taken and divided by the maximum value of the boundary range, and the z-axis coordinates of each vertex are mapped to the range of 0-1 to obtain the texture UV coordinates, thereby obtaining the texture map to be sampled. As Figure 6 shown, it is the texture map to be sampled corresponding to the strip-shaped static mesh model, where Figure 6 the texture UV coordinates corresponding to the upper black area in are 0, the texture UV coordinates corresponding to the lower white area are 1, and the middle area is a gradient value from 0 to 1.
[0095] In the method provided in this embodiment, according to the local coordinates of the static mesh model and the boundary range of the static mesh model, the texture map of the static mesh model is obtained, and then the texture map to be sampled is obtained from the texture map of the static mesh model, providing a key data basis for subsequent texture sampling and model motion control.
[0096] The embodiment of the present application provides another possible implementation manner of the model rendering method for the target virtual object by generating a particle position map. Figure 7 It is the fourth flowchart of the motion control method for a static mesh model provided by the embodiment of the present application. As Figure 7 shown, according to the texture map to be sampled, the rendering target map is sampled to generate a particle position map corresponding to the static mesh model, including:
[0097] S401. Normalize the motion positions of multiple particles in the rendering target map according to the size of the rendering target map to generate the motion spacing of multiple particles.
[0098] In this embodiment, normalization is to map data to a specific range. Specifically, normalizing the motion positions of multiple particles in the rendering target map to generate the motion spacing of multiple particles, that is, the sizes of multiple particles, helps to subsequently associate the motion of the particles with the texture coordinates.
[0099] S402. Process the texture map to be sampled according to the preset texture range to obtain the processed texture map.
[0100] The preset texture range can be (0-1). According to the preset texture range, the texture information within this range is extracted from the texture map to be sampled, or operations such as cropping and scaling of the texture outside this range are performed to obtain the processed texture map.
[0101] S403. Align each texture coordinate in the processed texture map with the motion spacing of multiple particles to obtain the initial texture coordinates corresponding to multiple particles.
[0102] Specifically, match the texture coordinates in the processed texture map with the movement spacing of the particles, and establish a connection between the movement spacing of the particles and the texture coordinates. For example, assume that the texture coordinate range of the processed texture map is [0, 1], and the movement spacing of the particles is also within the normalized range of [0, 1]. Then, the corresponding position can be found within the texture coordinate range according to the movement spacing of the particles. Through coordinate alignment operations, an initial texture coordinate is determined for each particle. This initial texture coordinate represents the starting position of the particle in the processed texture map, and further offset calculations can be performed based on the initial position.
[0103] S404. Offset the initial texture coordinates corresponding to each particle by the partial movement spacing corresponding to each particle to obtain the target texture coordinates corresponding to each particle.
[0104] Since the rendering target map is directly sampled according to the texture map to be sampled, the initial texture coordinates of the particles may be sampled, that is, the boundary values of each grid corresponding to each particle, resulting in the final movement effect.
[0105] To better sample the rendering target map, after obtaining the initial texture coordinates of the particles, offset them according to the partial movement spacing corresponding to each particle. The partial movement spacing can be half of the movement spacing, and there is no limit here. By adding the offset to the initial texture coordinates, the target texture coordinates of the particles are obtained. Through the offset, the target texture coordinates corresponding to each particle are located in the middle area of the corresponding grid, and the target texture coordinates represent the final position of the particle in the processed texture map after a certain movement.
[0106] S405. Generate a particle position map based on the target texture coordinates corresponding to multiple particles.
[0107] Specifically, store the target texture coordinates corresponding to multiple particles in a new texture map, that is, the particle position map. Through this map, the static mesh model can be deformed and its movement can be controlled according to the target texture coordinates of the particles during the rendering process.
[0108] In the method provided in this embodiment, according to the size of the rendering target texture map, the movement positions of multiple particles in the rendering target texture map are normalized to generate the movement intervals of the multiple particles; according to the preset texture range, the texture map to be sampled is processed to obtain the processed texture map; the texture coordinates in the processed texture map are aligned with the movement intervals of the multiple particles to obtain the initial texture coordinates corresponding to the multiple particles; the initial texture coordinates corresponding to each particle are offset by a partial movement interval corresponding to each particle to obtain the target texture coordinates corresponding to each particle, and finally, according to the target texture coordinates corresponding to the multiple particles, a particle position map is generated. Through the processing of the rendering target texture map and the texture map to be sampled, as well as the normalization, alignment, and offset operations of the coordinates, a particle position map corresponding to the static mesh model is finally generated, which is used to implement the movement control of the static mesh model.
[0109] An embodiment of the present application provides another possible implementation method for rendering the model of the target virtual object by generating a particle position map. Figure 8 This is the fifth flowchart of a method for controlling the movement of a static mesh model provided by an embodiment of the present application. As Figure 8 shown, generating a particle position map according to the target texture coordinates corresponding to multiple particles includes:
[0110] S501. Determine whether the target texture coordinates corresponding to multiple particles exceed the preset texture range.
[0111] S502. If none of them exceed the preset texture range, generate a particle position map according to the target texture coordinates corresponding to the multiple particles.
[0112] In this embodiment, the preset texture range is a pre-defined texture area, usually represented by the range of texture coordinates. For example, in a two-dimensional texture space, the preset texture range may be a rectangular area defined by the texture coordinates (u_min, v_min) to (u_max, v_max). This range is set according to actual needs or specific requirements of the model, and it defines the valid area where the texture can be used.
[0113] For the target texture coordinates of each particle, it is necessary to check whether it is within the preset texture range. When the target texture coordinates of all particles are within the preset texture range, it means that the texture information corresponding to these coordinates is valid and can be used to generate a particle position map.
[0114] Optionally, if there are target texture coordinates corresponding to target particles that exceed the preset texture range, scale the target texture coordinates corresponding to the multiple particles so that the texture coordinates corresponding to each particle after scaling are all within the preset texture range; generate a particle position map according to the texture coordinates corresponding to each particle after scaling.
[0115] Specifically, if the initial texture coordinates UV of the target particle are equal to 1, and after offsetting a part of the movement distance of the target particle, the target texture coordinates UV>1 are obtained. At this time, the target texture coordinates corresponding to the target particle exceed the preset texture range (0-1), and it is necessary to scale it by 1-(1 / Size) units so that the texture coordinates corresponding to each particle after scaling are within the preset texture range. Finally, a particle position map is generated according to the texture coordinates corresponding to each particle after scaling.
[0116] In the method provided in this embodiment, it is determined whether the target texture coordinates corresponding to multiple particles exceed the preset texture range. If none of them exceed the preset texture range, a particle position map is generated according to the target texture coordinates corresponding to the multiple particles. By checking whether the target texture coordinates exceed the preset range, the effectiveness and accuracy of the generated particle position map are ensured, providing a reliable data basis for the motion control of the static mesh model.
[0117] Another possible implementation manner of the model rendering method for the target virtual object is provided in the embodiment of the present application. Figure 9 This is the sixth flowchart of the motion control method for a static mesh model provided in the embodiment of the present application. As Figure 9 shown, driving the static mesh model to move according to the particle position map includes:
[0118] S601. Construct a surface feature matrix of the static mesh model according to the particle position map.
[0119] S602. Drive the static mesh model to move according to the surface feature matrix, the local coordinates of the static mesh model, and the target texture coordinates corresponding to multiple particles in the particle position map.
[0120] In this embodiment, the particle position map records the target texture coordinates corresponding to multiple particles. These coordinate information reflect the positions of the particles in the texture space and have a certain association with the static mesh model.
[0121] Since directly allowing each vertex on the static mesh model to sample the target texture coordinates of each particle will result in most of the vertices of the static mesh model being the same, causing the model vertices at the same height in the preset extension direction to collapse.
[0122] Therefore, according to the particle position map, a surface feature matrix of the static mesh model is constructed. The surface feature matrix is the tangent space matrix (Tangent-BiTangent-Normal, TBN), which is used for normal mapping. The TBN space is defined in each vertex of the static mesh model and is a coordinate space centered on the model vertex composed of the tangent, bi-tangent, and vertex normal.
[0123] According to the target texture coordinates corresponding to multiple particles in the particle position map, combined with the surface feature matrix and local coordinates, the target position of each vertex of the static mesh model is calculated. Specifically, the target texture coordinates reflect the motion state of the particles. The characteristics of the model surface can be understood through the surface feature matrix, and the local coordinates provide the basic position information of the model. Using this information, the target position of each vertex after movement can be calculated through mathematical transformation.
[0124] Then, the calculated target positions are assigned to the respective vertices of the static mesh model. In the graphics rendering system, the rendering of the static mesh model is based on the vertex positions. When the vertex positions change, the appearance of the model also changes accordingly. By continuously updating the vertex positions, the motion effect of the static mesh model can be achieved.
[0125] In the method provided in this embodiment, by constructing the surface feature matrix and combining the local coordinates and target texture coordinates to calculate and update the vertex positions, the purpose of driving the static mesh model to move according to the particle position map is achieved.
[0126] Another possible implementation manner of the model rendering method for the target virtual object is provided in the embodiment of the present application. Figure 10 This is the seventh flowchart of a motion control method for a static mesh model provided in the embodiment of the present application. As Figure 10 shown, according to the particle position map, constructing a surface feature matrix of the static mesh model includes:
[0127] S701. Determine the tangent vectors of the vertices in the static mesh model according to the target texture coordinates corresponding to two adjacent particles in the particle position map.
[0128] In this embodiment, the particle position map records the target texture coordinates corresponding to multiple particles, and these coordinates reflect the positions of the particles in the texture space. Each vertex in the static mesh model needs to be affected by two particles. Specifically, after obtaining the target texture coordinates corresponding to the current particle and the target texture coordinates of the next adjacent particle, subtract the target texture coordinates corresponding to the current particle from the target texture coordinates of the next adjacent particle to obtain the vector from the current particle to the next adjacent particle, that is, the tangent T vector. Specifically, the calculation formula for the tangent vector is as follows:
[0129] T = normalize(p nxt - p)
[0130] where p represents the target texture coordinates corresponding to the current particle, and p nxt represents the target texture coordinates corresponding to the next adjacent particle.
[0131] It should be noted that for the last particle, there is no next adjacent particle available for acquisition. In this case, it is necessary to obtain the target texture coordinates of the previous adjacent particle, and subtract the target texture coordinates of the previous adjacent particle from the target texture coordinates of the current last particle to obtain the tangent T vector from the previous adjacent particle to the current last particle.
[0132] S702. Use the cross - product algorithm to determine the binormal vector and normal vector of each vertex according to the tangent vectors of each vertex.
[0133] Specifically, the calculation formula for the binormal B vector is as follows:
[0134] B = normalize(cross(T, (1, 0, 0)))
[0135] The calculation formula for the normal N vector is as follows:
[0136] N = cross(B, T)
[0137] Determine the binormal vector and normal vector of each vertex according to the tangent vectors of each vertex and the above calculation formulas.
[0138] S703. Construct the surface feature matrix of the static mesh model according to the tangent vectors, binormal vectors and normal vectors of each vertex.
[0139] Specifically, for each vertex of the static mesh model, arrange its tangent T vector, binormal B vector and normal N vector in columns to obtain a matrix, thereby obtaining the surface feature matrix of the static mesh model.
[0140] In the method provided in this embodiment, by using the target texture coordinate information in the particle position map, the tangent vector, binormal vector, and normal vector of each vertex are gradually calculated, and finally the surface feature matrix of the static mesh model is constructed, providing important basic data for driving the model to move subsequently.
[0141] Another possible implementation of the model rendering method for the target virtual object is provided in the embodiments of the present application. Figure 11 The following is an effect diagram of a motion control method for a static mesh model provided in the embodiments of the present application. According to the surface feature matrix, the local coordinates of the static mesh model, and the target texture coordinates corresponding to multiple particles in the particle position map, the static mesh model is driven to move, including:
[0142] Multiply the local coordinates of the static mesh model by the surface feature matrix, and add the result to the target texture coordinates corresponding to multiple particles in the particle position map to drive the static mesh model to move.
[0143] In this embodiment, multiplying the local coordinates of the static mesh model by the surface feature matrix performs a linear transformation on the local coordinates. For example, the tangent vector, binormal vector, and normal vector in the surface feature matrix will affect operations such as stretching, compressing, or rotating the model in different directions.
[0144] Specifically, multiply the X coordinate of the local coordinates of the static mesh model by the normal vector N, multiply the Y coordinate of the local coordinates of the static mesh model by the binormal vector B, and then add the two multiplication results to transform the local coordinates of the static mesh model to the TBN space.
[0145] Then add it to the target texture coordinates corresponding to multiple particles and the local coordinates of the static mesh model to obtain the final coordinates of all vertices. In the graphics rendering system, when the coordinates of all vertices are updated, the appearance of the model will change accordingly, thereby achieving the motion effect of the static mesh model.
[0146] As Figure 11 shown, on the left is the particle special effect, and on the right is the static mesh model. The static mesh model is driven to move according to the movement of the particles to achieve the dynamic effect of the static mesh model.
[0147] The following continues to explain the motion control device and electronic device for the static mesh model provided in any of the above embodiments of the present application. The specific implementation process and the resulting technical effects are the same as those in the corresponding method embodiments. For a brief description, for the parts not mentioned in this embodiment, reference can be made to the corresponding content in the method embodiments.
[0148] Figure 12It is a schematic diagram of the functional modules of a motion control device for a static mesh model provided by an embodiment of the present application. As Figure 12 shown, the motion control device 100 of the static mesh model includes:
[0149] A generation module 110, configured to generate a rendering target texture map according to the motion positions of multiple particles;
[0150] The generation module 110 is further configured to generate a particle position texture map corresponding to the static mesh model according to the rendering target texture map and the static mesh model. The particle position texture map includes: target texture coordinates corresponding to multiple particles;
[0151] A driving module 120, configured to drive the static mesh model to move according to the particle position texture map.
[0152] Optionally, the generation module 110 is further configured to generate a rendering target texture map according to the motion positions of multiple particles and the number of particles.
[0153] Optionally, the generation module 110 is further configured to obtain a texture map to be sampled of the static mesh model in a preset extension direction according to the local coordinates of the static mesh model; sample the rendering target texture map according to the texture map to be sampled, and generate a particle position texture map corresponding to the static mesh model.
[0154] Optionally, the generation module 110 is further configured to obtain a texture map of the static mesh model according to the local coordinates of the static mesh model and the boundary range of the static mesh model; obtain the texture map to be sampled from the texture map of the static mesh model.
[0155] Optionally, the generation module 110 is further configured to normalize the motion positions of multiple particles in the rendering target texture map according to the size of the rendering target texture map to generate motion spacings of multiple particles; process the texture map to be sampled according to a preset texture range to obtain a processed texture map; align each texture coordinate in the processed texture map with the motion spacings of multiple particles to obtain initial texture coordinates corresponding to multiple particles; offset the initial texture coordinates corresponding to each particle by a partial motion spacing corresponding to each particle to obtain target texture coordinates corresponding to each particle; generate a particle position texture map according to the target texture coordinates corresponding to multiple particles.
[0156] Optionally, the generation module 110 is further configured to determine whether the target texture coordinates corresponding to multiple particles exceed a preset texture range; if none of them exceed the preset texture range, generate a particle position texture map according to the target texture coordinates corresponding to multiple particles.
[0157] Optionally, the generation module 110 is further configured to scale the target texture coordinates corresponding to the target particles if there are target texture coordinates corresponding to the target particles that exceed the preset texture range, so that the texture coordinates corresponding to each particle after scaling are all within the preset texture range; and generate a particle position texture map according to the texture coordinates corresponding to each particle after scaling.
[0158] Optionally, the driving module 120 is further configured to construct a surface feature matrix of the static mesh model according to the particle position texture map; and drive the static mesh model to move according to the surface feature matrix, the local coordinates of the static mesh model, and the target texture coordinates corresponding to multiple particles in the particle position texture map.
[0159] Optionally, the driving module 120 is further configured to determine the tangent vectors of each vertex in the static mesh model according to the target texture coordinates corresponding to two adjacent particles in the particle position texture map; use the cross product algorithm to determine the binormal vectors and normal vectors of each vertex according to the tangent vectors of each vertex; and construct a surface feature matrix of the static mesh model according to the tangent vectors, binormal vectors and normal vectors of each vertex.
[0160] Optionally, the driving module 120 is further configured to multiply the local coordinates of the static mesh model by the surface feature matrix and add them to the target texture coordinates corresponding to multiple particles in the particle position texture map to drive the static mesh model to move.
[0161] The above device is used to execute the method provided in the foregoing embodiment, and its implementation principle and technical effects are similar, and will not be described herein again.
[0162] The above modules may be one or more integrated circuits configured to implement the above method, such as: one or more application specific integrated circuits (ASICs), or, one or more microprocessors, or, one or more field programmable gate arrays (FPGAs), etc. Again, when a certain module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. Again, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0163] Figure 13 A schematic diagram of an electronic device provided by an embodiment of the present application, which can be used for the motion control of a static mesh model. As Figure 13As shown, the electronic device includes: a processor 210, a storage medium 220, and a bus 230.
[0164] The storage medium 220 stores machine-readable instructions executable by the processor 210. When the electronic device runs, the processor 210 communicates with the storage medium 220 via the bus 230. The processor 210 executes the machine-readable instructions, and the executed method includes:
[0165] Generating a rendering target texture map based on the motion positions of multiple particles;
[0166] Generating a particle position texture map corresponding to the static mesh model based on the rendering target texture map and the static mesh model. The particle position texture map includes: target texture coordinates corresponding to multiple particles;
[0167] Driving the static mesh model to move based on the particle position texture map.
[0168] Optionally, generating a rendering target texture map based on the motion positions of multiple particles includes:
[0169] Generating a rendering target texture map based on the motion positions of multiple particles and the number of particles.
[0170] Optionally, generating a particle position texture map corresponding to the static mesh model based on the rendering target texture map and the static mesh model includes:
[0171] Obtaining a texture map to be sampled on the static mesh model in a preset extension direction according to the local coordinates of the static mesh model;
[0172] Sampling the rendering target texture map according to the texture map to be sampled, and generating a particle position texture map corresponding to the static mesh model.
[0173] Optionally, obtaining a texture map to be sampled on the static mesh model in a preset extension direction according to the local coordinates of the static mesh model includes:
[0174] Obtaining the texture map of the static mesh model according to the local coordinates of the static mesh model and the boundary range of the static mesh model;
[0175] Obtaining the texture map to be sampled from the texture map of the static mesh model.
[0176] Optionally, sampling the rendering target texture map according to the texture map to be sampled, and generating a particle position texture map corresponding to the static mesh model includes:
[0177] Normalizing the motion positions of multiple particles in the rendering target texture map according to the size of the rendering target texture map, and generating the motion spacing of multiple particles;
[0178] Process the texture map to be sampled according to the preset texture range to obtain the processed texture map;
[0179] Align the texture coordinates in the processed texture map with the movement distances of multiple particles to obtain the initial texture coordinates corresponding to the multiple particles;
[0180] Offset the initial texture coordinates corresponding to each particle by a partial movement distance corresponding to each particle to obtain the target texture coordinates corresponding to each particle;
[0181] Generate a particle position map according to the target texture coordinates corresponding to multiple particles.
[0182] Optionally, generating a particle position map according to the target texture coordinates corresponding to multiple particles includes:
[0183] Determine whether the target texture coordinates corresponding to multiple particles exceed the preset texture range;
[0184] If none of them exceed the preset texture range, generate a particle position map according to the target texture coordinates corresponding to multiple particles.
[0185] Optionally, generating a particle position map according to the target texture coordinates corresponding to multiple particles further includes:
[0186] If there are target texture coordinates corresponding to target particles that exceed the preset texture range, scale the target texture coordinates corresponding to multiple particles so that the texture coordinates corresponding to each particle after scaling are all within the preset texture range;
[0187] Generate a particle position map according to the texture coordinates corresponding to each particle after scaling.
[0188] Optionally, driving a static mesh model to move according to the particle position map includes:
[0189] Construct a surface feature matrix of the static mesh model according to the particle position map;
[0190] Drive the static mesh model to move according to the surface feature matrix, the local coordinates of the static mesh model, and the target texture coordinates corresponding to multiple particles in the particle position map.
[0191] Optionally, constructing a surface feature matrix of the static mesh model according to the particle position map includes:
[0192] Determine the tangent vectors of each vertex in the static mesh model according to the target texture coordinates corresponding to two adjacent particles in the particle position map;
[0193] Use the cross product algorithm to determine the binormal vectors and normal vectors of each vertex according to the tangent vectors of each vertex;
[0194] Construct a surface feature matrix of the static mesh model based on the tangent vectors, binormal vectors, and normal vectors of each vertex.
[0195] Optionally, drive the static mesh model to move according to the surface feature matrix, the local coordinates of the static mesh model, and the target texture coordinates corresponding to multiple particles in the particle position map, including:
[0196] Multiply the local coordinates of the static mesh model by the surface feature matrix and add the result to the target texture coordinates corresponding to multiple particles in the particle position map to drive the static mesh model to move.
[0197] Optionally, the present application also provides a storage medium 220, on which a computer program is stored. When the computer program is run by a processor, it executes the steps of the above method embodiment.
[0198] Among them, when the program is executed by the processor, the method executed may include:
[0199] Generate a rendering target map according to the movement positions of multiple particles;
[0200] Generate a particle position map corresponding to the static mesh model according to the rendering target map and the static mesh model. The particle position map includes: target texture coordinates corresponding to multiple particles;
[0201] Drive the static mesh model to move according to the particle position map.
[0202] Optionally, generating a rendering target map according to the movement positions of multiple particles includes:
[0203] Generate a rendering target map according to the movement positions of multiple particles and the number of particles.
[0204] Optionally, generating a particle position map corresponding to the static mesh model according to the rendering target map and the static mesh model includes:
[0205] Obtain a texture map to be sampled in a preset extension direction of the static mesh model according to the local coordinates of the static mesh model;
[0206] Sample the rendering target map according to the texture map to be sampled to generate a particle position map corresponding to the static mesh model.
[0207] Optionally, obtaining a texture map to be sampled in a preset extension direction of the static mesh model according to the local coordinates of the static mesh model includes:
[0208] Obtain the texture map of the static mesh model according to the local coordinates of the static mesh model and the boundary range of the static mesh model;
[0209] Obtain the texture map to be sampled from the texture map of the static mesh model.
[0210] Optionally, sample the render target map according to the texture map to be sampled to generate a particle position map corresponding to the static mesh model, including:
[0211] Normalize the motion positions of multiple particles in the render target map according to the size of the render target map to generate the motion spacing of multiple particles;
[0212] Process the texture map to be sampled according to the preset texture range to obtain the processed texture map;
[0213] Align each texture coordinate in the processed texture map with the motion spacing of multiple particles to obtain the initial texture coordinates corresponding to multiple particles;
[0214] Offset the initial texture coordinates corresponding to each particle by a partial motion spacing corresponding to each particle to obtain the target texture coordinates corresponding to each particle;
[0215] Generate a particle position map according to the target texture coordinates corresponding to multiple particles.
[0216] Optionally, generate a particle position map according to the target texture coordinates corresponding to multiple particles, including:
[0217] Determine whether the target texture coordinates corresponding to multiple particles exceed the preset texture range;
[0218] If none of them exceed the preset texture range, generate a particle position map according to the target texture coordinates corresponding to multiple particles.
[0219] Optionally, generating a particle position map according to the target texture coordinates corresponding to multiple particles further includes:
[0220] If there are target texture coordinates corresponding to target particles that exceed the preset texture range, scale the target texture coordinates corresponding to multiple particles so that the texture coordinates corresponding to each particle after scaling are all within the preset texture range;
[0221] Generate a particle position map according to the texture coordinates corresponding to each particle after scaling.
[0222] Optionally, drive the static mesh model to move according to the particle position map, including:
[0223] Construct a surface feature matrix of the static mesh model according to the particle position map;
[0224] Drive the static mesh model to move according to the surface feature matrix, the local coordinates of the static mesh model, and the target texture coordinates corresponding to multiple particles in the particle position map.
[0225] Optionally, according to the particle position texture map, construct the surface feature matrix of the static mesh model, including:
[0226] Determine the tangent vectors of each vertex in the static mesh model according to the target texture coordinates corresponding to two adjacent particles in the particle position texture map;
[0227] Adopt the cross product algorithm to determine the binormal vectors and normal vectors of each vertex according to the tangent vectors of each vertex;
[0228] Construct the surface feature matrix of the static mesh model according to the tangent vectors, binormal vectors and normal vectors of each vertex.
[0229] Optionally, drive the static mesh model to move according to the surface feature matrix, the local coordinates of the static mesh model, and the target texture coordinates corresponding to multiple particles in the particle position texture map, including:
[0230] Multiply the local coordinates of the static mesh model by the surface feature matrix and add them to the target texture coordinates corresponding to multiple particles in the particle position texture map to drive the static mesh model to move.
[0231] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces. The indirect coupling or communication connection of the devices or units can be in electrical, mechanical or other forms.
[0232] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0233] In addition, the functional units in each embodiment of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware, or in the form of hardware plus software functional units.
[0234] The integrated units implemented in the form of software functional units can be stored in a computer-readable storage medium. The above-mentioned software functional units stored in a storage medium include a number of instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to execute some steps of the methods described in the various embodiments of the present invention. The foregoing storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a magnetic disk, or an optical disc that can store program codes.
[0235] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A motion control method for a static mesh model, characterized in that, The method includes: Generating a rendering target texture map based on the movement positions of multiple particles; Generating a particle position texture map corresponding to the static mesh model according to the rendering target texture map and the static mesh model, where the particle position texture map includes: target texture coordinates corresponding to the multiple particles; Driving the static mesh model to move according to the particle position texture map.
2. The method according to claim 1, wherein The generating a rendering target texture map based on the movement positions of multiple particles includes: Generating the rendering target texture map according to the movement positions of the multiple particles and the number of particles.
3. The method according to claim 1, wherein The generating a particle position texture map corresponding to the static mesh model according to the rendering target texture map and the static mesh model includes: Obtaining a texture map to be sampled in a preset extension direction of the static mesh model according to the local coordinates of the static mesh model; Sampling the rendering target texture map according to the texture map to be sampled to generate a particle position texture map corresponding to the static mesh model.
4. The method according to claim 3, characterized in that, The obtaining a texture map to be sampled in a preset extension direction of the static mesh model according to the local coordinates of the static mesh model includes: Obtaining a texture map of the static mesh model according to the local coordinates of the static mesh model and the boundary range of the static mesh model; Obtaining the texture map to be sampled from the texture map of the static mesh model.
5. The method according to claim 3, wherein The sampling the rendering target texture map according to the texture map to be sampled to generate a particle position texture map corresponding to the static mesh model includes: Normalizing the movement positions of the multiple particles in the rendering target texture map according to the size of the rendering target texture map to generate movement spacings of the multiple particles; Processing the texture map to be sampled according to a preset texture range to obtain a processed texture map; Aligning each texture coordinate in the processed texture map with the movement spacings of the multiple particles to obtain initial texture coordinates corresponding to the multiple particles; Offsetting the initial texture coordinates corresponding to each particle by a partial movement spacing corresponding to each particle to obtain target texture coordinates corresponding to each particle; Generating the particle position texture map according to the target texture coordinates corresponding to the multiple particles.
6. The method according to claim 5, characterized in that, The generating the particle position texture map according to the target texture coordinates corresponding to the multiple particles includes: Determining whether the target texture coordinates corresponding to the multiple particles exceed the preset texture range; If none of them exceed the preset texture range, generating the particle position texture map according to the target texture coordinates corresponding to the multiple particles.
7. The method according to claim 6, characterized in that, The generating the particle position texture map according to the target texture coordinates corresponding to the multiple particles further includes: If there are target texture coordinates corresponding to target particles that exceed the preset texture range, scaling the target texture coordinates corresponding to the multiple particles so that the texture coordinates corresponding to each particle after scaling are all within the preset texture range; Generating the particle position texture map according to the texture coordinates corresponding to each particle after scaling.
8. The method according to claim 1, characterized in that, The driving the static mesh model to move according to the particle position texture map includes: Construct a surface feature matrix of the static mesh model according to the particle position texture map; Drive the static mesh model to move according to the surface feature matrix, the local coordinates of the static mesh model, and the target texture coordinates corresponding to the multiple particles in the particle position texture map.
9. The method according to claim 8, wherein The step of constructing the surface feature matrix of the static mesh model according to the particle position texture map includes: Determine the tangent vectors of the vertices in the static mesh model according to the target texture coordinates corresponding to two adjacent particles in the particle position texture map; Use the cross product algorithm to determine the binormal vectors and normal vectors of the vertices according to the tangent vectors of the vertices; Construct the surface feature matrix of the static mesh model according to the tangent vectors, binormal vectors and normal vectors of the vertices.
10. The method according to claim 8, wherein The step of driving the static mesh model to move according to the surface feature matrix, the local coordinates of the static mesh model, and the target texture coordinates corresponding to the multiple particles in the particle position texture map includes: Multiply the local coordinates of the static mesh model by the surface feature matrix and add the result to the target texture coordinates corresponding to the multiple particles in the particle position texture map to drive the static mesh model to move.
11. A motion control device for a static mesh model, characterized in that, The device includes: A generation module, configured to generate a rendering target texture map according to the movement positions of multiple particles; The generation module is further configured to generate a particle position texture map corresponding to the static mesh model according to the rendering target texture map and the static mesh model, where the particle position texture map includes: the target texture coordinates corresponding to the multiple particles; A driving module, configured to drive the static mesh model to move according to the particle position texture map.
12. An electronic device, characterized in that, It includes: A processor, a storage medium, and a bus. The storage medium stores program instructions executable by the processor. When the electronic device runs, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to perform the steps of the motion control method of the static mesh model according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, A computer program is stored on the storage medium, and when the computer program is run by the processor, it performs the steps of the motion control method of the static mesh model according to any one of claims 1 to 10.