Rapid motion distortion method and system based on real-time virtual environment obstacle analysis

By introducing real-time virtual environment obstacle analysis and continuous collision detection algorithms into motion distortion technology, combining the reverse calculation method and distortion algorithm, the problems of adaptation and performance consumption of complex 3D scenes are solved, robustness and efficiency are improved, and the Adaptation range.

CN119068090AActive Publication Date: 2024-12-03ZHEJIANG UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411076906.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-12-03
Estimated Expiration
2044-08-07

AI Technical Summary

Technical Problem

The existing motion distortion technology has difficulty adapting to complex 3D scenes, large performance consumption during runtime, insufficient configuration, and small range of animation resources, especially the low production efficiency of manual marking methods and poor robustness of simple collision detection algorithms. .

Method used

Using a fast motion distortion method based on real-time virtual environment obstacle analysis, the motion distortion range and bone data of cartoon clips are configured through offline stages, and the obstacle situation is analyzed using continuous collision detection algorithm in real-time stages, and the position of the target bone is calculated through inverse calculation method, combined with Simple warping and adjustment blending warping algorithms perform motion distortion.

Benefits of technology

It improves the robustness and efficiency of motion distortion technology, reduces the workload of scene designers, adapts to complex virtual environments, expands the adaptation range of algorithms, and improves computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119068090A_ABST
    Figure CN119068090A_ABST
Patent Text Reader

Abstract

The invention discloses a rapid motion distortion method and system based on real-time virtual environment obstacle analysis. The method comprises the following steps: determining a starting point and a distortion algorithm of motion distortion of an animation segment by using an animation tool in an offline stage; preprocessing the animated segments and storing related skeleton data; in the real-time stage, analyzing the virtual environment according to a continuous collision detection algorithm to find a proper motion path and a target point location in the virtual environment; calculating the final position of the target skeleton in the motion distortion by adopting an inverse calculation method; and carrying out rapid motion distortion by adopting skeleton data. The obstacle condition of the role in the current virtual environment is evaluated through the real-time detection algorithm, the animation segments are deformed by adopting the improved motion distortion algorithm, the purpose that the virtual role can smoothly move in the complex three-dimensional environment is achieved, the crossing behavior of the role in the scene is more stable and efficient, and the effect is better. The time of repeatedly designing similar role animations by an animator is shortened, and the overall efficiency of an animation production line is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer character animation, and in particular to a fast motion distortion method and system based on real-time virtual environment obstacle analysis. Background Art

[0002] The electronic game industry is booming in today's society. Virtual games have become an indispensable part of people's entertainment life and are leading the trend of the digital entertainment industry. Among them, computer character animation, as a key component of 3D games, plays an important role in shaping game scenes and enriching game storylines. However, as the scale and quality requirements of virtual games continue to increase, animation designers are faced with the challenge of producing a large number of animation resources, which not only consumes time and human resources, but also restricts the efficiency and cost control of game production. In order to effectively deal with this problem, motion distortion technology has become a highly-regarded solution. This technology focuses on improving the reusability of animation resources, thereby helping animation designers save the time cost of developing similar resources.

[0003] Currently, in the game industry, the mainstream motion distortion solution includes two parts: first, determining the target points of motion distortion through analysis of virtual scenes. This part is usually done by scene designers through manual marking when making scene resources. This method has low production efficiency. Secondly, there is the implementation of motion distortion algorithm. There are two mainstream algorithms in this part, namely simple warping algorithm and adjustment blending warping algorithm. These two algorithms have their own advantages and disadvantages in terms of implementation difficulty and performance effect.

[0004] However, this technology encounters problems such as difficulty in adapting to complex 3D scenes and high performance consumption during operation. For more complex 3D virtual scenes, the method of manual marking by scene designers can accurately determine the target points, but the production efficiency of this method is very low. Simple collision detection algorithms have poor robustness and are prone to problems such as penetration. For current mainstream mobile devices, the large number of bone-level operations brought about by the motion distortion process is accompanied by great computing consumption. In addition, the traditional motion distortion system also has problems such as inflexible configuration and small adaptation range of animation resources. Summary of the invention

[0005] The purpose of the present invention is to provide a fast motion distortion method and system based on real-time virtual environment obstacle analysis in view of the deficiencies of the prior art.

[0006] The objective of the present invention is achieved through the following technical solutions: In a first aspect, an embodiment of the present invention provides a fast motion distortion method based on real-time virtual environment obstacle analysis, comprising the following steps:

[0007] S1, offline stage, configuring the motion distortion range, distortion process curve, reference skeleton, target skeleton and distortion algorithm used in the animation clip in the animation tool;

[0008] S2, according to the animation curve value in the original animation clip, storing the hierarchical data of the reference bone in the curve value;

[0009] S3, real-time stage, using continuous collision detection algorithm to analyze obstacles in the virtual environment where the character is located, including: whether there are obstacles in front, whether there are occlusions on the character's climbing path, and whether there are legal footholds on the obstacles; and modifying the continuous collision detection algorithm according to the specific needs of the virtual character's crossing behavior, where the specific needs of the virtual character's crossing behavior include: detecting whether the character will be blocked by obstacles in the current crossing path according to the movement direction and distance of the character's behavior, and judging whether the final foothold can meet the virtual character's standing needs according to the data in the collision detection results;

[0010] S4, using a back calculation method, according to the target point position of the reference skeleton and the animation data of the end frame of the animation, the position of the target skeleton is calculated to obtain the final landing point position of the motion distortion;

[0011] S5. Perform motion warping according to the pre-stored bone data in the offline stage and the final landing point of the motion warping, and calculate the motion path of the target bone during the motion warping.

[0012] Furthermore, the warping algorithm includes a simple warping algorithm and an adjustment blending warping algorithm.

[0013] Furthermore, in the simple warping algorithm, the calculation formula for the value of each frame in the character motion warping process is:

[0014]

[0015] Among them, W i Indicates the value of the character at the i-th frame of motion distortion, t i Indicates the duration of the animation playback at the i-th frame, T is the total duration of the motion distortion range, It represents the value of the distortion process curve at the calculated i-th frame, and D is the total distance between the player's initial position and the target position.

[0016] Furthermore, in the adjustment blending warping algorithm, the recursive calculation formula for the value of each frame in the character motion warping process is:

[0017]

[0018] Among them, W i Indicates the value of the character at the i-th frame of motion distortion, b i and b j They represent the values ​​of the original animation clip at the i-th frame and the j-th frame within the motion distortion range, n represents the total number of animation frames within the motion distortion range, and W n and W0 represent the values ​​of the end frame and start frame of the character during the motion distortion process respectively.

[0019] Furthermore, the hierarchical data storage formula of the reference skeleton is expressed as:

[0020]

[0021] Among them, M i,r,t Represents the hierarchical data matrix of the reference bone r relative to the target bone t in the i-th frame animation data, where r is the serial number of the reference bone, t is the serial number of the target bone, and L i,k is the bone hierarchy matrix of the bone with bone number k in the i-th frame animation data in the local space, where i = 0, 1, 2, ..., n represents a total of n frames in the animation clip, k = r, r + 1, ..., t represents all bone numbers in the hierarchy from the reference bone to the target bone, and finally M of each frame of animation data within the motion distortion range i,r,t All will be pre-stored.

[0022] Furthermore, in step S3, the process of the modified continuous collision detection algorithm specifically includes:

[0023] S31, mobile obstacle detection: multiple capsule body detections are sent in the direction of the character's advance to achieve continuous collision detection. If there is a collision detection result, there is an obstacle ahead, and the subsequent detection step is entered to continue to detect whether the obstacle can be overcome by twisting and turning the movement; if there is no collision detection result, there is no obstacle ahead, and the detection ends;

[0024] S32, forward and landing point detection: continuous collision detection is performed in the direction of the character's pre-movement. If a collision occurs, there is an obstruction on the moving trajectory and the motion distortion cannot be triggered; if no collision occurs, a landing point detection is performed to find the initial landing point. If the initial landing point is found, the subsequent detection steps are entered; if the initial landing point is not found, the detection ends;

[0025] S33, upward detection: based on the forward and landing point detection results of step S32, an upward detection is performed to determine whether there is any obstruction above the character. If there is an obstruction above the character, the motion distortion cannot be triggered; if there is no obstruction above the character, based on the end point of the upward detection, the forward and landing point detection of step S32 is performed again. If the detection passes, the middle landing point is found; if the detection fails, the starting point of the upward detection is raised, and multiple judgments are performed until the middle landing point is found. If a suitable middle landing point is still not found after multiple judgments, the detection ends;

[0026] S34, platform forward and landing point detection: starting from the upward detection result of step S33, forward detection is performed to find the final landing point of the climb; wherein, the forward detection distance is determined according to the offset of the segment in the animation; if there is an obstacle during the detection process or there is no final landing point or the final landing point is illegal, the detection ends;

[0027] S35, trajectory test: based on the forward and landing point detection results of step S32, the upward detection result of step S33, and the platform forward and landing point detection results in step S34, the initial landing point, the intermediate landing point and the final landing point are connected into two line segments in sequence to obtain a preliminary motion trajectory; test whether there are obstacles on the preliminary motion trajectory. If there are no obstacles on the preliminary motion trajectory, the trajectory test passes and a preliminary motion distortion trajectory is obtained; if the test is exited halfway, the motion distortion cannot be triggered.

[0028] Furthermore, the position of the target bone is obtained according to the following formula:

[0029] W t =M r,t ×W r

[0030] Among them, W t Represents the position, rotation and scale data of the target bone t, W r Represents the position, rotation and scale data of the reference bone r, M r,t It is the hierarchical data matrix of the reference bone relative to the target bone.

[0031] Furthermore, the step S5 specifically includes:

[0032] Based on the motion distortion trajectory of the target bone obtained in step S3 and the final landing point position obtained in step S4, the bone data pre-stored in step S2 is used, and the distortion algorithm configured in step S1 is adopted to perform motion distortion, and the motion path of the target bone during the motion distortion is calculated. The motion path includes the transformation information of the target bone in each frame during the motion distortion.

[0033] A second aspect of an embodiment of the present invention provides a fast motion distortion system based on real-time virtual environment obstacle analysis, which is used to implement the above-mentioned fast motion distortion method based on real-time virtual environment obstacle analysis, including:

[0034] Animation tool module, used to configure the motion distortion range, distortion process curve, reference bones, target bones and distortion algorithm used in the animation clip in the animation tool;

[0035] A preprocessing calculation module, used for pre-storing hierarchical data of reference bones of each frame in the curve value according to the animation curve value in the original animation clip and the corresponding bones and motion distortion range configured by the animation tool module;

[0036] The virtual environment analysis module is used to analyze the obstacle situation in the virtual environment where the character is located by using a continuous collision detection algorithm, including: whether there is an obstacle in front, whether there is an obstruction on the character's upward climbing path, and whether there is a legal foothold on the obstacle; and the continuous collision detection algorithm is modified according to the specific needs of the virtual character's crossing behavior, wherein the specific needs of the virtual character's crossing behavior specifically include: detecting whether the character will be blocked by obstacles in the current crossing path according to the movement direction and distance of the character's behavior, and judging whether the final foothold can meet the virtual character's standing needs according to the data in the collision detection result;

[0037] A target position back-calculation module is used to calculate the position of the target bone by using a back-calculation method according to the target point position of the reference bone and the animation data of the end frame of the animation, so as to obtain the final landing point position of the motion distortion; and

[0038] The motion distortion algorithm module is used to perform motion distortion according to the bone data pre-stored in the offline stage and the final landing point position calculated by the target position back-calculation module, and calculate the motion path of the target bone during the motion distortion process.

[0039] The beneficial effects of the present invention are:

[0040] (1) The present invention realizes real-time virtual environment obstacle analysis in electronic games by introducing a continuous collision detection algorithm, can evaluate a more robust path for the character, and optimizes the existing motion distortion technology through preprocessing and other methods.

[0041] (2) After adopting the continuous collision detection algorithm, the present invention reduces the workload of scene designers in marking target points in scene resources and optimizes the production line of the original motion distortion system; and by modifying the continuous collision detection algorithm, it can adapt to complex virtual environments; by introducing the inverse calculation method in the process of calculating the target points, the problem of the small adaptation range of the traditional motion distortion algorithm is expanded, and through the preprocessing method, the calculation efficiency of the algorithm is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 is a flow chart of a fast motion distortion method based on real-time virtual environment obstacle analysis of the present invention;

[0043] Figure 2 is a schematic diagram of an animation offline configuration tool of the present invention;

[0044] Figure 3 It is a schematic diagram of the steps of the continuous collision detection algorithm in the virtual environment obstacle analysis of the present invention;

[0045] Figure 4 is a schematic diagram of the implementation result of the motion distortion algorithm of the present invention;

[0046] Figure 5 It is a structural schematic diagram of a fast motion distortion system based on real-time virtual environment obstacle analysis of the present invention. DETAILED DESCRIPTION

[0047] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims. It should be understood that the above general description and the detailed description that follows are merely exemplary and explanatory and cannot limit the present application.

[0048] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0049] It should be understood that, although the term first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of..." or "when..." or "in response to determination". Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process and method including a series of elements include not only those elements, but also include other elements not clearly listed, or also include elements inherent to such process and method. In the absence of more restrictions, the elements limited by the statement "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements.

[0050] The present invention is described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the features of the following embodiments and implementations can be combined with each other.

[0051] The present invention analyzes obstacles in a complex virtual environment based on a continuous collision detection algorithm, bringing more robustness and efficiency to traditional motion distortion methods and systems.

[0052] like Figure 1 As shown, the fast motion distortion method based on real-time virtual environment obstacle analysis of the present invention specifically includes the following steps:

[0053] S1. Offline stage: configure the motion distortion range, distortion process curve, reference bone, target bone and distortion algorithm used in the animation clip in the animation tool.

[0054] Specifically, in the offline phase, Figure 2 Configure the animation clip parameters in the animation tool shown, including: Figure 2 Configure the motion distortion range at the Start and End of the Ref Bone Infos in Figure 2 Configure the distortion process curve at Anim WarpCurves in Figure 2 Configure the reference bone at Ref Bone Infos in Figure 2 Configure the target bone in RawBone Infos in Figure 2The warping algorithm used is configured in the Warp Mode in the . The motion warping range and warping process curve configured in the offline stage will be used in step S5, which determine which parts of the original animation clip will be used for motion warping and the final performance during warping; and the configured reference bones and target bones will be used in step S4, which determine which bones of the character the final position of the motion warping needs to be aligned with, ensuring that the interaction between the character and the scene will not appear interlaced or suspended.

[0055] It should be understood that if Figure 2 The animation tool shown works by configuring the necessary parameters needed for motion warping and pre-storing the character's bone hierarchy matrices.

[0056] Furthermore, the warping algorithm includes a simple warping algorithm and an adjustment blending warping algorithm.

[0057] Furthermore, in the simple warping algorithm, the calculation formula for the value of each frame during the character motion warping process is:

[0058]

[0059] Among them, W i Indicates the value of the character at the i-th frame of motion distortion, t i Indicates the duration of the animation playback at the i-th frame, T is the total duration of the motion distortion range, It represents the value of the distortion process curve (i.e. Anim Warp Curve in the animation tool) at the calculated i-th frame, and D is the total distance between the player's initial position and the target position.

[0060] Furthermore, in the adjustment blending warping algorithm, the recursive calculation formula for the value of each frame during the character motion warping process is:

[0061]

[0062] Among them, W i Indicates the value of the character at the i-th frame of motion distortion, b i and b j They represent the values ​​of the original animation clip at the i-th frame and the j-th frame within the motion distortion range, n represents the total number of animation frames within the motion distortion range, and W n W0 and W1 represent the values ​​of the end frame (i.e., the End value configured in the Ref Bone Infos in the animation tool) and the start frame (i.e., the Start value configured in the Ref Bone Infos in the animation tool) of the character during the motion distortion process, respectively.n It is known after step S4.

[0063] S2. According to the animation curve value in the original animation clip (animation created by the animation designer), the hierarchical data of the reference bones in the curve value is stored, such as Figure 2 Bone Matrix In Cs.

[0064] Furthermore, the hierarchical data storage formula of the reference skeleton is expressed as:

[0065]

[0066] Among them, M i,r,t Represents the hierarchical data matrix of the reference bone r relative to the target bone t in the i-th frame animation data, where r is the serial number of the reference bone, t is the serial number of the target bone, and L i,k is the bone hierarchy matrix of the bone with bone number k in the i-th frame animation data in the local space, where i = 0, 1, 2, ..., n represents a total of n frames in the animation clip, k = r, r + 1, ..., t represents all bone numbers in the hierarchy from the reference bone to the target bone, and finally M of each frame of animation data within the motion distortion range i,r,t All will be pre-stored.

[0067] S3, real-time stage, using continuous collision detection algorithm to analyze obstacles in the virtual environment where the character is located, including: whether there are obstacles in front, whether there are occlusions on the character's climbing path, and whether there are legal footholds on the obstacles. And according to the specific needs of the virtual character's crossing behavior, the continuous collision detection algorithm is adaptively modified, where the specific needs of the virtual character's crossing behavior include: according to the movement direction and distance of the character's behavior, whether the character will be blocked by obstacles in the current crossing path can avoid the occurrence of model penetration problems; according to the data in the collision detection results (including point position, normal, etc.), judge whether the final foothold can meet the standing needs of the virtual character.

[0068] Furthermore, the process of the modified continuous collision detection algorithm specifically includes:

[0069] S31. Mobile obstacle detection: Multiple capsule detections are sent in the direction of the character's advance to achieve continuous collision detection. If there is a collision detection result, it means that there is an obstacle ahead, and the subsequent detection step is entered to continue detecting whether the obstacle can be overcome by twisting and turning the movement; if there is no collision detection result, it means that there is no obstacle ahead, and the detection ends.

[0070] S32, forward and landing point detection: continuous collision detection is performed in the direction of the character's intended movement. If a collision occurs, it means that there is an obstruction on the moving trajectory and the motion distortion cannot be triggered; if no collision occurs, a landing point detection is performed to find the initial landing point. If the initial landing point is found, the subsequent detection steps are entered; if the initial landing point is not found, the detection ends.

[0071] It should be noted that the initial foothold will be used as the starting point for climbing, and the foothold test is to detect downward from the end point of the forward detection to determine whether there is actual ground or building support.

[0072] S33, upward detection: Based on the forward and landing point detection results of step S32, an upward detection is performed to determine whether there is any obstruction above the character. If there is an obstruction above the character, the motion distortion cannot be triggered; if there is no obstruction above the character, based on the end point of the upward detection, the forward and landing point detection of step S32 is performed again. If the detection passes, the middle landing point is found; if the detection fails, the starting point of the upward detection is raised, and multiple judgments are performed until the middle landing point is found. If a suitable middle landing point is still not found after multiple judgments, the detection ends.

[0073] It should be noted that the middle foothold will be used as the point of hand support during climbing. The specific number of lifts can be set according to the highest climbing height. The higher the height that can be climbed, the more times you can do it, and vice versa.

[0074] S34, platform forward and landing point detection: starting from the upward detection result of step S33, forward detection is performed to find the final landing point of the climb. The forward detection distance is determined according to the offset of the segment in the animation; if there is an obstacle during the detection process or there is no final landing point or the final landing point is illegal, the detection ends.

[0075] S35, trajectory test: based on the forward and landing point detection results of step S32, the upward detection result of step S33, and the platform forward and landing point detection results in step S34, the initial landing point, the intermediate landing point and the final landing point are connected into two line segments in sequence to obtain a preliminary motion trajectory; test whether there are obstacles on the preliminary motion trajectory. If there are no obstacles on the preliminary motion trajectory, the trajectory test passes and a preliminary motion distortion trajectory is obtained; if it is exited halfway, it means that the current preliminary motion trajectory is illegal and the motion distortion cannot be triggered.

[0076] S4. Using the inverse calculation method, according to the target point position of the reference bone and the animation data of the end frame of the animation, the position of the target bone is calculated to obtain the final landing point position of the motion distortion.

[0077] Furthermore, the position of the target bone is obtained according to the following formula:

[0078] W t =M r,t ×W r

[0079] Among them, W t Represents the position, rotation and scale data of the target bone t, W r Represents the position, rotation and scale data of the reference bone r, M r,t The hierarchical data matrix of the reference bone pre-stored in step S2 relative to the target bone can be quickly obtained from the pre-stored data. The above formula can be used to quickly inversely calculate the target bone data through the reference bone data without performing a large number of hierarchical matrix operations at runtime.

[0080] It should be noted that the formula of the inverse algorithm in step S4 is consistent with that in step S2. Since the reference bone data is pre-stored in step S2, the transformation information (including position, rotation, and scaling) of the target bone on the preliminary motion trajectory can be quickly inversely calculated.

[0081] For example, the implementation process of the modified continuous collision detection algorithm in the virtual environment obstacle analysis is as follows: Figure 3 As shown, Figure 3 The five parts shown in the figure represent the five steps of the modified continuous collision detection. The rose-red part is a schematic diagram of the character's skeleton, the black part is the platform that the character needs to climb, and the capsule part of each part represents the range of continuous collision detection. The circles in step S2, step S3, and step S4 represent the positions of the collision detection results. When all the tests are passed, it means that the character can currently perform climbing behavior and enter the motion distortion algorithm link.

[0082] S5. Perform motion warping according to the pre-stored bone data in the offline stage and the final landing point of the motion warping, and calculate the motion path of the target bone during the motion warping.

[0083] Specifically, based on the motion distortion trajectory of the target bone obtained in step S3 and the final landing position obtained in step S4, the bone data pre-stored in step S2 is used, and the distortion algorithm configured in step S1 is adopted to perform motion distortion, and the motion path of the target bone during the motion distortion is calculated. The motion path includes the transformation information of the target bone in each frame during the motion distortion.

[0084] It should be noted that, when calculating the motion path of the target bone during the motion distortion process, calling the pre-stored bone data in step S2 can greatly increase the calculation efficiency.

[0085] For example, the motion warping algorithm implementation results are as follows: Figure 4As shown, the rose red part is a schematic diagram of the character's skeleton, the black part is the platform that the character needs to climb, and the yellow part is the point position of each frame during the motion distortion process. During the motion distortion process, the character's skeleton will be displaced along the path, which is convenient for modifying the motion path of the character's skeleton. In addition, thanks to the back calculation method of step S4, it can be seen that the character's current reference skeleton (i.e., the left hand skeleton) is consistent with the final landing point position, and the performance is in line with expectations. With the help of the skeleton data stored in step S2, the calculation efficiency of the motion path is very high.

[0086] It is worth mentioning that an embodiment of the present invention further provides a fast motion distortion system based on real-time virtual environment obstacle analysis, which is used to implement the fast motion distortion method based on real-time virtual environment obstacle analysis in the above embodiment.

[0087] like Figure 5 As shown, the fast motion distortion system based on real-time virtual environment obstacle analysis includes an animation tool module, a preprocessing calculation module, a virtual environment analysis module, a target position backcalculation module and a motion distortion algorithm module.

[0088] In this embodiment, the animation tool module is used to configure the motion distortion range, distortion process curve, reference skeleton, target skeleton and distortion algorithm used in the animation clip in the animation tool.

[0089] It should be noted that the animation tool module can also configure the necessary parameters required by other subsequent algorithms according to the needs of animation designers.

[0090] In this embodiment, the preprocessing calculation module is used to pre-store the hierarchical data of the reference bones of each frame in the curve value according to the animation curve value in the original animation clip and the corresponding bones and motion distortion range configured by the animation tool module.

[0091] In this embodiment, the virtual environment analysis module is used to use a continuous collision detection algorithm to analyze the obstacle situation in the virtual environment where the character is located, specifically including: whether there is an obstacle in front, whether there is any obstruction on the path for the character to climb up, and whether there is a legal foothold on the obstacle; and according to the specific needs of the virtual character's crossing behavior, the continuous collision detection algorithm is adaptively modified, wherein the specific needs of the virtual character's crossing behavior specifically include: according to the movement direction and distance of the character's behavior, detecting whether the character will be blocked by obstacles in the current crossing path can avoid the occurrence of penetration problems; according to the data in the collision detection results (including point position, normal, etc.), judging whether the final foothold can meet the standing needs of the virtual character.

[0092] In this embodiment, the target position back-calculation module is used to calculate the position of the target bone by using a back-calculation method according to the target point position of the reference bone and the animation data of the end frame of the animation, so as to obtain the final landing point position of the motion distortion.

[0093] In this embodiment, the motion distortion algorithm module is used to perform motion distortion according to the pre-stored bone data in the offline stage and the final landing point position calculated by the target position back-calculation module, and calculate the motion path of the target bone during the motion distortion process.

[0094] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A fast motion distortion method based on real-time virtual environment obstacle analysis, characterized in that: The following steps are involved: S1, offline stage, configuring the motion distortion range, distortion process curve, reference skeleton, target skeleton and distortion algorithm used in the animation clip in the animation tool; S2, according to the animation curve value in the original animation clip, storing the hierarchical data of the reference bone in the curve value; S3, real-time stage, using continuous collision detection algorithm to analyze obstacles in the virtual environment where the character is located, including: whether there are obstacles in front, whether there are occlusions on the character's climbing path, and whether there are legal footholds on the obstacles; and modifying the continuous collision detection algorithm according to the specific needs of the virtual character's crossing behavior, where the specific needs of the virtual character's crossing behavior include: detecting whether the character will be blocked by obstacles in the current crossing path according to the movement direction and distance of the character's behavior, and judging whether the final foothold can meet the virtual character's standing needs according to the data in the collision detection results; S4, using a back calculation method, according to the target point position of the reference skeleton and the animation data of the end frame of the animation, the position of the target skeleton is calculated to obtain the final landing point position of the motion distortion; S5. Perform motion warping according to the pre-stored bone data in the offline stage and the final landing point of the motion warping, and calculate the motion path of the target bone during the motion warping.

2. The fast motion distortion method based on real-time virtual environment obstacle analysis according to claim 1, characterized in that: The warping algorithm includes a simple warping algorithm and an adjustment blending warping algorithm.

3. The fast motion distortion method based on real-time virtual environment obstacle analysis according to claim 2, characterized in that: In the simple warping algorithm, the calculation formula for the value of each frame during the character motion warping process is: Among them, W i Indicates the value of the character at the i-th frame of motion distortion, t i Indicates the duration of the animation playback at the i-th frame, T is the total duration of the motion distortion range, It represents the value of the distortion process curve at the calculated i-th frame, and D is the total distance between the player's initial position and the target position.

4. The fast motion distortion method based on real-time virtual environment obstacle analysis according to claim 2, characterized in that: In the adjustment blending warping algorithm, the recursive calculation formula for the value of each frame during the character motion warping process is: Among them, W i Indicates the value of the character at the i-th frame of motion distortion, b i and b j They represent the values ​​of the original animation clip at the i-th frame and the j-th frame within the motion distortion range, n represents the total number of animation frames within the motion distortion range, and W n and W0 represent the values ​​of the end frame and start frame of the character during the motion distortion process respectively.

5. The fast motion distortion method based on real-time virtual environment obstacle analysis according to claim 1, characterized in that: The hierarchical data storage formula of the reference skeleton is expressed as: Among them, M i,, Represents the hierarchical data matrix of the reference bone r relative to the target bone t in the i-th frame animation data, where r is the serial number of the reference bone, t is the serial number of the target bone, and L i, is the bone hierarchy matrix of the bone with bone number k in the i-th frame animation data in the local space, where i = 0, 1, 2, ..., n represents a total of n frames in the animation clip, k = r, r + 1, ..., t represents all bone numbers in the hierarchy from the reference bone to the target bone, and finally M of each frame of animation data within the motion distortion range i,, All will be pre-stored.

6. The fast motion distortion method based on real-time virtual environment obstacle analysis according to claim 1, characterized in that: In step S3, the process of the modified continuous collision detection algorithm specifically includes: S31, mobile obstacle detection: multiple capsule body detections are sent in the direction of the character's advance to achieve continuous collision detection. If there is a collision detection result, there is an obstacle ahead, and the subsequent detection step is entered to continue to detect whether the obstacle can be overcome by twisting and turning the movement; if there is no collision detection result, there is no obstacle ahead, and the detection ends; S32, forward and landing point detection: continuous collision detection is performed in the direction of the character's pre-movement. If a collision occurs, there is an obstruction on the moving trajectory and the motion distortion cannot be triggered; if no collision occurs, a landing point detection is performed to find the initial landing point. If the initial landing point is found, the subsequent detection steps are entered; if the initial landing point is not found, the detection ends; S33, upward detection: based on the forward and landing point detection results of step S32, an upward detection is performed to determine whether there is any obstruction above the character. If there is an obstruction above the character, the motion distortion cannot be triggered; if there is no obstruction above the character, based on the end point of the upward detection, the forward and landing point detection of step S32 is performed again. If the detection passes, the middle landing point is found; if the detection fails, the starting point of the upward detection is raised, and multiple judgments are performed until the middle landing point is found. If a suitable middle landing point is still not found after multiple judgments, the detection ends; S34, platform forward and landing point detection: starting from the upward detection result of step S33, forward detection is performed to find the final landing point of the climb; wherein, the forward detection distance is determined according to the offset of the segment in the animation; if there is an obstacle during the detection process or there is no final landing point or the final landing point is illegal, the detection ends; S35, trajectory test: based on the forward and landing point detection results of step S32, the upward detection result of step S33, and the platform forward and landing point detection results in step S34, the initial landing point, the intermediate landing point and the final landing point are connected into two line segments in sequence to obtain a preliminary motion trajectory; test whether there are obstacles on the preliminary motion trajectory. If there are no obstacles on the preliminary motion trajectory, the trajectory test passes and a preliminary motion distortion trajectory is obtained; if the test is exited halfway, the motion distortion cannot be triggered.

7. The fast motion distortion method based on real-time virtual environment obstacle analysis according to claim 1, characterized in that: The position of the target bone is obtained according to the following formula: W t =M r, ×W r Among them, W t Represents the position, rotation and scale data of the target bone t, W r Represents the position, rotation and scale data of the reference bone r, M r, It is the hierarchical data matrix of the reference bone relative to the target bone.

8. The fast motion distortion method based on real-time virtual environment obstacle analysis according to claim 1, characterized in that: The step S5 specifically includes: Based on the motion distortion trajectory of the target bone obtained in step S3 and the final landing point position obtained in step S4, the bone data pre-stored in step S2 is used, and the distortion algorithm configured in step S1 is adopted to perform motion distortion, and the motion path of the target bone during the motion distortion is calculated. The motion path includes the transformation information of the target bone in each frame during the motion distortion.

9. A fast motion distortion system based on real-time virtual environment obstacle analysis, used to implement the fast motion distortion method based on real-time virtual environment obstacle analysis according to any one of claims 1 to 8, characterized in that: include: Animation tool module, used to configure the motion distortion range, distortion process curve, reference bones, target bones and distortion algorithm used in the animation clip in the animation tool; A preprocessing calculation module, used for pre-storing hierarchical data of reference bones of each frame in the curve value according to the animation curve value in the original animation clip and the corresponding bones and motion distortion range configured by the animation tool module; The virtual environment analysis module is used to analyze the obstacle situation in the virtual environment where the character is located by using a continuous collision detection algorithm, including: whether there is an obstacle in front, whether there is an obstruction on the character's upward climbing path, and whether there is a legal foothold on the obstacle; and the continuous collision detection algorithm is modified according to the specific needs of the virtual character's crossing behavior, wherein the specific needs of the virtual character's crossing behavior specifically include: detecting whether the character will be blocked by obstacles in the current crossing path according to the movement direction and distance of the character's behavior, and judging whether the final foothold can meet the virtual character's standing needs according to the data in the collision detection result; A target position back-calculation module is used to calculate the position of the target bone by using a back-calculation method according to the target point position of the reference bone and the animation data of the end frame of the animation, so as to obtain the final landing point position of the motion distortion; and The motion distortion algorithm module is used to perform motion distortion according to the bone data pre-stored in the offline stage and the final landing point position calculated by the target position back-calculation module, and calculate the motion path of the target bone during the motion distortion process.

Citation Information

Patent Citations

  • Real-time action method and device for synchronously driving character animation and physical interaction

    CN116883560A

  • Thangka mural role skeleton movement method

    CN117252967A

  • Interference constraint system and method for driving digital human based on motion capture system

    CN117892492A

  • Method and apparatus for controlling virtual object, and storage medium and electronic apparatus

    WO2022021686A1