Fast motion distortion method and system based on real-time virtual environment obstacle analysis
Through real-time virtual environment obstacle analysis and continuous collision detection algorithms, the adaptation and computational consumption problems of motion distortion in complex 3D scenes are solved, the robustness and efficiency are improved, the adaptation range of animation resources is expanded, and the production line is optimized.
Patent Information
- Application Number
- CN202411076906.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-08-07
AI Technical Summary
Existing motion distortion technology is difficult to adapt to complex 3D scenes, has high computational consumption, is not flexible in configuration, has a small range of animation resource adaptation, and is inefficient in manual marking by scene designers. Simple collision detection has poor robustness and is prone to model penetration problems.
A fast motion warping method based on real-time virtual environment obstacle analysis is adopted. The animation clip parameters and skeleton data are configured in the offline stage. The continuous collision detection algorithm is used to analyze the obstacle situation in the real-time stage, and the collision detection algorithm is modified. The motion path is calculated by combining simple and adjusted hybrid warping algorithms.
It improves the robustness and computational efficiency of motion distortion, reduces the workload of scene designers, adapts to complex virtual environments, expands the adaptability of animation resources, and optimizes the production line.
Smart Images

Figure CN119068090B_ABST
Abstract
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 video game industry is booming in today's society, with virtual games becoming an integral part of people's entertainment lives and leading the digital entertainment industry. Computer character animation, a key component of 3D games, plays a crucial role in shaping game scenes and enriching storylines. However, as the scale and quality requirements of virtual games continue to increase, animators face the challenge of producing large quantities of animation assets. This not only consumes time and human resources, but also restricts the efficiency and cost control of game production. To effectively address this issue, motion warping technology has become a highly sought-after solution. This technology aims to improve the reusability of animation assets, helping animators save the time and cost of developing similar assets.
[0003] Currently, in the gaming industry, mainstream motion warping solutions consist of two parts: first, determining the target points for motion warping through analysis of the virtual scene. This is usually done manually by scene designers when creating scene resources, resulting in very low production efficiency. Second, there is the implementation of the motion warping algorithm. There are two mainstream algorithms for this: the simple warping algorithm and the adjustment blending warping algorithm. Each of these algorithms has its own advantages and disadvantages in terms of implementation difficulty and performance.
[0004] However, this technology faces challenges in adapting to complex 3D scenes and high runtime performance. While manual marking by scene designers can accurately determine target locations for complex 3D virtual scenes, this method is inefficient. Simple collision detection algorithms are less robust and prone to problems like clipping. For current mainstream mobile devices, the extensive skeletal-level computations required during motion warping are accompanied by significant computational overhead. Furthermore, traditional motion warping systems suffer from inflexible configuration and a limited range of animation resource adaptability. Summary of the Invention
[0005] The object of the present invention is to address the deficiencies of the prior art and to provide a fast motion distortion method and system based on real-time virtual environment obstacle analysis.
[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, configure 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, the hierarchical data of the reference bone in the curve value is stored;
[0009] In the real-time stage, a continuous collision detection algorithm is used to analyze the obstacle situation in the character's virtual environment, including: whether there are obstacles ahead, whether there are any obstructions on the character's upward climbing path, and whether there are legal footholds on the obstacles. The continuous collision detection algorithm is modified according to the specific requirements of the virtual character's crossing behavior. The specific requirements of the virtual character's crossing behavior include: detecting whether the character will be blocked by obstacles in the current crossing path based on the character's movement direction and distance, and judging whether the final foothold can meet the virtual character's standing requirements based on the data in the collision detection results.
[0010] S4, using an inverse calculation method, calculating the position of the target bone according to the target point position of the reference bone and the animation data of the end frame of the animation, and obtaining the final landing point position of the motion distortion;
[0011] S5. Perform motion warping based on 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 process.
[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 during 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 calculated at the 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, W n and W0 represent the values of the end frame and the start frame of the character in 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, r is the serial number of the reference bone, t is the serial number of the target bone, L i,k It is the bone hierarchy matrix of the bone with the 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 the M matrix of each frame of animation data within the final motion distortion range is 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 detections are sent in the direction of the character's movement to achieve continuous collision detection. If a collision detection result is found, there is an obstacle ahead, and the subsequent detection step is entered to determine whether the obstacle can be traversed by motion distortion. If no collision detection result is found, 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 intended movement. If a collision occurs, there is an obstruction on the movement trajectory and 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, motion distortion cannot be triggered. If there is no obstruction above the character, the forward and landing point detection of step S32 is performed again based on the end point of the upward detection. If the detection passes, the intermediate landing point is found. If the detection fails, the starting point of the upward detection is raised and multiple judgments are performed until the intermediate landing point is found. If a suitable intermediate 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, the platform performs forward detection to find the final landing point of the climb; the forward detection distance is determined by 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 in sequence into two line segments to obtain a preliminary motion trajectory; test whether there are any 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 midway, 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 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 process is calculated. The motion path includes the transformation information of the target bone in each frame during the motion distortion process.
[0033] A second aspect of an embodiment of the present invention provides a rapid motion distortion system based on real-time virtual environment obstacle analysis, which is used to implement the aforementioned rapid 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 bone, target bone and distortion algorithm used in the animation clip in the animation tool;
[0035] A pre-processing 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;
[0036] The virtual environment analysis module uses a continuous collision detection algorithm to analyze the obstacle situation in the character's virtual environment, specifically including: whether there are obstacles ahead, whether there are any obstructions on the character's upward climbing path, and whether there are legal footholds on the obstacles. The continuous collision detection algorithm is modified according to the specific requirements of the virtual character's crossing behavior. The specific requirements of the virtual character's crossing behavior include: detecting whether the character will be blocked by obstacles in the current crossing path based on the character's movement direction and distance, and judging whether the final foothold can meet the virtual character's standing requirements based on the data in the collision detection results.
[0037] A target position inverse calculation module is used to calculate the position of the target bone based on the target point position of the reference bone and the animation data of the end frame of the animation using an inverse calculation method to obtain the final landing point position of the motion distortion; and
[0038] The motion distortion algorithm module is used to perform motion distortion based on the skeleton 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 skeleton 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 point, the problem of the small adaptation range of the traditional motion distortion algorithm is expanded, and the computational efficiency of the algorithm is improved through the preprocessing method. 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 results of implementing the motion distortion algorithm of the present invention;
[0046] Figure 5 It is a structural schematic diagram of the 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, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numbers in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims. It should be understood that the foregoing general description and the detailed description that follows are exemplary and illustrative only and do not 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. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0049] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this 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 "comprises," "comprising," or any other variant thereof is intended to cover non-exclusive inclusion, so that the process or method comprising a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process or method. In the absence of further restrictions, the elements defined by the statement "comprising a..." do not exclude the presence of other identical elements in the process, method, article, or device comprising the elements.
[0050] The present invention will be described in detail below with reference to the accompanying drawings. Unless there is any conflict, the features of the following embodiments and implementations may be combined with each other.
[0051] The present invention analyzes obstacles in complex virtual environments based on a continuous collision detection algorithm, bringing higher robustness and faster 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 relevant parameters of the animation clip 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 2Configure the warping algorithm used in the Warp Mode section of the . The motion warp range and warp process curve configured offline will be used in step S5. They determine which parts of the original animation clip will be used for motion warping and the final appearance of the warp. The configured reference and target bones will be used in step S4. They determine which bones of the character should be aligned with the final position of the motion warp, ensuring that the character's interaction with the scene does not appear to be interlaced or suspended.
[0055] It should be understood that if Figure 2 The animation tools shown work by configuring the necessary parameters for motion warping and pre-stored character 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, Indicates the value of the calculated warp curve (i.e., Anim Warp Curve in the animation tool) at the 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, W n and W0 represent the values of the ending frame (i.e., the End value configured in the Ref Bone Infos in the animation tool) and the starting 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 Known after step S4.
[0063] S2. According to the animation curve value in the original animation clip (the 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, r is the serial number of the reference bone, t is the serial number of the target bone, L i,k It is the bone hierarchy matrix of the bone with the 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 the M matrix of each frame of animation data within the final motion distortion range is i,r,t All will be pre-stored.
[0067] In the real-time stage, a continuous collision detection algorithm is used to analyze obstacles in the character's virtual environment. Specifically, this includes: whether there are obstacles ahead, whether there are any obstructions on the character's upward climbing path, and whether there are legal footholds on the obstacles. The continuous collision detection algorithm is then adaptively modified based on the specific needs of the virtual character's crossing behavior. These needs include: detecting whether the character will be blocked by obstacles in the current crossing path based on the character's movement direction and distance to avoid clipping issues; and determining whether the final foothold meets the virtual character's standing requirements based on the data in the collision detection results (including point position, normal, etc.).
[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 forward movement to achieve continuous collision detection. If a collision detection result is found, it means 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 through movement. If no collision detection result is found, it means 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 movement trajectory and 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 serve 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, 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 intermediate landing point is found; if the detection fails, the starting point of the upward detection is raised, and multiple judgments are performed until the intermediate landing point is found. If a suitable intermediate landing point is still not found after multiple judgments, the detection ends.
[0073] It should be noted that the middle foothold will serve as the hand support point when climbing. The specific number of lifts can be set according to the maximum climbing height. The higher the climbing height, the more times you can lift, and vice versa.
[0074] S34. Platform forward movement and landing point detection: Starting from the upward detection result in step S33, the platform performs a forward detection to find the final landing point. The forward detection distance is determined by the offset of the segment in the animation. If there is an obstacle during the detection process, or the final landing point is missing or invalid, 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 in sequence into two line segments to obtain a preliminary motion trajectory; test whether there are any 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 midway, it means that the current preliminary motion trajectory is illegal and motion distortion cannot be triggered.
[0076] S4. Using the inverse calculation method, the position of the target bone is calculated according to the target point position of the reference bone and the animation data of the end frame of the animation 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 relative to the target bone pre-stored in step S2 can be quickly obtained from the pre-stored data. The above formula can quickly inversely calculate the target bone data through the reference bone data without the need for 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 location of the collision detection results. When all 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 based on 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 process.
[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 this path, which is convenient for modifying the motion path of the character's skeleton. In addition, thanks to the backcalculation method in 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, which is in line with expectations. And with the help of the skeleton data stored in step S2, the calculation efficiency of this 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 the animation designer.
[0090] In this embodiment, the pre-processing 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 are obstacles in front, whether there are any obstructions 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 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 to 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 inverse calculation module is used to calculate the position of the target bone using an inverse 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 based on the skeleton data pre-stored in the offline stage and the final landing point position calculated by the target position inverse calculation module, and calculate the motion path of the target skeleton 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 they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. 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 various 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, configure 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, the hierarchical data of the reference bone in the curve value is stored; In the real-time stage, a continuous collision detection algorithm is used to analyze the obstacle situation in the character's virtual environment, including: whether there are obstacles ahead, whether there are any obstructions on the character's upward climbing path, and whether there are legal footholds on the obstacles. The continuous collision detection algorithm is modified according to the specific requirements of the virtual character's crossing behavior. The specific requirements of the virtual character's crossing behavior include: detecting whether the character will be blocked by obstacles in the current crossing path based on the character's movement direction and distance, and judging whether the final foothold can meet the virtual character's standing requirements based on the data in the collision detection results. In step S3, the modification process of the continuous collision detection algorithm specifically includes: S31. Mobile Obstacle Detection: Multiple capsule detections are sent in the direction of the character's movement to achieve continuous collision detection. If a collision detection result is found, there is an obstacle ahead, and the subsequent detection step is entered to determine whether the obstacle can be traversed by motion distortion. If no collision detection result is found, 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 intended movement. If a collision occurs, there is an obstruction on the movement trajectory and 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, motion distortion cannot be triggered. If there is no obstruction above the character, the forward and landing point detection of step S32 is performed again based on the end point of the upward detection. If the detection passes, the intermediate landing point is found. If the detection fails, the starting point of the upward detection is raised and multiple judgments are performed until the intermediate landing point is found. If a suitable intermediate landing point is still not found after multiple judgments, the detection ends. S34, platform forward movement and landing point detection: Starting from the upward detection result of step S33, the platform moves forward to find the final landing point of the climb. The forward detection distance is determined by the platform offset from the starting position to the landing point 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 of step S34, the initial landing point, the intermediate landing point, and the final landing point are sequentially connected into two line segments to obtain a preliminary motion trajectory; the preliminary motion trajectory is tested to see if there are any obstacles. 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 aborted midway, the motion distortion cannot be triggered; S4, using an inverse calculation method, calculating the position of the target bone according to the target point position of the reference bone and the animation data of the end frame of the animation, and obtaining the final landing point position of the motion distortion; S5. Perform motion warping based on 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 process.
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: ; in, Indicates the value of the character at the i-th frame of motion distortion, 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 calculated at the 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: ; in, Indicates the value of the character at the i-th frame of motion distortion, and They represent the values of the original animation clip at the i-th frame and the j-th frame within the motion distortion range, and n represents the total number of frames of the animation within the motion distortion range. and The values represent the ending and starting frames of the character's motion distortion process.
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: ; in, Represents the hierarchical data matrix of the reference bone r relative to the target bone t in the i-th frame animation data, r is the serial number of the reference bone, t is the serial number of the target bone, It is the bone hierarchy matrix of the bone with the bone number k in the i-th frame animation data in the local space, where i=0,1,2,..,n represents the total number of n frames in the animation clip, k=r,r+1,...,t represents the bone numbers from the reference bone to the target bone in the hierarchy, and the final motion distortion range of each frame of animation data is 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: The position of the target bone is obtained according to the following formula: ; in, Represents the position, rotation and scale data of the target bone t, Represents the position, rotation and scale data of the reference bone r, It is the hierarchical data matrix of the reference bone relative to the target bone.
7. 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 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 process is calculated. The motion path includes the transformation information of the target bone in each frame during the motion distortion process.
8. 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 7, characterized in that: include: Animation tool module, used to configure the motion distortion range, distortion process curve, reference bone, target bone and distortion algorithm used in the animation clip in the animation tool; A pre-processing 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; The virtual environment analysis module uses a continuous collision detection algorithm to analyze the obstacle situation in the character's virtual environment, specifically including: whether there are obstacles ahead, whether there are any obstructions on the character's upward climbing path, and whether there are legal footholds on the obstacles. The continuous collision detection algorithm is modified according to the specific requirements of the virtual character's crossing behavior. The specific requirements of the virtual character's crossing behavior include: detecting whether the character will be blocked by obstacles in the current crossing path based on the character's movement direction and distance, and judging whether the final foothold can meet the virtual character's standing requirements based on the data in the collision detection results. A target position inverse calculation module is used to calculate the position of the target bone based on the target point position of the reference bone and the animation data of the end frame of the animation using an inverse calculation method to obtain the final landing point position of the motion distortion; and The motion distortion algorithm module is used to perform motion distortion based on the skeleton 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 skeleton 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