A method for visualizing 3D objects and UI animation events
By loading and initializing 3D objects and UI elements, creating initial keyframes and optimizing keyframe layout using intelligent track management algorithms, the time-consuming and error-prone problems in the existing technology are solved, and smoother and more natural animation effects are achieved, improving animation quality and efficiency.
Patent Information
- Application Number
- CN202411154284.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2044-08-21
AI Technical Summary
The existing technology requires a lot of manual keyframe setting in 3D animation and UI animation production, which leads to time-consuming and error-prone, lacks intelligent track management and optimization algorithms, and the animation effect is poor.
By loading and initializing 3D objects and UI elements, recording the initial state, creating initial keyframes, defining keyframe attributes, and using animation functions to smooth out incoherent points, and then optimizing the keyframe layout based on the intelligent track management algorithm to achieve multiple smoothing and visualization of animation.
It achieves smoother and natural animation effects, reduces incoherence points, improves animation quality and efficiency, and reduces the burden of manual operation.
Smart Images

Figure CN119027555B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer animation, and particularly to a method for visualizing 3D objects and UI animation events. Background Art
[0002] With the development of computer graphics and the improvement of computing power, 3D animations and rich user interface elements have become increasingly common in various applications. Current animation production techniques mainly include keyframe animation, curve editing, and physical simulation, etc. A large number of keyframes still need to be set manually, and the adjustment process is very time-consuming and error-prone. In the case of a large number of keyframes, there is a lack of intelligent track management and optimization algorithms, resulting in a poor overall animation effect.
[0003] Therefore, the present invention provides a method for visualizing 3D objects and UI animation events. Summary of the Invention
[0004] A method for visualizing 3D objects and UI animation events provided by the present invention loads and initializes 3D objects and UI elements, records the initial state, creates initial keyframes, defines keyframe attributes, and uses an animation function to smooth discontinuous points. Then, based on an intelligent track management algorithm, the keyframe layout is optimized, and finally, multiple smoothings and visualizations of the animation are achieved, realizing a smoother and more natural animation effect, effectively reducing discontinuous points, improving the overall quality of the animation, reducing the burden of manual operations, and improving efficiency by automatically loading and initializing 3D objects and UI elements.
[0005] The present invention provides a method for visualizing 3D objects and UI animation events, including:
[0006] Step 1: Load 3D objects and UI elements to be animated according to actual needs, initialize necessary parameters and vectors, and record the initial states of the 3D objects and UI elements;
[0007] Step 2: Create initial keyframes according to the initial state and the time axis, define the basic attributes of various keyframes, and determine the basic tracks according to the basic attributes of various keyframes;
[0008] Step 3: Analyze the attributes of the keyframes, determine the attribute change situation, determine the discontinuous points, set an animation function based on the discontinuous points, and perform the first smoothing on the keyframes according to the animation function;
[0009] Step 4: Determine the keyframe layout based on the intelligent track management algorithm, perform the second smoothing on the keyframes, and visualize the animation events corresponding to the 3D objects and UI elements by integrating the first smoothing and the second smoothing.
[0010] The present invention provides a method for visualizing 3D objects and UI animation events, which loads 3D objects and UI elements to be animated according to actual requirements, initializes necessary parameters and vectors, and records the initial states of the 3D objects and UI elements, including:
[0011] Select an animation engine of the animation system according to actual requirements;
[0012] Meanwhile, perform class responsibility division on the actual requirements to obtain a class division result, and determine the animation data attributes to be maintained by the corresponding class according to the class division result;
[0013] Determine all possible loaded 3D objects and UI elements according to the actual requirements to obtain a possible resource list, map each item in the possible resource list to the corresponding actual resource path to obtain a mapped path;
[0014] Load 3D objects and UI elements according to the mapped path, and initialize necessary parameters corresponding to each item in the possible resource list according to the animation data attributes, thereby obtaining the initial state of the corresponding item.
[0015] The present invention provides a method for visualizing 3D objects and UI animation events, which creates initial key frames according to the initial state and time axis, defines the basic attributes of various key frames, and determines basic tracks according to the basic attributes of various key frames, including:
[0016] Create an initial time axis for the animation, set the start time and end time to form the time range of the animation, and set the initial zoom level of the time axis according to user requirements and animation complexity;
[0017] Arrange initial key frames according to the time range, and determine the basic attributes of each item in the initial key frames based on the initial state of each item in the possible resource list;
[0018] Create corresponding initial tracks based on the basic attributes, and add the initial key frames to the corresponding initial tracks. Meanwhile, assign the attribute values corresponding to the basic attributes to the corresponding initial tracks, and combine the assignment results, addition results and initial zoom level to obtain basic tracks.
[0019] The present invention provides a method for visualizing 3D objects and UI animation events, which analyzes the attributes of the key frames, determines the attribute change situation, and determines the discontinuous points, sets an animation function based on the discontinuous points, and performs first smoothing on the key frames according to the animation function, including:
[0020] View each key frame and its corresponding attribute value, and analyze the change situation of the attribute values of each key frame;
[0021] Mark the changes in the attribute values of each key frame, perform segment analysis on the change marks, obtain the change analysis results, determine the large rhythm segments corresponding to the key frames according to the change analysis results, and subdivide to obtain small rhythm segments;
[0022] Determine the discontinuous points in the small rhythm segments, adjust the discontinuous points, and perform the first smoothing on the key frames.
[0023] The present invention provides a method for visualizing 3D objects and UI animation events. Mark the changes in the attribute values of each key frame, perform segment analysis on the change marks, obtain the change analysis results, determine the large rhythm segments corresponding to the key frames according to the change analysis results, and subdivide to obtain small rhythm segments, including:
[0024] Classify the changes in the attribute values, determine the preset fluctuation range corresponding to each change in the attribute values according to the classification results, and mark the key frames corresponding to the significant changes when each change in the attribute values exceeds the preset fluctuation range on the time axis. Divide the key frames on the entire time axis according to the significant changes to obtain large rhythm segments;
[0025] Subdivide the large rhythm segments according to the complexity of the animation changes and the transition requirements of the key actions within the large rhythm segments to obtain small rhythm segments.
[0026] The present invention provides a method for visualizing 3D objects and UI animation events. Determine the discontinuous points in the small rhythm segments, adjust the discontinuous points, and perform the first smoothing on the key frames, including:
[0027] Perform segment attribute analysis on each key frame within the small rhythm segment to determine the segment attribute change situation corresponding to the small rhythm segment, and determine the corresponding segment change rule according to the segment attribute change situation;
[0028] Mark the discontinuous points according to the segment change rule, construct an animation function, and adjust the discontinuous points;
[0029] If the segment change rule is acceleration, the corresponding acceleration animation function is: If the segment change rule is deceleration, the corresponding deceleration animation function is: If the segment change rule has both acceleration and deceleration, the corresponding acceleration-deceleration animation function is: ; where represents the acceleration animation function; represents the deceleration animation function; represents the acceleration-deceleration animation function; represents the initial amplitude adjustment factor; represents the attenuation rapid adjustment factor; represents the fluctuation frequency adjustment factor; represents the phase shift adjustment factor; A represents the amplitude of the animation fluctuation; C represents the transition rate between the acceleration and deceleration behaviors of the animation fluctuation; D represents the phase shift of the animation fluctuation; F represents the animation fluctuation frequency; P represents the time interval of the animation fluctuation; t represents the animation progress;
[0030] Perform the first smoothing on the key frames according to the acceleration animation function, deceleration animation function, and acceleration-deceleration animation function.
[0031] The present invention provides a method for visualizing 3D objects and UI animation events, which determines the key frame layout based on the intelligent track management algorithm and performs the second smoothing on the key frames, including:
[0032] Generate an initial key frame layout solution set on the time axis, where each initial key frame layout solution set contains a group of key frames, evaluate each initial key frame layout solution set using the fitness function, and select the initial key frame layout with a fitness higher than the preset fitness as the basic body;
[0033] Add random noise to each time stamp and attribute value of the basic body to obtain the mutant;
[0034] Generate a new layout solution set according to the basic body and the mutant, re-evaluate the fitness of the new layout solution set, and retain the evaluation results with a fitness higher than the preset fitness value to form a new generation of basic bodies;
[0035] Repeat the loop process of selection-mutation-retention multiple times to perform the second smoothing on the key frames;
[0036] Take reaching the preset number of loops as the first condition and the range of fitness improvement being less than the preset improvement value as the second condition. If it is found that either the first condition or the second condition is satisfied during the loop, then complete the second smoothing process and output the optimal key frame layout solution set.
[0037] The present invention provides a method for visualizing 3D objects and UI animation events, which visualizes the animation events corresponding to the 3D objects and UI elements by integrating the first smoothing and the second smoothing, including:
[0038] Extract the time stamps and attribute values of all key frames from the optimal key frame layout solution set;
[0039] Determine the smoothness requirement according to the first smoothing and the second smoothing, select the interpolation algorithm, generate the intermediate points between the key frames according to the interpolation algorithm, and sequentially connect the intermediate points and the key frames to draw the animation trajectory curve for the 3D objects and UI elements;
[0040] Traverse each key frame in the animation trajectory curve, update the attributes of the 3D objects and UI elements, render and update the scene frame by frame, and display the animation effect in real time.
[0041] Compared with the prior art, the beneficial effects of the present application are as follows: By loading and initializing 3D objects and UI elements, recording the initial state, creating initial keyframes, defining keyframe attributes, and using animation functions to smooth out the discontinuous points, and then optimizing the keyframe layout based on the intelligent track management algorithm, the animation is finally smoothed and visualized multiple times, achieving a smoother and more natural animation effect, effectively reducing discontinuous points, improving the overall quality of the animation, reducing the burden of manual operation, and improving efficiency by automatically loading and initializing 3D objects and UI elements.
[0042] Other features and advantages of the present invention will be described in the following specification, and some of them will become obvious from the specification or can be understood by implementing the present invention. The objectives and other advantages of the present invention can be achieved and obtained through the structures specifically pointed out in the written specification and the drawings.
[0043] The technical solutions of the present invention will be further described in detail below through the drawings and embodiments. Description of the Drawings
[0044] The drawings are used to provide a further understanding of the present invention, and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention, and do not constitute a limitation to the present invention. In the drawings:
[0045] Figure 1 is a schematic flowchart of a method for visualizing 3D object and UI animation events provided by an embodiment of the present invention. Detailed Embodiments
[0046] The following describes the preferred embodiments of the present invention with reference to the drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0047] Embodiment 1:
[0048] An embodiment of the present invention provides a method for visualizing 3D object and UI animation events, as Figure 1 shown, including:
[0049] Step 1: Load the 3D objects and UI elements to be animated according to actual needs, initialize the necessary parameters and vectors, and record the initial states of the 3D objects and UI elements;
[0050] Step 2: Create initial keyframes according to the initial state and the time axis, define the basic attributes of various keyframes, and determine the basic tracks according to the basic attributes of various keyframes;
[0051] Step 3: Analyze the attributes of the key frames, determine the attribute change situation, and determine the discontinuity points. Set the animation function based on the discontinuity points, and perform the first smoothing on the key frames according to the animation function.
[0052] Step 4: Determine the key frame layout based on the intelligent track management algorithm, perform the second smoothing on the key frames, and visualize the 3D objects and the animation events corresponding to the UI elements by integrating the first smoothing and the second smoothing.
[0053] In this embodiment, the necessary parameters are the parameters that need to be set when initializing the resources to ensure that the resources can be correctly loaded and displayed, including: model file path: the model file of the 3D object; material file path: the material and texture information; initial position, rotation, and scaling: the initial transformation state of the object or UI element; initial animation state: such as the start frame of the animation, the loop mode, etc.
[0054] In this embodiment, the initial state is the initial position, transformation, attributes, etc. of the resources after loading and initialization, which is used for the display of the starting frame of the animation, including: initial position: the initial coordinates of the resources in the 3D space at the start of the animation; initial rotation: the initial rotation angle or quaternion of the resources; initial scaling: the initial size ratio of the resources; initial transparency and color: the initial transparency and color when the UI element or object is rendered.
[0055] In this embodiment, the initial key frames refer to the original key frames set at the start of the animation, which are used to determine the initial state and subsequent changes of the animation, and contain the basic attribute values of the 3D objects and UI elements, such as position, rotation, scaling, etc.
[0056] In this embodiment, the process of determining the basic attributes is to load all resources from the possible resource list; obtain the initial position, rotation, scaling, and other attributes of each resource; and use these initial states as the basic attribute values.
[0057] In this embodiment, the process of obtaining the basic track is to create the time axis of the animation and set the start time and end time; select an appropriate initial scaling level of the time axis according to the animation complexity and user requirements to control the display density of the key frames on the time axis; arrange the initial key frames on the time axis and determine the basic attribute values of each key frame according to the initial state; create corresponding initial tracks for each basic attribute (such as position, rotation, scaling) of each 3D object and UI element; assign the attribute values of the initial key frames to the corresponding initial tracks; and combine the assignment results and the joining results to obtain the complete initial track layout and form the basic track.
[0058] In this embodiment, the changes in the attribute values of key frames include the following aspects: Position change: The change in the position of an object in 3D space, usually represented by (x, y, z) coordinates; Rotation change: The change in the rotation state of an object, usually represented by quaternions or Euler angles; Scaling change: The change in the size ratio of an object; Transparency change: The change in the transparency level of an object; Color change: The change in the color attribute of an object.
[0059] In this embodiment, a discontinuous point refers to an abnormal point in the animation trajectory caused by discontinuous or abrupt changes in attribute values, manifested as mutations or jumps during animation transitions, which will affect the coherence and smoothness of the animation.
[0060] In this embodiment, the first smoothing process is to analyze the key frames and attribute changes within a small rhythm segment, determine the segment attribute change rule, mark the discontinuous points and construct the corresponding animation function, and adjust and smooth the key frames.
[0061] In this embodiment, the second smoothing is to generate an initial key frame layout and evaluate the fitness, select the high-fitness layout as the basic body, perform random noise mutation and fitness re-evaluation, and repeatedly cycle through the selection-mutation-retaining process until the preset conditions are met to achieve the second smoothing of the key frames.
[0062] In this embodiment, the process of integrating the first smoothing and the second smoothing is to extract the timestamps and attribute values of the optimal key frame layout, select an interpolation algorithm according to the smoothness requirement to generate intermediate points, draw the animation trajectory curve, and update the attributes of the 3D object and UI elements.
[0063] The working principle and beneficial effects of the above technical solution are: By loading and initializing the 3D object and UI elements, recording the initial state, creating the initial key frames, defining the key frame attributes, and using the animation function to smooth the discontinuous points, and then optimizing the key frame layout based on the intelligent track management algorithm, finally achieving multiple smoothings and visualizations of the animation, realizing a smoother and more natural animation effect, effectively reducing the discontinuous points, improving the overall quality of the animation, reducing the burden of manual operation, and improving the efficiency by automatically loading and initializing the 3D object and UI elements.
[0064] Embodiment 2:
[0065] The embodiment of the present invention provides a method for visualizing 3D object and UI animation events, which loads the 3D objects and UI elements to be animated according to actual needs, initializes the necessary parameters and vectors, and records the initial states of the 3D objects and UI elements, including:
[0066] Select the animation engine of the animation system according to actual needs;
[0067] Meanwhile, classify the responsibilities of classes according to the actual requirements to obtain the class classification result, and determine the animation data attributes that the corresponding classes need to maintain according to the class classification result.
[0068] Determine all possible 3D objects and UI elements that can be loaded according to the actual requirements to obtain a possible resource list, map each item in the possible resource list to the corresponding actual resource path, and obtain the mapping path.
[0069] Load 3D objects and UI elements according to the mapping path, and initialize the necessary parameters corresponding to each item in the possible resource list according to the animation data attributes, thereby obtaining the initial state of the corresponding item.
[0070] In this embodiment, class responsibility classification modularizes the functions of the animation system and defines the responsibilities of each class to better manage and maintain animation data, including: animation management class, key frame management class, resource management class, rendering class, and physical simulation class: simulating physical effects and managing the calculation of mechanics and collisions.
[0071] In this embodiment, the animation engine is the core component responsible for animation planning, interpolation calculation, and rendering. Common animation engines include: Unity, Unreal Engine, Godot, etc.
[0072] In this embodiment, animation data attributes are the characteristics and parameters that each animation element needs to maintain, including: position: the coordinates of the object in 3D space; rotation: the rotation state of the object (usually represented by quaternions or Euler angles); scale: the size ratio of the object; transparency: the transparency level of the object; color: the color attribute of the object.
[0073] In this embodiment, the possible resource list is a summary list of all possible 3D objects and UI elements that can be loaded into the animation system for use, including: 3D model files: files for each 3D object, such as OBJ and FBX formats; texture images: image files for each texture, such as PNG and JPG formats; UI icons and elements: all pictures and graphic elements used for the user interface; audio files: any sound effect files related to the animation.
[0074] In this embodiment, the mapping path is the mapping relationship between each resource in the resource list and its actual storage path, which is used for path reference when loading resources, including: model path mapping: the mapping of the model file name to the storage path; material path mapping: the mapping of materials or textures to the storage path; UI element path mapping: the mapping of UI icons and graphic elements to the actual path.
[0075] The working principle and beneficial effects of the above technical solution are as follows: By selecting a suitable animation engine, performing class responsibility division, determining animation data attributes, mapping actual resource paths, and loading 3D objects and UI elements, and then initializing necessary parameters to obtain the initial state, the comprehensive management and optimization of the animation system are realized, improving the modularity and maintainability of the system. At the same time, the efficient loading and initialization of the animation system are ensured, enhancing the usability and resource management efficiency of the animation engine.
[0076] Embodiment 3:
[0077] The embodiment of the present invention provides a method for visualizing 3D object and UI animation events. Initial key frames are created according to the initial state and time axis, the basic attributes of various key frames are defined, and basic tracks are determined according to the basic attributes of various key frames, including:
[0078] Create the initial time axis of the animation, set the start time and end time to form the time range of the animation, and set the initial zoom level of the time axis according to user requirements and animation complexity;
[0079] Arrange the initial key frames according to the time range, and determine the basic attributes of each item in the initial key frames based on the initial state of each item in the possible resource list;
[0080] Create corresponding initial tracks based on the basic attributes, and add the initial key frames to the corresponding initial tracks. At the same time, assign the attribute values corresponding to the basic attributes to the corresponding initial tracks, and obtain the basic tracks by combining the assignment results, addition results and initial zoom level.
[0081] In this embodiment, the initial zoom level refers to the initial scale when zooming on the animation time axis, and this level can affect the visualization density of key frames. The zoom level depends on the complexity of the animation and user requirements. For example, a complex animation may require a higher zoom level for finer adjustment.
[0082] In this embodiment, the difference between the basic attributes and animation attributes is that the animation data attributes are various parameters used to define and control the animation effects, such as position, rotation, scaling, etc., the basic attributes are the initial values at the start of the animation, and the animation data attributes are variable attributes throughout the animation process.
[0083] In this embodiment, the initial track refers to the trajectory line created on the time axis for each attribute (for example, position, rotation, scaling), and each initial track corresponds to the change of one attribute of the 3D object or UI element.
[0084] In this embodiment, the allocation result refers to allocating each attribute value in the initial key frame to the corresponding track, specifically manifested as positioning the key frame and its attribute values on different tracks of the timeline; the addition result refers to adding the initial key frame to the corresponding initial track to ensure the correct allocation and storage of the attribute values of each key frame.
[0085] The working principle and beneficial effects of the above technical solution are as follows: By creating an animation timeline, setting the time range and initial zoom level, arranging the initial key frames, determining the basic attributes, and creating corresponding tracks based on these attributes, the key frames and attribute values are allocated to the tracks to form basic tracks, realizing the preliminary layout and management of the animation as a whole, ensuring the reasonable layout of the animation and the preliminary organization of the tracks, enhancing the controllability and adjustability of the animation, and laying a foundation for subsequent animation optimization and smoothing processing.
[0086] Embodiment 4:
[0087] The embodiment of the present invention provides a method for visualizing 3D objects and UI animation events, performing attribute analysis on the key frames, determining the attribute change situation, and determining the discontinuous points, setting an animation function based on the discontinuous points, and performing the first smoothing on the key frames according to the animation function, including:
[0088] View each key frame and its corresponding attribute value, and analyze the change situation of the attribute value of each key frame;
[0089] Mark the change of the attribute value of each key frame, perform segment analysis on the change marks, obtain the change analysis result, and determine the large rhythm segment of the corresponding key frame according to the change analysis result, and further subdivide to obtain the small rhythm segment;
[0090] Determine the discontinuous points in the small rhythm segment, adjust the discontinuous points, and perform the first smoothing on the key frames.
[0091] In this embodiment, the change mark is a mark used to identify the change characteristics of the key frame attribute value, including: increment mark: a mark for the increase of the attribute value (such as the increase of attribute values such as position, rotation, and scale); decrement mark: a mark for the decrease of the attribute value; static mark: a mark for no significant change in the attribute value; mutation mark: a mark for a drastic change in the attribute value in a short time.
[0092] In this embodiment, the change analysis result is the overall change trend and characteristics determined after analyzing the change situation and change marks of the attribute values of all key frames: change trend: for example, the position continuously rises or falls within a certain period of time; significant change points: for example, the attribute value changes of several key frames are significantly higher than other time periods; stable paragraph: an area where the attribute value changes less.
[0093] In this embodiment, the large rhythm segment is determined based on the change analysis result, including an animation change interval with a long time span, which reflects the main change trend and overall rhythm characteristics of the animation; the small rhythm segment is a subdivided area of the large rhythm segment, further divided according to the complexity of the animation change and the transition requirements of key actions, and can more precisely describe the animation change process.
[0094] The working principle and beneficial effects of the above technical solution are as follows: By viewing and analyzing each key frame and the change of its attribute values, change marking and segment analysis are carried out to establish the large rhythm segment and the small rhythm segment, find the incoherence points in the small rhythm segment and make adjustments, so as to realize the first smoothing process of the key frames, effectively identify and correct the incoherence points in the animation, improve the smoothness and naturalness of the animation transition, enhance the coherence and visual quality of the overall animation, and ensure the high-quality output of the animation.
[0095] Embodiment 5:
[0096] The embodiment of the present invention provides a method for visualizing 3D objects and UI animation events, which performs change marking on the change of the attribute values of each key frame, and performs segment analysis on the change marking to obtain a change analysis result, and determines the large rhythm segment corresponding to the key frame according to the change analysis result, and subdivides to obtain the small rhythm segment, including:
[0097] Classify the change situation of the attribute values, determine the preset fluctuation range corresponding to each change situation of the attribute values according to the classification result, and mark the key frames corresponding to the significant changes when each change situation of the attribute values exceeds the preset fluctuation range on the time axis, and divide the key frames on the entire time axis according to the significant changes to obtain the large rhythm segment;
[0098] Subdivide the large rhythm segment according to the complexity of the animation change and the transition requirements of key actions within the large rhythm segment to obtain the small rhythm segment.
[0099] In this embodiment, the classification result classifies the change situations of the attribute values into different types for further analysis and processing, including: steady change, linear change, periodic change, and mutation change.
[0100] In this embodiment, the preset fluctuation range is the allowable change amplitude range set after classifying each change situation of the attribute values, and the changes exceeding this range are marked as significant changes. For example, if the recognized change situation is a steady change in position change, the corresponding fluctuation range is ±1 unit, and if the recognized change situation is a steady change in rotation change, the corresponding rotation angle fluctuation range is set to ±5 degrees.
[0101] In this embodiment, the specific steps of segmenting the time period are to identify important animation change points or turning points within the large rhythm segment; add more key frames near the key actions to make the transition smoother; re-divide the time of the large rhythm segment so that each small rhythm segment can better reflect the details of the animation change; verify each small rhythm segment to ensure that the division is reasonable and can meet the smoothness requirements of the animation. If there are still significant changes or incoherence points in some small rhythm segments, further adjustments are made.
[0102] The working principle and beneficial effects of the above technical solution are as follows: By classifying the change situation of attribute values, determining the preset fluctuation range, marking the key frames with significant changes, dividing the large rhythm segments on the time axis, and further dividing them into small rhythm segments based on the complexity of the animation change and the key transition requirements, the detailed decomposition and management of the animation rhythm are realized, the control accuracy of the animation is improved, the natural transition of key actions is ensured, and the overall coherence and smoothness of the animation are enhanced.
[0103] Embodiment 6:
[0104] The embodiment of the present invention provides a method for visualizing 3D objects and UI animation events, determining the incoherence points in the small rhythm segments, adjusting the incoherence points, and performing first smoothing on the key frames, including:
[0105] Perform segment attribute analysis on each key frame in the small rhythm segment and determine the segment attribute change situation of the corresponding small rhythm segment, and determine the corresponding segment change rule according to the segment attribute change situation;
[0106] Mark the incoherence points according to the segment change rule, construct an animation function, and adjust the incoherence points;
[0107] If the segment change rule is acceleration, the corresponding acceleration animation function is: If the segment change rule is deceleration, the corresponding deceleration animation function is: If the segment change rule has both acceleration and deceleration, the corresponding acceleration-deceleration animation function is: ; where represents the acceleration animation function; represents the deceleration animation function; represents the acceleration-deceleration animation function; represents the initial amplitude adjustment factor; represents the attenuation fast adjustment factor; represents the fluctuation frequency adjustment factor; represents the phase shift adjustment factor; A represents the animation fluctuation amplitude; C represents the transition rate between the animation fluctuation acceleration and deceleration behaviors; D represents the phase shift of the animation fluctuation; F represents the animation fluctuation frequency; P represents the time interval of the animation fluctuation; t represents the animation progress;
[0108] Perform the first smoothing on the key frames according to the acceleration animation function, deceleration animation function, and acceleration-deceleration animation function.
[0109] In this embodiment, the segment attribute analysis is to analyze the attribute values of each key frame within a small rhythm segment to determine the overall change characteristics of the segment. The analysis content includes: position, rotation, scale change, change rate, and change mode.
[0110] In this embodiment, the segment attribute change situation is the result of the segment attribute analysis, which describes the specific situation of the change of the attribute values of each key frame within the small rhythm segment, including: trend: for example, gradually increasing, gradually decreasing, or fluctuating repeatedly; rate: the speed of change, such as accelerating, decelerating, or constant speed; nature: whether there are significant changes or mutation points.
[0111] In this embodiment, the segment change rule determines the overall rule of attribute change within the small rhythm segment according to the segment attribute change situation. Common segment change rules include: accelerating change: the change rate of the attribute value gradually increases within the segment; decelerating change: the change rate of the attribute value gradually decreases within the segment; periodic change: the attribute value changes according to a certain periodic rule, such as oscillatory motion; steady change: the change rate of the attribute value is constant, without obvious acceleration or deceleration.
[0112] In this embodiment, the step of marking discontinuous points is to identify the segment change rule: perform attribute analysis on each key frame within the small rhythm segment to determine the change rule of each attribute within the segment. For example, the position attribute shows an accelerating change rule within the segment; detect abnormal points: according to the identified segment change rule, detect whether there are points in the segment attribute change that are inconsistent with this rule. For example, in an accelerating change segment, if the change rate of the attribute value of a certain key frame suddenly drops, then this point is regarded as an abnormal or discontinuous point; calculate the threshold: set a reasonable threshold range to determine which changes can be regarded as normal changes within the segment and which belong to discontinuous changes. For example, set the allowable deviation range of the position change rate; mark discontinuous points: mark the key frames that exceed the threshold range on the time axis, that is, the change of the attribute values of these key frames is inconsistent with the segment change rule.
[0113] In this embodiment, assume that there is a small rhythm segment with the key frame attribute being position, and its segment change rule is accelerating. The specific steps are as follows: Segment attribute analysis: Calculate the position change rate between each key frame to determine that the overall segment change speed shows an accelerating trend (e.g., the speed difference between each frame is getting larger); Segment attribute change situation: The position change rate gradually increases, conforming to the accelerating rule; Segment change rule: The segment has an accelerating change rule; Mark discontinuous points: Check the speed change of each key frame and set an allowable rate increase range, for example, a deviation of ≤10%. If the rate change amount of a certain frame exceeds this range, it is marked as a discontinuous point. For example, assume that the rate from key frame 1 to 2 is 10, the rate from key frame 2 to 3 is 12, and the rate from key frame 3 to 4 is 15, which conforms to the accelerating change rule. If the rate from key frame 4 to 5 suddenly drops to 8, then this point is a discontinuous point.
[0114] The working principle and beneficial effects of the above technical solution are as follows: By analyzing the key frames and attribute change situations within the small rhythm segment, determining the segment attribute change rule, marking discontinuous points, and constructing corresponding animation functions, the key frames are adjusted and smoothed to achieve natural transitions of the animation, improving the naturalness and smoothness of the animation transitions.
[0115] Embodiment 7:
[0116] The embodiment of the present invention provides a method for visualizing 3D objects and UI animation events, which determines the key frame layout based on an intelligent track management algorithm and performs second smoothing on the key frames, including:
[0117] Generate an initial key frame layout solution set on the timeline, where each initial key frame layout solution set contains a group of key frames, evaluate each initial key frame layout solution set using a fitness function, and select the initial key frame layout with a fitness higher than the preset fitness as the basic body;
[0118] Add random noise to each timestamp and attribute value of the basic body to obtain a mutant;
[0119] Generate a new layout solution set based on the basic body and the mutant, re-evaluate the fitness of the new layout solution set, and retain the evaluation results with a fitness higher than the preset fitness value to form a new generation of basic bodies;
[0120] Repeat the loop process of selection - mutation - retention multiple times to perform second smoothing on the key frames;
[0121] Taking reaching the preset number of loops as the first condition and the improvement range of fitness being less than the preset improvement value as the second condition, if it is found that either the first condition or the second condition is met during the loop, then complete the second smoothing process and output the optimal key frame layout solution set.
[0122] In this embodiment, the specific steps for the fitness function to evaluate the initial key frame layout solution set are to define the fitness criteria, and for each initial key frame layout solution set, calculate a total fitness score according to smoothness, coherence, naturalness, and complexity.
[0123] In this embodiment, the preset improvement value is to set the improvement amplitude of the fitness score. The setting process is as follows: calculate the average fitness of the initial key frame layout solution set as the baseline; set the absolute value or percentage of fitness improvement. For example, the fitness needs to be improved by at least 2% in each round; adjust the improvement value according to the actual effect to ensure effective convergence during the optimization process.
[0124] In this embodiment, the specific steps corresponding to the selection - mutation - retention loop process are to select basic bodies from the initial key frame layout solution sets with fitness higher than the preset value; introduce random noise to the key frame attribute values of each basic body to generate mutant bodies; combine the basic bodies and mutant bodies to generate a new key frame layout solution set; use the fitness function to re - evaluate the new layout solution set and calculate the fitness score; select the solution sets with fitness higher than the preset value from the new layout solution set as the basic bodies of the new generation; repeat the selection - mutation - retention loop until the exit condition is met.
[0125] In this embodiment, the preset number of loops is usually the maximum number of loops set to prevent infinite loops. The specific setting process can be to set a reasonable range of loop times, such as 100 times, according to previous experiments and experience; and set an acceptable maximum number of loops according to system performance and time.
[0126] The working principle and beneficial effects of the above - mentioned technical solution are as follows: by generating the initial key frame layout and evaluating the fitness, selecting the high - fitness layout as the basic body, performing random noise mutation and re - evaluating the fitness, and repeating the selection - mutation - retention process multiple times until the preset conditions are met, the second - level smoothing of key frames is achieved, ensuring efficient and smooth processing, and finally outputting the optimal animation layout to ensure smooth animation transitions and good visual effects.
[0127] Embodiment 8:
[0128] The embodiment of the present invention provides a method for visualizing 3D objects and UI animation events, which comprehensively performs the first - level smoothing and the second - level smoothing on the animation events corresponding to 3D objects and UI elements for visualization, including:
[0129] Extract the timestamps and attribute values of all key frames from the optimal key frame layout solution set;
[0130] Determine the smoothness requirement based on the first smoothing and the second smoothing, and select an interpolation algorithm. Generate intermediate points between key frames according to the interpolation algorithm, and sequentially connect the intermediate points and key frames to draw an animation trajectory curve for the 3D object and UI elements;
[0131] Traverse each key frame in the animation trajectory curve, update the attributes of the 3D object and UI elements, render and update the scene frame by frame, and display the animation effect in real time.
[0132] In this embodiment, determining the smoothness requirement needs to refer to the smoothing results and user requirements in the first smoothing and the second smoothing. The corresponding steps are to average the smoothing parameters (such as the maximum allowable gradient of attribute change, change rate, etc.) achieved by the first smoothing and the second smoothing to obtain the overall smoothness parameter; adjust the smoothness parameter according to the user's visual effect requirements. For example, if the user hopes the animation to be more fluent, more strict smoothness parameters may be required; during the actual testing process, dynamically adjust the smoothness parameter to find the best balance point to make the animation both coherent and have a sufficient response rate.
[0133] In this embodiment, the process of generating intermediate points mainly involves selecting an interpolation algorithm, and then calculating the intermediate points between key frames according to the interpolation algorithm, , where b3 represents the position value of the intermediate point, a represents the interpolation ratio, and b1 and b2 represent the left key frame and the right key frame respectively.
[0134] In this embodiment, the animation trajectory curve refers to a continuous and coherent curve formed by a 3D object or UI element on the time axis during the animation process. The trajectory curve is connected by all key frames and intermediate points. Key frames: The main nodes of the animation, which define the attribute values (such as position, rotation, scaling) of the 3D object or UI element at specific time points; Intermediate points: Points generated by the interpolation algorithm, filled between key frames to make the animation transition smoother; Trajectory curve: By sequentially connecting key frames and intermediate points, a continuous motion trajectory of the object in space will be formed.
[0135] In this embodiment, the process of updating attributes is to update the attributes of the 3D object or UI element frame by frame according to the generated animation trajectory curve. The steps are to load the 3D object and UI elements and set the initial state; traverse each point on the trajectory curve frame by frame, including key frames and intermediate points generated by interpolation calculation; update the attribute values of the 3D object and UI elements according to the current point on the trajectory curve. For example: Position: Update the (x, y, z) coordinates of the object; Render the updated scene to the screen to make the changes visible in real time; Loop to read the next key point on the trajectory curve and repeat the update process until all key frames and intermediate points are traversed.
[0136] The working principle and beneficial effects of the above technical solution are as follows: By extracting the timestamps and attribute values of the optimal keyframe layout, selecting an interpolation algorithm according to the smoothness requirement to generate intermediate points, drawing an animation trajectory curve, updating the attributes of 3D objects and UI elements, rendering and updating the scene frame by frame, and displaying the animation effect in real time, it ensures the accurate drawing and natural transition of the animation trajectory, and improves the coherence and visual effect of the 3D object and UI element animations.
[0137] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for visualizing 3D objects and UI animation events, characterized in that, Including: Step 1: Load the 3D objects and UI elements to be animated according to actual requirements, initialize the necessary parameters and vectors, and record the initial states of the 3D objects and UI elements; Step 2: Create initial keyframes based on the initial states and the timeline, define the basic attributes of various keyframes, and determine the basic tracks according to the basic attributes of various keyframes; Step 3: Analyze the attributes of the keyframes, determine the attribute change situations, and determine the incoherence points. Set the animation functions based on the incoherence points, and perform the first smoothing on the keyframes according to the animation functions; Step 4: Determine the keyframe layout based on the intelligent track management algorithm, perform the second smoothing on the keyframes, and visualize the animation events corresponding to the 3D objects and UI elements by integrating the first smoothing and the second smoothing; Among them, Step 3 includes: View each keyframe and its corresponding attribute values, and analyze the change situations of the attribute values of each keyframe; Mark the changes in the attribute values of each keyframe, perform segment analysis on the change marks, obtain the change analysis results, and determine the large rhythm segments of the corresponding keyframes according to the change analysis results, and further subdivide them into small rhythm segments; Determine the incoherence points in the small rhythm segments, adjust the incoherence points, and perform the first smoothing on the keyframes; Among them, determining the incoherence points in the small rhythm segments, adjusting the incoherence points, and performing the first smoothing on the keyframes includes: Perform segment attribute analysis on the small rhythm segments based on each keyframe within the small rhythm segments, determine the segment attribute change situations of the corresponding small rhythm segments, and determine the corresponding segment change rules according to the segment attribute change situations; Mark the incoherence points according to the segment change rules, construct the animation functions, and adjust the incoherence points; If the segment change pattern is acceleration, the corresponding acceleration animation function is: If the segment change pattern is deceleration, the corresponding deceleration animation function is: If the segment change pattern has both acceleration and deceleration, the corresponding acceleration-deceleration animation function is: Among them, represents the acceleration animation function; represents the deceleration animation function; represents the acceleration-deceleration animation function; represents the initial amplitude adjustment factor; represents the attenuation fast adjustment factor; represents the fluctuation frequency adjustment factor; represents the phase shift adjustment factor; A represents the animation fluctuation amplitude; C represents the transition rate between the acceleration and deceleration behaviors of the animation fluctuation; D represents the phase shift of the animation fluctuation; F represents the animation fluctuation frequency; P represents the time interval of the animation fluctuation; t represents the animation progress; Perform the first smoothing on the keyframes according to the acceleration animation function, deceleration animation function, and acceleration-deceleration animation function; Among them, Step 4 includes: Generate an initial keyframe layout solution set on the timeline, where each initial keyframe layout solution set contains a group of keyframes. Evaluate each initial keyframe layout solution set using the fitness function, and select the initial keyframe layout with a fitness higher than the preset fitness as the basic body; Add random noise to each timestamp and attribute value of the basic body to obtain mutants; Generate a new layout solution set according to the basic body and the mutants, re-evaluate the fitness of the new layout solution set, and retain the evaluation results with a fitness higher than the preset fitness value to form a new generation of basic bodies; Repeat the loop process of selection-mutation-retention multiple times to perform the second smoothing on the keyframes; Taking reaching the preset number of loops as the first condition and the improvement range of the fitness being less than the preset improvement value as the second condition. If it is found that either the first condition or the second condition is satisfied during the loop, then complete the second smoothing process and output the optimal keyframe layout solution set.
2. The visualization method for implementing 3D objects and UI animation events according to claim 1, characterized in that Loading the 3D objects and UI elements to be animated according to actual requirements, initializing the necessary parameters and vectors, and recording the initial states of the 3D objects and UI elements includes: Select the animation engine of the animation system according to actual requirements; At the same time, perform class responsibility division on the actual requirements to obtain the class division results, and determine the animation data attributes that the corresponding classes need to maintain according to the class division results; Determine all possible 3D objects and UI elements according to the actual requirements, obtain a possible resource list, map each item in the possible resource list to the corresponding actual resource path, and obtain the mapped path; Load 3D objects and UI elements according to the mapped path, and initialize the necessary parameters corresponding to each item in the possible resource list according to the animation data attributes, so as to obtain the initial state of the corresponding item.
3. A method for visualizing 3D objects and UI animation events according to claim 2, characterized in that Create initial keyframes according to the initial state and the timeline, define the basic attributes of various keyframes, and determine the basic tracks according to the basic attributes of various keyframes, including: Create an initial timeline for the animation, set the start time and end time to form the time range of the animation, and set the initial zoom level of the timeline according to the user requirements and the animation complexity; Arrange the initial keyframes according to the time range, and determine the basic attributes of each item in the initial keyframes based on the initial state of each item in the possible resource list; Create the corresponding initial tracks based on the basic attributes, and add the initial keyframes to the corresponding initial tracks. At the same time, assign the attribute values corresponding to the basic attributes to the corresponding initial tracks, and combine the assignment results, addition results and the initial zoom level to obtain the basic tracks.
4. A method for visualizing 3D objects and UI animation events according to claim 1, characterized in that, Mark the changes in the attribute values of each keyframe, and perform segment analysis on the change marks to obtain the change analysis results. Determine the large rhythm segments corresponding to the corresponding keyframes according to the change analysis results, and subdivide them to obtain small rhythm segments, including: Classify the changes in the attribute values, determine the preset fluctuation range corresponding to each change in the attribute value according to the classification results, and mark the keyframes corresponding to the significant changes when each change in the attribute value exceeds the preset fluctuation range on the timeline. Divide the keyframes on the entire timeline according to the significant changes to obtain the large rhythm segments; Subdivide the large rhythm segments according to the complexity of the animation changes and the transition requirements of the key actions within the large rhythm segments to obtain small rhythm segments.
5. A method for visualizing 3D objects and UI animation events according to claim 1, characterized in that Visualize the animation events corresponding to 3D objects and UI elements by integrating the first smoothing and the second smoothing, including: Extract the timestamps and attribute values of all keyframes from the optimal keyframe layout solution set; Determine the smoothness requirements according to the first smoothing and the second smoothing, and select an interpolation algorithm. Generate the intermediate points between keyframes according to the interpolation algorithm, and sequentially connect the intermediate points and keyframes to draw the animation trajectory curves for 3D objects and UI elements; Traverse each keyframe in the animation trajectory curve, update the attributes of 3D objects and UI elements, render and update the scene frame by frame, and display the animation effect in real time.
Citation Information
Patent Citations
Controllable fluid animation generation method based on fluid keyframe editing
CN103489209A
Three-dimensional game animation system
CN104077797A