A method for programmatically generating character clusters in CG scenes
The programmatic method uses three-dimensional modeling and chaotic random algorithm to generate role clusters in CG scenarios, which solves the problem of unnatural distribution and behavior of role clusters in the existing technology, and achieves a more realistic and dynamic scene effect.
Patent Information
- Application Number
- CN202411235492.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-09-04
AI Technical Summary
In CG scenarios, it is difficult for the prior art to efficiently create natural, irregular character cluster distributions and behaviors, making the scene look less realistic and dynamic enough.
Using programmatic methods, single characters are modeled through three-dimensional modeling software, skeleton systems and animations are created, role models are placed in the active area using chaotic random algorithm, and animations are allocated according to the degree of correlation to ensure the actions and positions between characters. The relationship is realistic.
It realizes the rapid generation and animation allocation of character clusters in CG scenes, making the scene visual experience more reasonable and realistic, and improving the naturalness and dynamicity of character clusters.
Smart Images

Figure CN118736073B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of character cluster generation in CG scenes, and in particular to a method for programmatically generating character clusters in CG scenes. Background Art
[0002] In the CG (Computer Graphics) scene, Character Crowd or Crowd Simulation refers to the simulation of a group of characters with autonomous behavior and interaction in a virtual environment. These characters can be humans, animals, robots, or any other type of virtual entities.
[0003] The need to generate character clusters in CG scenes is common in game development, film and television production, virtual reality and 3D simulation. Unreal Engine is a powerful game development engine that is not limited to game development, but is also widely used in film and television production, architectural design, virtual reality and 3D simulation. Unreal Engine provides a complete game solution, including multiple modules such as scripting language, physical simulation, animation system and rendering engine. It uses many advanced rendering technologies, such as true reflection and global illumination, to achieve very realistic picture effects. In addition, Unreal Engine also supports multi-platform use, such as PC, console, mobile device and Web, allowing developers to use the same code and resources on different platforms.
[0004] How to efficiently create natural, irregular character cluster distribution and behavior to make the CG scene look more realistic and dynamic is a technical problem that needs to be solved for every CG requirement. Summary of the invention
[0005] In order to solve the technical problem of generating clustered characters in a CG scene, the present invention provides a method for programmatically generating clustered characters in a CG scene. The following technical solution is adopted:
[0006] A method for programmatically generating a character cluster in a CG scene comprises the following steps:
[0007] Step 1: Model the single role according to the task parameters, and copy and generate a cluster role model library; determine the number and number of the single roles in the cluster role according to the selected cluster density to form a role cluster sub-library;
[0008] Step 2, generating multiple character animations based on a single character model, the multiple character animations forming a random character animation library, and calculating the correlation degree of the multiple character animations, selecting multiple pairs of character animations with correlation degrees greater than a set animation correlation degree threshold to generate a correlation character animation library;
[0009] Step 3, generating cluster role activity areas according to the task parameters, gridding the cluster role activity areas, and numbering all grids according to the set rules;
[0010] Step 4, randomly placing multiple single character models of the character cluster sub-library in the grid of the cluster character activity area according to the chaotic random algorithm, the center of gravity of the single single character model in the initial state coincides with the center point of the single grid, and the front orientation of the single character model is generated respectively by using the random algorithm;
[0011] Step 5, calculating the center-of-gravity distance and frontal orientation relationship of multiple single character models in the initial state, and calculating the model action correlation degree based on the center-of-gravity distance and frontal orientation relationship;
[0012] Step 6, setting the action time switching interval, at the next action time switching node, extracting multiple character animations from the random character animation library based on the chaotic random algorithm and randomly assigning them to multiple single character models whose model action correlation degree is lower than the set character correlation degree threshold; for multiple pairs of single character models whose correlation degree is greater than or equal to the set role correlation degree threshold, pairing and labeling them respectively, extracting multiple pairs of character animations from the associated character animation library based on the chaotic random algorithm and randomly assigning them to multiple pairs of single character models.
[0013] By adopting the above technical solution, first use 3D modeling software to model the single character according to the parameter requirements of the CG task, and create the character's skeleton system, which usually includes the main bones such as the head, torso, and limbs. Bind the skeleton system to the single character model to ensure that the bones can correctly affect the model. Set keyframes: set keyframes for the character's basic actions, such as walking, running, jumping, etc. Use animation software to create multiple character animations for a single character model. The character animation includes action animation and expression animation, such as walking at different speeds, running at different speeds, dancing with different dance moves, dodging, etc.; expression animations such as talking, laughing, crying, listening, etc.;
[0014] Generate a correlation character animation library for multiple pairs of character animations whose correlation is greater than a set animation correlation threshold. For example, different dancing movements belong to correlation character animations, and talking and listening also belong to correlation character animations. These correlation character animations are randomly assigned to multiple pairs of single character models whose subsequent model action correlation is higher than the threshold, which can increase the correlation of nearby character actions and make them look more reasonable and realistic.
[0015] The calculation of the model action correlation degree mainly refers to two conditions: one is distance and the other is direction. The closer the distance and the higher the direction correlation degree, the higher the correlation degree between the two role models.
[0016] For character models with a lower degree of correlation, a chaotic random algorithm is used to assign action animations.
[0017] It can quickly realize the character generation and animation allocation of character clusters in CG scenes, making the visual experience more reasonable and realistic.
[0018] Optionally, the method for calculating the degree of correlation of the character animation in step 2 includes the following steps:
[0019] Step 21, character animation data preprocessing;
[0020] Step 22, feature extraction; extracting the position data of all bones in each frame of the character animation, and using quaternions to extract the rotation data of the bones; calculating the rate of change of the bone position over time, and obtaining the velocity and acceleration data;
[0021] Step 23, calculate the correlation degree of each frame: for each frame, calculate the correlation degree of the bone position and rotation between the two animations; use the Euclidean distance to calculate the difference between the bone positions; angle measurement: calculate the angle difference between the two quaternions to reflect the rotation correlation degree;
[0022] Step 24, aggregate the aggregated correlation levels of all frames into a total score, assign different weights to different parts of the character animation, and calculate the correlation score.
[0023] By adopting the above technical solution, the character animation data preprocessing needs to ensure that all animation data are in the same coordinate space and scale, which usually involves translating, scaling and rotating the animation clips to align them; if the number of frames of two animations is different, they need to be resampled so that they can be compared at the same number of frames; the preprocessed character animation data is subsequently subjected to feature extraction, and then the degree of association is calculated based on the extracted features, and finally the degree of association is summarized into a total score, which represents the degree of association of the character animation.
[0024] Optionally, the method for calculating the association degree score in step 24 is:
[0025] For Euclidean distance between frames, bone positions The calculation formula is:
[0026] ;
[0027] in and Animation and Middle Frame No. The location of the bones;
[0028] For Frame, angle difference between bone rotations The calculation formula is:
[0029] ;
[0030] in, and Animation and Middle Frame No. The rotation quaternion of each bone;
[0031] Summarize the similarity measures of all frames to get the degree of association The calculation formula is:
[0032]
[0033] in is the total number of frames, is the weight factor of the positional association degree and the rotational association degree, is the Euclidean distance, It is The angle difference of the frame.
[0034] By adopting the above technical solution, suppose we have two animation clips and , they contain the same number of frames, for the Frame, first calculate the Euclidean distance between the bone positions , and then calculate the angle difference between the bone rotations Finally, based on the Euclidean distance and angle difference Calculate the degree of association , the action animation library can be quantified and the subsequent animation distribution can be more reasonable.
[0035] Optionally, in step 5, the method for calculating the degree of association of the model actions is:
[0036] Step 51: Calculate the individual character models respectively and single role model The distance between the centers of gravity is recorded as ;
[0037] Step 52: Get a single character model and Quaternion, using quaternion multiplication to calculate the orientation correlation of one single character model relative to another single character model ;
[0038] Step 53: Calculate the model action correlation degree The calculation formula is:
[0039] ;
[0040] in It is a single role model and single role model The degree of correlation, is the character distance adjustment factor, It is the degree of relevance towards.
[0041] Optionally, in step 52, the orientation correlation is calculated The formula is:
[0042] ;
[0043] and The roles and roles The quaternion of It's a role Relative to the role The orientation correlation.
[0044] By adopting the above technical solution, the single character model is calculated and single role model Center of gravity distance It can be calculated based on the grid position;
[0045] Subsequent degree of association In the calculation, the center of gravity distance The larger the value, the lower the correlation, and vice versa;
[0046] Calculating the orientation of an animated character usually involves determining the orientation (direction) of the character in three-dimensional space, which can be calculated using the character's rotation matrix, quaternion, or other representation.
[0047] Quaternion is a mathematical method for representing rotation in three-dimensional space. It can avoid the problem of universal joint lock and has high computational efficiency. First, obtain the single character model and Quaternions represent their orientations, and quaternion multiplication is used to calculate the orientation of one character relative to another.
[0048] Optionally, the grid numbering rule in step 3 is from left to right and from top to bottom.
[0049] By adopting the above technical solution, the numbering rule is not limited to from left to right, from top to bottom, but can be continuous.
[0050] Optionally, the specific method of the chaotic random algorithm in step 4 is:
[0051] Step 41, determining the number of single role models in the role cluster sub-library, determining the size of the cluster role activity area, and selecting the chaos map and parameters;
[0052] Step 42, using chaos mapping to generate chaos values of multiple single character models respectively, where the chaos values correspond to grid numbers;
[0053] Step 43: placing multiple single character models at corresponding numbered grids in the cluster character activity area based on the chaos values.
[0054] Optionally, the chaotic map is a Logistic map or a Henon map.
[0055] By adopting the above technical solution, the single character models are placed at the corresponding numbered grids in the cluster character activity area based on Logistic mapping or Henon mapping, which can achieve random results and improve the layout efficiency of the character cluster.
[0056] A device for programmatically generating character clusters in a CG scene comprises a memory and a processor. The memory stores a CG scene character cluster generation program designed using a method for programmatically generating character clusters in a CG scene. The processor runs the CG scene character cluster generation program to generate positions and actions of the character clusters in the CG scene.
[0057] Optionally, a display is also included, and the processor is communicatively connected to the display to control the display to display the position and action results of the character cluster in the CG scene.
[0058] In summary, the present invention includes at least one of the following beneficial technical effects:
[0059] The invention can provide a method for programmatically generating character clusters in CG scenes, using three-dimensional modeling software to model a single character, creating a skeleton system of the character, and binding the skeleton system to the single character model to ensure that the skeleton can correctly affect the model. Key frames are set for basic actions of the character, and animation software is used to produce multiple character animations of the single character model, the character animations including action animations and expression animations; for multiple pairs of character animations with a correlation degree greater than a set animation correlation degree threshold, a correlation character animation library is generated, and these correlation character animations are randomly assigned to multiple pairs of single character models with subsequent model action correlation degrees higher than the threshold, which can increase the correlation of nearby character actions and make them look more reasonable and real; the calculation of the model action correlation degree mainly refers to the distance and direction, the closer the distance and the higher the direction correlation degree, the higher the correlation degree between the two character models; and for the character model with a low correlation degree, a chaotic random algorithm is used to assign the action animation; the character generation and animation assignment of the character cluster in the CG scene can be quickly realized, making the visual experience more reasonable and real. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 The present invention is a flowchart of a method for programmatically generating character clusters in a CG scene. DETAILED DESCRIPTION
[0061] The present invention is further described in detail below in conjunction with the accompanying drawings.
[0062] The embodiment of the invention discloses a method for programmatically generating character clusters in a CG scene.
[0063] Reference Figure 1 Embodiment 1, a method for programmatically generating a character cluster in a CG scene comprises the following steps:
[0064] Step 1: Model the single role according to the task parameters, and copy and generate a cluster role model library; determine the number and number of the single roles in the cluster role according to the selected cluster density to form a role cluster sub-library;
[0065] Step 2, generating multiple character animations based on a single character model, the multiple character animations forming a random character animation library, and calculating the correlation degree of the multiple character animations, selecting multiple pairs of character animations with correlation degrees greater than a set animation correlation degree threshold to generate a correlation character animation library;
[0066] Step 3, generating cluster role activity areas according to the task parameters, gridding the cluster role activity areas, and numbering all grids according to the set rules;
[0067] Step 4, randomly placing multiple single character models of the character cluster sub-library in the grid of the cluster character activity area according to the chaotic random algorithm, the center of gravity of the single single character model in the initial state coincides with the center point of the single grid, and the front orientation of the single character model is generated respectively by using the random algorithm;
[0068] Step 5, calculating the center-of-gravity distance and frontal orientation relationship of multiple single character models in the initial state, and calculating the model action correlation degree based on the center-of-gravity distance and frontal orientation relationship;
[0069] Step 6, setting the action time switching interval, at the next action time switching node, extracting multiple character animations from the random character animation library based on the chaotic random algorithm and randomly assigning them to multiple single character models whose model action correlation degree is lower than the set character correlation degree threshold; for multiple pairs of single character models whose correlation degree is greater than or equal to the set role correlation degree threshold, pairing and labeling them respectively, extracting multiple pairs of character animations from the associated character animation library based on the chaotic random algorithm and randomly assigning them to multiple pairs of single character models.
[0070] First, according to the parameter requirements of the CG task, use 3D modeling software to model the single character and create the character's skeleton system, which usually includes the main bones such as the head, torso, and limbs. Bind the skeleton system to the single character model to ensure that the bones can correctly affect the model. Set keyframes: set keyframes for the character's basic actions, such as walking, running, jumping, etc. Use animation software to create multiple character animations for a single character model. Character animation includes action animation and expression animation, such as walking at different speeds, running at different speeds, dancing with different dance moves, dodging, etc.; expression animations such as talking, laughing, crying, listening, etc.
[0071] Generate a correlation character animation library for multiple pairs of character animations whose correlation is greater than a set animation correlation threshold. For example, different dancing movements belong to correlation character animations, and talking and listening also belong to correlation character animations. These correlation character animations are randomly assigned to multiple pairs of single character models whose subsequent model action correlation is higher than the threshold, which can increase the correlation of nearby character actions and make them look more reasonable and realistic.
[0072] The calculation of the model action correlation degree mainly refers to two conditions: one is distance and the other is direction. The closer the distance and the higher the direction correlation degree, the higher the correlation degree between the two role models.
[0073] For character models with a lower degree of correlation, a chaotic random algorithm is used to assign action animations.
[0074] It can quickly realize the character generation and animation allocation of character clusters in CG scenes, making the visual experience more reasonable and realistic.
[0075] The method for calculating the correlation degree of the character animation in step 2 includes the following steps:
[0076] Step 21, character animation data preprocessing;
[0077] Step 22, feature extraction; extracting the position data of all bones in each frame of the character animation, and using quaternions to extract the rotation data of the bones; calculating the rate of change of the bone position over time, and obtaining the velocity and acceleration data;
[0078] Step 23, calculate the correlation degree of each frame: for each frame, calculate the correlation degree of the bone position and rotation between the two animations; use the Euclidean distance to calculate the difference between the bone positions; angle measurement: calculate the angle difference between the two quaternions to reflect the rotation correlation degree;
[0079] Step 24, aggregate the aggregated correlation levels of all frames into a total score, assign different weights to different parts of the character animation, and calculate the correlation score.
[0080] Character animation data preprocessing needs to ensure that all animation data is in the same coordinate space and scale, which usually involves translating, scaling, and rotating animation clips to align them; if the number of frames of two animations is different, they need to be resampled so that they can be compared at the same number of frames; the preprocessed character animation data is subsequently subjected to feature extraction, and the degree of association is calculated based on the extracted features, and finally the degree of association is summarized into a total score, which represents the degree of association of the character animations.
[0081] Step 24 calculates the association score by:
[0082] For Euclidean distance between frames, bone positions The calculation formula is:
[0083] ;
[0084] in and Animation and Middle Frame No. The location of the bones;
[0085] For Frame, angle difference between bone rotations The calculation formula is:
[0086] ;
[0087] in, and Animation and Middle Frame No. The rotation quaternion of each bone;
[0088] Summarize the similarity measures of all frames to get the degree of association The calculation formula is:
[0089]
[0090] in is the total number of frames, is the weight factor of the positional association degree and the rotational association degree, is the Euclidean distance, It is The angle difference of the frame.
[0091] Suppose we have two animation clips and , they contain the same number of frames, for the Frame, first calculate the Euclidean distance between the bone positions , and then calculate the angle difference between the bone rotations Finally, based on the Euclidean distance and angle difference Calculate the degree of association , the action animation library can be quantified and the subsequent animation distribution can be more reasonable.
[0092] In step 5, the method for calculating the degree of association of model actions is:
[0093] Step 51: Calculate the individual character models respectively and single role model The distance between the centers of gravity is recorded as ;
[0094] Step 52: Get a single character model and Quaternion, using quaternion multiplication to calculate the orientation correlation of one single character model relative to another single character model ;
[0095] Step 53: Calculate the model action correlation degree The calculation formula is:
[0096] ;
[0097] in It is a single role model and single role model The degree of correlation, is the character distance adjustment factor, It is the degree of relevance towards.
[0098] Step 52 calculates the orientation correlation The formula is:
[0099] ;
[0100] and The roles and roles The quaternion of It's a role Relative to the role The orientation correlation.
[0101] Computing Monomer Role Model and single role model Center of gravity distance It can be calculated based on the grid position;
[0102] Subsequent degree of association In the calculation, the center of gravity distance The larger the value, the lower the correlation, and vice versa;
[0103] Calculating the orientation of an animated character usually involves determining the orientation (direction) of the character in three-dimensional space, which can be calculated using the character's rotation matrix, quaternion, or other representation.
[0104] Quaternion is a mathematical method for representing rotation in three-dimensional space. It can avoid the problem of universal joint lock and has high computational efficiency. First, obtain the single character model and Quaternions represent their orientations, and quaternion multiplication is used to calculate the orientation of one character relative to another.
[0105] The grid numbering rule in step 3 is from left to right and from top to bottom.
[0106] The numbering rules are not limited to from left to right, from top to bottom, as long as they are continuous.
[0107] The specific method of the chaotic random algorithm in step 4 is:
[0108] Step 41, determining the number of single role models in the role cluster sub-library, determining the size of the cluster role activity area, and selecting the chaos map and parameters;
[0109] Step 42, using chaos mapping to generate chaos values of multiple single character models respectively, where the chaos values correspond to grid numbers;
[0110] Step 43: placing multiple single character models at corresponding numbered grids in the cluster character activity area based on the chaos values.
[0111] The chaotic map is either a Logistic map or a Henon map.
[0112] By placing the single character models at the corresponding numbered grids in the cluster character activity area based on Logistic mapping or Henon mapping, random results can be achieved and the efficiency of character cluster layout can be improved.
[0113] The following is a code example of a chaos map:
[0114] Use a chaos map to generate a series of chaotic values. These values will be used to determine the position of the character. The code example is as follows:
[0115] import numpy as np
[0116] def logistic_map(x,r):
[0117] return r×x×(1-x)
[0118] # Initialization parameters
[0119] r=3.99 # Logistic mapping parameter, should be selected within the chaotic range
[0120] x=0.5 # initial value
[0121] chaos_sequence = []
[0122] # Generate chaotic sequence
[0123] for_in range(1000):
[0124] x=logistic_map(x,r)
[0125] chaos_sequence.append(x);
[0126] The generated chaotic values are mapped to the grid coordinates to determine the character's position. The code is as follows:
[0127] # Assume the grid size is grid_width x grid_height
[0128] grid_width=10
[0129] grid_height=10
[0130] # Map chaos values to grid coordinates
[0131] positions=[]
[0132] for value in chaos_sequence:
[0133] grid_x=int(value ×grid_width)% grid_width
[0134] grid_y=int(value ×grid_height)% grid_height
[0135] positions.append((grid_x, grid_y));
[0136] Use the mapped coordinates to place the character model in the grid. The code is as follows:
[0137] # Assume we have a function to place the character model
[0138] def place_character_at(grid_x, grid_y):
[0139] # This should be the code to instantiate the character model and place it at the specified grid location
[0140] pass
[0141] # Place the character
[0142] for grid_x, grid_y in positions:
[0143] place_character_at(grid_x, grid_y);
[0144] The following is based on a specific task of generating a character cluster in a CG scene to illustrate the implementation principle of a method for programmatically generating a character cluster in a CG scene:
[0145] The CG scene is a rectangular playground area, and several characters need to be generated, with different actions;
[0146] First, make sure that all characters are human. To reduce the difficulty of modeling and scene layout, use the same character model with different appearance maps, the same character skeleton system, and use Maya's Animation module to create multiple character animations for a single character model. The character animation includes action animation and expression animation.
[0147] Action animations include slow walking, medium walking, fast walking, slow running, medium running, and fast running;
[0148] A first dance animation, a second dance animation, ..., an Nth dance animation;
[0149] The first martial arts animation, the second martial arts animation, ..., the Nth martial arts animation;
[0150] Animated actions such as avoidance;
[0151] Expression animations include speaking, listening, laughing, crying, etc.;
[0152] The character cluster sub-library is determined to be 60 human models, which are numbered B1, B2, ..., B60 respectively. The rectangular playground area is gridded into 600 grids according to the size ratio of the human models. Theoretically, each grid can accommodate two human models; the grids are numbered Grid1, Grid2, ..., Grid600;
[0153] Use Logistic mapping to place 60 human models in 600 grids respectively;
[0154] The correlation degree of the model actions of the two model human models was calculated respectively, and it was obtained that 5 pairs of human models, B2 and B21, B6 and B8, B15 and B25, B28 and B30, B35 and B5, had a large correlation degree. Based on the chaotic random algorithm, multiple pairs of character animations in the correlation character animation library were extracted and randomly assigned to these 5 pairs of human models, B2 and B21 were assigned to talking and listening, B6 and B8 were assigned to the first dance animation and the second dance animation, B15 and B25 were assigned to the first martial arts animation and the second martial arts animation, B28 and B30 were assigned to slow walking and medium walking, and B35 and B59 were assigned to slow running and avoiding.
[0155] A device for programmatically generating character clusters in a CG scene comprises a memory and a processor. The memory stores a CG scene character cluster generation program designed using a method for programmatically generating character clusters in a CG scene. The processor runs the CG scene character cluster generation program to generate positions and actions of the character clusters in the CG scene.
[0156] The system also includes a display, wherein the processor is in communication connection with the display and controls the display to display the position and action results of the character cluster in the CG scene.
[0157] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for programmatically generating character clusters in a CG scene, characterized in that: The following steps are involved: Step 1: Model the single role according to the task parameters, and copy and generate a cluster role model library; determine the number and number of the single roles in the cluster role according to the selected cluster density to form a role cluster sub-library; Step 2, generating multiple character animations based on a single character model, the multiple character animations forming a random character animation library, and calculating the correlation degree of the multiple character animations, selecting multiple pairs of character animations with correlation degrees greater than a set animation correlation degree threshold to generate a correlation character animation library; Step 3, generating cluster role activity areas according to the task parameters, gridding the cluster role activity areas, and numbering all grids according to the set rules; Step 4, randomly placing multiple single character models of the character cluster sub-library in the grid of the cluster character activity area according to the chaotic random algorithm, the center of gravity of the single single character model in the initial state coincides with the center point of the single grid, and the front orientation of the single character model is generated respectively by using the random algorithm; Step 5, calculating the center-of-gravity distance and frontal orientation relationship of multiple single character models in the initial state, and calculating the model action correlation degree based on the center-of-gravity distance and frontal orientation relationship; Step 6, setting the action time switching interval, at the next action time switching node, extracting multiple character animations from the random character animation library based on the chaotic random algorithm and randomly assigning them to multiple single character models whose model action correlation degree is lower than the set character correlation degree threshold; for multiple pairs of single character models whose correlation degree is greater than or equal to the set role correlation degree threshold, pairing and labeling them respectively, extracting multiple pairs of character animations from the associated character animation library based on the chaotic random algorithm and randomly assigning them to multiple pairs of single character models.
2. The method for programmatically generating character clusters in a CG scene according to claim 1, characterized in that: The method for calculating the correlation degree of the character animation in step 2 includes the following steps: Step 21, character animation data preprocessing; Step 22, feature extraction; extracting the position data of all bones in each frame of the character animation, and using quaternions to extract the rotation data of the bones; calculating the rate of change of the bone position over time, and obtaining the velocity and acceleration data; Step 23, calculate the correlation degree of each frame: for each frame, calculate the correlation degree of the bone position and rotation between the two animations; use the Euclidean distance to calculate the difference between the bone positions; angle measurement: calculate the angle difference between the two quaternions to reflect the rotation correlation degree; Step 24, aggregate the aggregated correlation levels of all frames into a total score, assign different weights to different parts of the character animation, and calculate the correlation score.
3. The method for programmatically generating character clusters in a CG scene according to claim 2, characterized in that: Step 24 calculates the association score by: For Euclidean distance between frames, bone positions The calculation formula is: ; in and They are animation and Middle Frame No. The location of the bones; For Frame, angle difference between bone rotations The calculation formula is: ; in, and They are animation and Middle Frame No. The rotation quaternion of each bone; Summarize the similarity measures of all frames to get the degree of association The calculation formula is: in is the total number of frames, is the weight factor of the positional association degree and the rotational association degree, is the Euclidean distance, It is The angle difference of the frame.
4. The method for programmatically generating character clusters in a CG scene according to claim 3, characterized in that: In step 5, the method for calculating the degree of association of model actions is: Step 51: Calculate the individual character models respectively and single role model The distance between the centers of gravity is recorded as ; Step 52: Get a single character model and Quaternion, using quaternion multiplication to calculate the orientation correlation of one single character model relative to another single character model ; Step 53: Calculate the model action correlation degree The calculation formula is: ; in It is a single role model and single role model The degree of correlation, is the character distance adjustment factor, It is the degree of relevance towards.
5. The method for programmatically generating character clusters in a CG scene according to claim 4, characterized in that: Step 52 calculates the orientation correlation The formula is: ; and The roles and roles The quaternion of It's a role Relative to the role The orientation correlation.
6. The method for programmatically generating character clusters in a CG scene according to claim 5, characterized in that: The grid numbering rule in step 3 is from left to right and from top to bottom.
7. The method for programmatically generating character clusters in a CG scene according to claim 6, characterized in that: The specific method of the chaotic random algorithm in step 4 is: Step 41, determining the number of single role models in the role cluster sub-library, determining the size of the cluster role activity area, and selecting the chaos map and parameters; Step 42, using chaos mapping to generate chaos values of multiple single character models respectively, where the chaos values correspond to grid numbers; Step 43: placing multiple single character models at corresponding numbered grids in the cluster character activity area based on the chaos values.
8. The method for programmatically generating character clusters in a CG scene according to claim 7, characterized in that: The chaotic map is either a Logistic map or a Henon map.
9. A device for programmatically generating character clusters in a CG scene, characterized in that: The method comprises a memory and a processor, wherein the memory stores a CG scene character cluster generation program designed by using a method for programmatically generating character clusters in a CG scene as described in any one of claims 1 to 8, and the processor runs the CG scene character cluster generation program to generate positions and actions of character clusters in a CG scene.
10. The device for programmatically generating character clusters in a CG scene according to claim 9, characterized in that: The system also includes a display, wherein the processor is in communication connection with the display and controls the display to display the position and action results of the character cluster in the CG scene.
Citation Information
Patent Citations
Real-time interaction 3D animation method, device and system
CN107274464A
Cluster role generation method and system in three-dimensional scene
CN117422799A
Skinning decomposition speed-up method and skinning decomposition speed-up program taking into account weight map locality
JP6487083B1
