Group animation position determination method and device, storage medium, and electronic device
Patent Information
- Application Number
- CN202311001360.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-08
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-08-08
AI Technical Summary
[0006]本公开的目的在于提供一种群组动画的位置确定方法、群组动画的位置确定装置、计算机可读存储介质及电子设备,进而至少在一定程度上克服由于相关技术导致的群组动画制作的复杂度高、效率低的问题
[0012]由上述技术方案可知,本发明示例性实施例中的群组动画的位置确定方法、群组动画的位置确定装置、计算机存储介质及电子设备至少具备以下优点和积极效果:
Smart Images

Figure CN117018607B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of group animation technology, and in particular to a method and apparatus for determining the position of group animation, a computer-readable storage medium, and an electronic device. Background Technology
[0002] In animated films, TV series, and many single-player games with high development costs, long development cycles, and high resource consumption, it is often necessary to create a large number of group animations.
[0003] Rendering group animations is usually quite complex, requiring not only a high level of expertise from the production staff but also a lengthy production process. This not only increases the complexity of group animation production but also reduces its efficiency.
[0004] Therefore, there is an urgent need in this field to develop a new method and apparatus for determining the position of group animations.
[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0006] The purpose of this disclosure is to provide a method, device, computer-readable storage medium, and electronic device for determining the position of group animation, thereby overcoming, to at least some extent, the problems of high complexity and low efficiency in group animation production caused by related technologies.
[0007] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.
[0008] According to a first aspect of the present invention, a method for determining the position of a group animation is provided. The method includes: acquiring a group motion curve corresponding to the group animation; acquiring formation data corresponding to the group motion curve; the formation data corresponding to different curve distances on the group motion curve; determining a sampling distance of the group motion curve based on a preset sampling distance interval and the different curve distances; determining a target curve distance corresponding to the sampling distance among the different curve distances; and determining the position of the group element in the group animation based on the target formation data corresponding to the target curve distance.
[0009] According to a second aspect of the present invention, the apparatus includes: an acquisition module configured to acquire a group motion curve corresponding to the group animation, and acquire formation data corresponding to the group motion curve; the formation data corresponds to different curve distances on the group motion curve; a sampling module configured to determine a sampling distance of the group motion curve based on a preset sampling distance interval and the different curve distances; and a position module configured to determine a target curve distance corresponding to the sampling distance among the different curve distances, and determine the position of the group element in the group animation based on the target formation data corresponding to the target curve distance.
[0010] According to a third aspect of the present invention, an electronic device is provided, comprising: a processor and a memory; wherein the memory stores computer-readable instructions, which, when executed by the processor, implement the group animation position determination method of any of the above exemplary embodiments.
[0011] According to a fourth aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the group animation position determination method in any of the above exemplary embodiments.
[0012] As can be seen from the above technical solutions, the group animation position determination method, group animation position determination device, computer storage medium, and electronic device in the exemplary embodiments of the present invention have at least the following advantages and positive effects: In the method and apparatus provided in the exemplary embodiments of this disclosure, the sampling distance of the group animation curve is determined according to a preset sampling distance interval and different curve distances. Among the different curve distances, the target curve distance corresponding to the sampling distance is determined. Based on the target array data corresponding to the target curve distance, the position of the group element in the group animation can be determined. On the one hand, this reduces the professional requirements of the production personnel and reduces the complexity of determining the position of the group animation. On the other hand, after determining the target curve distance corresponding to the sampling distance, the position of the group element in the group animation can be determined based on the target array data corresponding to the target curve distance, thus improving the efficiency of determining the position of the group element in the group animation.
[0013] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0014] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0015] Figure 1 The schematic diagram illustrates a flowchart of a method for determining the position of group animation in an embodiment of this disclosure; Figure 2 A schematic diagram of group motion curves in an embodiment of this disclosure is shown. Figure 3 This schematic diagram illustrates a partial group of motion curves showing control points in an embodiment of the present disclosure. Figure 4 A schematic diagram of the first displacement vector in an embodiment of this disclosure is shown. Figure 5 This schematically illustrates a group motion curve displaying breakpoint markers in an embodiment of the present disclosure; Figure 6 The illustration schematically shows an apparatus for a method of determining the position of a group animation according to an embodiment of the present disclosure; Figure 7 An electronic device for determining the position of a group animation is schematically shown in an embodiment of the present disclosure; Figure 8 A computer-readable storage medium is schematically shown as an embodiment of the present disclosure of a method for determining the position of a group animation. Detailed Implementation
[0016] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0017] The terms “a,” “an,” “the,” and “the” are used in this specification to indicate the presence of one or more elements / components / etc.; the terms “including” and “having” are used to indicate an open-ended inclusion and to mean that there may be other elements / components / etc. in addition to the listed elements / components / etc.; the terms “first” and “second” are used only as markings and are not a limitation on the number of objects.
[0018] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities.
[0019] In view of the problems existing in related technologies, this disclosure proposes a method for determining the position of group animation. Figure 1 A flowchart illustrating the method for determining the position of group animation is shown, such as... Figure 1 As shown, the method for determining the position of group animation includes at least the following steps: Step S110. Obtain the group motion curve corresponding to the group animation, and obtain the formation data corresponding to the group motion curve; the formation data corresponds to the distance between different curves on the group motion curve.
[0020] Step S120. Determine the sampling distance of the group motion curve based on the preset sampling distance interval and different curve distances.
[0021] Step S130. Among different curve distances, determine the target curve distance corresponding to the sampling distance, and determine the position of the group elements in the group animation based on the target array data corresponding to the target curve distance.
[0022] In the method and apparatus provided in the exemplary embodiments of this disclosure, the sampling distance of the group animation curve is determined according to a preset sampling distance interval and different curve distances. Among the different curve distances, the target curve distance corresponding to the sampling distance is determined. Based on the target array data corresponding to the target curve distance, the position of the group element in the group animation can be determined. On the one hand, this reduces the professional requirements of the production personnel and reduces the complexity of determining the position of the group animation. On the other hand, after determining the target curve distance corresponding to the sampling distance, the position of the group element in the group animation can be determined based on the target array data corresponding to the target curve distance, thus improving the efficiency of determining the position of the group element in the group animation.
[0023] The following section details each step of the method for determining the position of group animations.
[0024] In step S110, the group motion curve corresponding to the group animation is obtained, and the formation data corresponding to the group motion curve is obtained; the formation data corresponds to the different curve distances on the group motion curve.
[0025] In the exemplary embodiments of this disclosure, the actions and interactions of multiple group elements are presented simultaneously in the group animation. The group elements may specifically be game characters in the group animation, vehicles (e.g., cars), buildings, robots, animals, or any other element that needs to be displayed in the group animation; this exemplary embodiment does not impose any special limitations on this.
[0026] A group motion curve refers to a curve that represents the movement direction of a group of elements. Formation data describes the position of the group animation, and each formation data point corresponds to a curve distance. For example, if the total length of the group motion curve is 100, the creator can input three formation data points: the first corresponds to a curve distance of 20, the second to 55, and the third to 76. It's worth noting that curve distance refers to the distance from a point on the group motion curve to the starting point of the group motion curve.
[0027] In an optional embodiment, the group motion curve includes curve breakpoints; the method for obtaining formation data corresponding to the group motion curve includes: obtaining formation data corresponding to different curve distances on the group motion curve; determining breakpoint formation data corresponding to the curve breakpoints in the formation data, and determining a first tangent direction matrix and a second tangent direction matrix corresponding to the curve breakpoints; determining target breakpoint formation data corresponding to the distances of the curve breakpoints on the group motion curve based on the breakpoint formation data, the first tangent direction matrix, and the second tangent direction matrix; the distances of the curve breakpoints correspond to the curve breakpoints; and replacing the breakpoint formation data in the formation data with the target breakpoint formation data to obtain the replaced formation data.
[0028] Among them, the group motion curve may turn at certain locations. For example, if the group motion curve turns at a curve distance of 3863 to a curve distance of 3870, then the curve point at a curve distance of 3863 and the curve point at a curve distance of 3870 are curve breakpoints.
[0029] The formation data may include breakpoint formation data corresponding to curve breakpoints (for example, there may be breakpoint formation data corresponding to a curve distance of 3863). However, since this formation data was entered under the condition that the default group motion curve has not changed direction, the breakpoint formation data needs to be recalculated to improve the accuracy of the formation data.
[0030] The first tangent direction matrix is the movement matrix generated at the curve break point along the direction before the turn, and the second tangent direction matrix is the movement matrix generated at the curve break point along the direction after the turn. Figure 2 A schematic diagram of group motion curves in an embodiment of this disclosure is shown, such as... Figure 2 As shown, curve 210 is a group motion curve. The group motion curve turns at a curve distance of 3863 and becomes flat again at a curve distance of 3870. The first tangent direction matrix can be the movement matrix generated along arrow 220, and the second tangent direction matrix can be the movement matrix generated along arrow 230.
[0031] By calculating the breakpoint array data, the first tangent direction matrix, and the second tangent direction matrix, the target breakpoint array data at the actual breakpoint of the group motion curve can be determined. Then, the original breakpoint array data in the array data can be replaced with the target breakpoint array data, thus realizing the correction of the array data.
[0032] In an optional embodiment, the curve breakpoint includes a curve start breakpoint and a curve end breakpoint corresponding to the curve start breakpoint; before determining the breakpoint array data corresponding to the curve breakpoint in the array data, the method further includes: obtaining the breakpoint marker corresponding to the group motion curve; the breakpoint marker records the distance between the curve breakpoint and the start point of the group motion curve; Determine the curve length of the group motion curve. If there is a target curve termination breakpoint marker that is greater than the curve length, then correct the target curve termination breakpoint marker to the curve length. If there is a curve start breakpoint marker that is greater than the curve end breakpoint marker, then delete the curve start breakpoint marker and the curve end breakpoint marker from the breakpoint marker.
[0033] The curve start breakpoint represents the position where the group of motion curves begins to turn, and the curve end breakpoint represents the position where the group of motion curves ends to turn. It is worth noting that the curve start breakpoint and the curve end breakpoint exist in pairs and correspond to each other. The breakpoint marker is used to record the distance between the curve breakpoint and the starting point of the group of motion curves.
[0034] The curve length is the total length of the group of motion curves. If there is a curve termination breakpoint mark that is greater than the curve length, it proves that the distance represented by the curve termination breakpoint mark has exceeded the total length of the group of motion curves. Therefore, the curve termination breakpoint mark is corrected to the curve length to ensure that the curve termination breakpoint mark does not exceed the total length of the group of motion curves.
[0035] In addition, the starting breakpoint marker of a curve must be smaller than the ending breakpoint marker. If the starting breakpoint marker is larger than the ending breakpoint marker, then both the starting and ending breakpoint markers are illogical and should be removed from the breakpoint markers to improve the accuracy of the breakpoint markers.
[0036] In an optional embodiment, the method further includes: comparing breakpoint markers pairwise to identify overlapping breakpoint markers; deleting overlapping breakpoint markers from the breakpoint markers; or merging overlapping breakpoint markers into a target breakpoint marker to update the breakpoint markers.
[0037] The breakpoint markers record the distance between the curve breakpoint and the starting point of the group motion curve. Since curve breakpoints include both the curve start breakpoint and the curve end breakpoint, the breakpoint markers record both the curve start breakpoint marker and the curve end breakpoint marker. For example, the breakpoint markers record three pairs of breakpoint markers: 2931, 2940; 2930, 2934; 3371, 3379; 3370, 3380. The first number in each pair of breakpoint markers represents the distance between the curve start breakpoint and the starting point of the group motion curve, and the second number in each pair of breakpoint markers represents the distance between the curve end breakpoint and the starting point of the group motion curve.
[0038] By comparing breakpoint markers pairwise, overlapping breakpoint markers can be identified. For example, there is overlap between breakpoint markers 2931, 2940 and breakpoint markers 2930, 2934. Therefore, breakpoint markers 2931, 2940 and 2930, 2934 are considered overlapping breakpoint markers. Since breakpoint markers 2931, 2940 and 2930, 2934 partially overlap, they can be merged to update the overlapping breakpoint markers 2931, 2940 and 2930, 2934 to breakpoint markers 2930, 2940.
[0039] There is overlap between breakpoint markers 3371, 3379 and breakpoint markers 3370, 3380. Therefore, the overlapping breakpoint markers are 3371, 3379 and 3370, 3380. Since breakpoint markers 3371, 3379 and 3370, 3380 are completely overlapping, breakpoint markers 3371, 3379 can be deleted to update the overlapping breakpoint markers 3371, 3379 and 3370, 3380 to breakpoint markers 3370, 3380. By deleting or merging overlapping breakpoint markers, overlapping curve breakpoints can be removed from the breakpoint markers, thus improving the accuracy of the breakpoint markers.
[0040] In an optional embodiment, the curve breakpoint includes a curve start breakpoint and a curve end breakpoint corresponding to the curve start breakpoint; determining the breakpoint formation data corresponding to the curve breakpoint in the formation data includes: if the formation data includes breakpoint start formation data corresponding to the curve start breakpoint, then the breakpoint start formation data is determined as breakpoint formation data; if the formation data includes breakpoint end formation data corresponding to the curve end breakpoint, then the breakpoint end formation data is determined as breakpoint formation data; if the formation data does not include breakpoint start formation data and does not include breakpoint end formation data, then the target formation data corresponding to the target distance value that has a distance adjacency relationship with the curve start breakpoint is determined as breakpoint formation data.
[0041] The formation data may include only the breakpoint start formation data (i.e., the location data describing the start of the curve breakpoint), or only the breakpoint end formation data (i.e., the location data describing the end of the curve breakpoint), or it may include neither breakpoint start formation data nor breakpoint end formation data.
[0042] For the three situations mentioned above, when there is breakpoint starting formation data in the formation data, the breakpoint starting formation data is directly determined as the breakpoint formation data. Similarly, when there is breakpoint ending formation data in the formation data, the breakpoint ending formation data is directly determined as the breakpoint formation data.
[0043] If the formation data does not include either the breakpoint start formation data or the breakpoint end formation data, then the formation data corresponding to the target distance value closest to the breakpoint of the curve among different curve distances is determined as the breakpoint formation data. For example, if the breakpoint of the curve is 2771, and the curve distances corresponding to the formation data include 2770, 2774, and 2806, then the breakpoint formation data is the formation data corresponding to the curve distance of 2770.
[0044] In this exemplary embodiment, when the array data does not include breakpoint start array data or breakpoint end array data, the target distance value that has a distance adjacency relationship with the curve start breakpoint is determined as the breakpoint array data, thus improving the logic for determining the breakpoint array data.
[0045] In an optional embodiment, determining the target breakpoint pattern data corresponding to the distance of the curve breakpoint on the group motion curve based on the breakpoint pattern data, the first tangent direction matrix, and the second tangent direction matrix includes: determining the world coordinate position of the first target based on the first tangent direction matrix and the breakpoint pattern data; determining the target breakpoint pattern data corresponding to the distance of the curve breakpoint on the group motion curve based on the first target world coordinate position and the first inverse matrix; the first inverse matrix is the inverse matrix of the second tangent direction matrix; or determining the world coordinate position of the second target based on the second tangent direction matrix and the breakpoint pattern data; determining the target breakpoint pattern data corresponding to the distance of the curve breakpoint on the group motion curve based on the second target world coordinate position and the second inverse matrix; the second inverse matrix is the inverse matrix of the first tangent direction matrix.
[0046] Specifically, the first tangent direction matrix Min along the tangent direction at the curve's starting break point and the second tangent direction matrix MOut along the tangent direction at the curve's ending break point are determined. When the formation data only includes the breakpoint starting formation data of the curve's starting break point, or when the formation data does not include either the breakpoint starting formation data or the breakpoint ending formation data, the first tangent direction matrix Min and the breakpoint formation data Formation are multiplied to obtain the first target world coordinate position FormationInWorld1. Then, the first target world coordinate position FormationInWorld1 and the first inverse matrix MOutInverse are multiplied to obtain the target breakpoint formation data.
[0047] When the formation data only includes the breakpoint termination formation data of the curve start breakpoint, the second tangent direction matrix MOut and the breakpoint formation data Formation are multiplied to obtain the second target world coordinate position FormationInWorld2. Then, the second target world coordinate position FormationInWorld2 and the first inverse matrix MInInverse are multiplied to obtain the target breakpoint formation data.
[0048] In this exemplary embodiment, a specific method for determining breakpoint array data is provided, which improves the accuracy of the determined array data.
[0049] In step S120, the sampling distance of the group motion curve is determined according to the preset sampling distance interval and different curve distances.
[0050] In an exemplary embodiment of this disclosure, the preset sampling distance interval is a preset sampling interval value. Different initial sampling distances can be determined based on the preset sampling distance interval. Based on the initial sampling distance and the curve distance, the sampling distance on the group motion curve can be determined. Different sampling distances can correspond to different sampling points on the group motion curve.
[0051] In an optional embodiment, determining the sampling distance of the group motion curve based on a preset sampling distance interval and different curve distances includes: determining the current sampling distance; determining a first curve distance and a second curve distance among different curve distances based on the current sampling distance; if the current sampling distance, the first curve distance, and the second curve distance satisfy a first sampling condition, then determining the current sampling distance as the sampling distance of the group motion curve; if the current sampling distance, the first curve distance, and the second curve distance satisfy a second sampling condition, then determining the first curve distance and the current sampling distance as the sampling distance of the group motion curve; determining a target sampling distance based on the current sampling distance and the preset sampling distance interval, and then determining the first curve distance and the second curve distance among different curve distances based on the target sampling distance, iterating cyclically until the sampling end condition is met.
[0052] Here, the current sampling distance is a distance value corresponding to a point on the group motion curve. The distance of this point from the starting point of the group motion curve is the current sampling distance. Assume that the different curve distances corresponding to the formation data include 0, 5, 15, 35, 40, 60, and 65. If the current sampling distance is 0, since 0 also exists in the curve distance, the first curve distance and the second curve distance are the same, and both are 0. If the current sampling distance is 10, since 10 lies between curve distances 5 and 15, the first curve distance is 5, and the second curve distance is 15.
[0053] When the current sampling distance, the first curve distance, and the second curve distance are equal, the current sampling distance satisfies the first sampling condition. At this time, the current sampling distance is determined as the sampling distance of the group motion curve. When the current sampling distance is between the first curve distance and the second curve distance, the current sampling distance satisfies the second sampling condition. At this time, the sampling distance includes the current sampling distance and the first curve distance.
[0054] Following the above steps, a preset sampling distance interval is added to the current sampling distance to obtain the target sampling distance (the current sampling distance in the next iteration). The above steps are iterated repeatedly until the sampling termination condition is met. The sampling termination condition can be that the target sampling distance is greater than the curve length of the group motion curve. For example, if the current sampling distance in the first iteration is 0, and the preset sampling distance interval is 10, assuming that the different curve distances corresponding to the formation data include 0, 5, 15, 35, 40, 60, and 65, and the curve length of the group motion curve is 70, then the determined sampling distances are 0, 5, 10, 15, 20, 30, 35, 40, 50, 60, 65, and 70.
[0055] In step S130, among different curve distances, the target curve distance corresponding to the sampling distance is determined, and the position of the group element in the group animation is determined based on the target array data corresponding to the target curve distance.
[0056] In an exemplary embodiment of this disclosure, after determining the sampling distance, the target curve distance is determined from the curve distance. Based on the target formation data corresponding to the target curve distance recorded in the formation data, the position of the group element in the group animation at the location corresponding to the sampling distance can be determined.
[0057] In an optional embodiment, determining the target curve distance corresponding to the sampling distance among different curve distances includes: if a sampling distance exists among the curve distances, then the curve distance is the target curve distance.
[0058] If the sampling distance is exactly the same as the curve distance, then the curve distance is determined as the target curve distance, which is used to determine the position of the group elements in the future.
[0059] In an optional embodiment, the position of the group element in the group animation is determined based on the target array data corresponding to the target curve distance, including: determining the sampling array data corresponding to the curve distance, obtaining the movement matrix of the sampling point corresponding to the sampling distance in the group motion curve; and determining the position of the group element in the group animation at the sampling point based on the movement matrix and the sampling array data.
[0060] Assuming that the different curve distances corresponding to the formation data include 0, 5, 15, 35, 40, 60 and 65, and the curve length of the group motion curve is 70, then the determined sampling distances are 0, 5, 10, 15, 20, 30, 35, 40, 50, 60, 65 and 70.
[0061] Since sampling distances of 0, 5, 35, 40, 60, and 65 all belong to curve distances, the sampling pattern data SampleFormation corresponding to sampling distances of 0, 5, 35, 40, 60, and 65 can be determined in the pattern data. Sampling points corresponding to the sampling distances exist in the group motion curve, and the movement matrix SampleM corresponding to the sampling points can be directly obtained. The movement matrix is used to describe the movement information of the group animation at the sampling points on the group motion curve.
[0062] The result of multiplying the sampled array data SampleFormation and the movement matrix SampleM is the position L1 of the group animation at the sampling point. It is worth noting that the group animation includes multiple group elements, and the position of the target group element can be determined in L1 based on the identifier corresponding to the group element.
[0063] In this exemplary embodiment, when the sampling distance is the curve distance, the position of the group element at the sampling point can be determined directly through the sampling array data and the movement matrix, which reduces the complexity of determining the position of the group element and improves the efficiency of determining the position of the group element.
[0064] In an optional embodiment, determining the target curve distance corresponding to the sampling distance among different curve distances includes: if there is no sampling distance among the curve distances, determining the third curve distance and the fourth curve distance among different curve distances based on the sampling distance; and determining the third curve distance and the fourth curve distance as the target curve distance.
[0065] When the sampling distance is not a curve distance, it is necessary to determine the third and fourth curve distances adjacent to the sampling distance from the curve distance.
[0066] Assuming that the different curve distances corresponding to the formation data include 0, 5, 15, 35, 40, 60 and 65, and the curve length of the group motion curve is 70, then the determined sampling distances are 0, 5, 10, 15, 20, 30, 35, 40, 50, 60, 65 and 70.
[0067] Clearly, the sampling distance of 10 is not included in the curve distance. Therefore, the third curve distance, determined from the curve distance, is 5, and the fourth curve distance is 15. These three curve distances, 5 and 15, are the target curve distances needed to determine the positions of group elements later. Similarly, for other sampling distances not included in the curve distance, the third and fourth curve distances can be determined using the same method.
[0068] In this exemplary embodiment, when there is no sampling distance in the curve distance, it is necessary to determine the position of the subsequent group element based on the third curve distance and the fourth curve distance, so as to ensure the consistency between the determined group element position and the position included in the array data.
[0069] In an optional embodiment, the position of the group element in the group animation is determined based on the target formation data corresponding to the target curve distance, including: determining the sampling ratio based on the sampling distance, the third curve distance, and the fourth curve distance; determining the first world coordinate position of the group element at the third curve distance and the second world coordinate position of the group element at the fourth curve distance; determining the first world coordinate position as the first mapping curve point on the group motion curve and the second world coordinate position as the second mapping curve point on the group motion curve; determining the first offset value in the first direction, the second offset value in the second direction, and the fifth curve distance based on the first world coordinate position and the first mapping curve point; determining the third offset value in the first direction, the fourth offset value in the second direction, and the sixth curve distance based on the second world coordinate position and the second mapping curve point; determining the position of the group element in the group animation at the sampling point based on the sampling ratio, the first world coordinate position, the first offset value, the second offset value, the fifth curve distance, the second world coordinate position, the third offset value, the fourth offset value, and the sixth curve distance; the sampling point corresponds to the sampling distance.
[0070] Here, the sampling ratio refers to the proportion between two differences. Specifically, one difference is the difference between the sampling distance and the distance of the third curve, and the other difference is the difference between the distance of the fourth curve and the distance of the third curve. Specifically, the formula for calculating the sampling ratio is shown in formula (1).
[0071] Percent=(CurrentDist-PrevDist) / (PostDist-PrevDist)(1)
[0072] Where Percent is the sampling percentage, CurrentDist is the sampling distance, PrevDist is the distance to the third curve, and PostDist is the distance to the fourth curve.
[0073] The first world coordinate position refers to the position of the group element at the third curve distance (PrevWloc) in world coordinates. Correspondingly, the second world coordinate position refers to the position of the group element at the fourth curve distance (PostWloc) in world coordinates. The first mapped curve point refers to the curve point on the group motion curve that is closest to the first world coordinate position (PrevShortDistPoint), and correspondingly, the second mapped curve point refers to the curve point on the group motion curve that is closest to the second world coordinate position (PostShortDistPoint).
[0074] Based on the first mapped curve point and the first world coordinate position, the offset values of the first displacement vector composed of the first mapped curve point and the first world coordinate position can be determined in the first direction, the second direction, and the tangent direction (i.e., the first offset value PrevUpV, the second offset value PrevRightV, and the tangent offset value PrevTanV). The fifth curve distance refers to the sum of the curve distance PrevPointDist corresponding to PrevShortDistPoint and the tangent offset value PrevTanV.
[0075] Similarly, the third offset value PostUpV, the fourth offset value PostRightV, and the sixth curve distance (the sum of the curve distance PostPointDist corresponding to PostShortDistPoint and the tangent offset value PostTanv) can also be obtained based on the second world coordinate position and the second mapping curve point.
[0076] Finally, based on the sampling percentage (Percent), the first world coordinate position (PrevWloc), the first offset value (PrevUpV), the second offset value (PrevRightV), the fifth curve distance, the second world coordinate position (PostWloc), the third offset value (PostUpV), the fourth offset value (PostRightV), and the sixth curve distance, the position of the group element in the group animation at the sampling point can be determined.
[0077] In this exemplary embodiment, when the curve distance does not include the sampling distance, a method for determining the position of group elements is provided, which reduces the complexity of determining the position of group elements and improves the efficiency of determining the position of group elements.
[0078] In an optional embodiment, determining the first world coordinate position on the first mapped curve point on the group motion curve includes: determining the distance matrix data of the group element at the distance of the third curve in the group animation, and determining the first component of the distance matrix data; if the first component is greater than a preset value, determining the first segmented curve in the group motion curve; the first segmented curve includes the target segmented curve and the next segmented curve that is adjacent to the target segmented curve; determining the first mapped curve point on the first segmented curve where the first world coordinate position is located. If the first component is less than or equal to a preset value, the second segmented curve is determined in the group motion curve; the second segmented curve includes the target segmented curve and the previous segmented curve that is adjacent to the target segmented curve; the first world coordinate position is determined as the first mapping curve point on the second segmented curve.
[0079] Among them, the formation data records the distance formation data LLoc corresponding to the distance to the third curve, and the component of the distance formation data on the X-axis is the first component LLoc.X.
[0080] The default value can be 0. If the first component is greater than the default value, it proves that the group element is in front of the center of the formation. The first segment curve refers to a segment of the group motion curve, and the first mapping curve point is located in the first segment curve.
[0081] The group motion curve includes multiple control points, with adjacent control points having the same interval segment. Figure 3 This schematically illustrates a partial group of motion curves showing control points in this exemplary embodiment, such as... Figure 3 As mentioned above, curve 310 is a group motion curve, and there are multiple control points pointDist on the group motion curve. The distance between multiple control points pointDist is represented by segment. If the distance of the third curve is located in segment[1] (i.e. the segment between pointDist[1] and pointDist[2]), then the first segmented curve refers to the curve segment represented by segment[1] and segment[2] (i.e. the segment between pointDist[2] and pointDist[3]).
[0082] If the first component is less than the preset value, it proves that the group element is behind the center of the formation. At this time, it is necessary to determine the second segment curve, and the first mapping curve point is located in the second segment curve. As shown in Figure 3, if the distance of the third curve is located in segment[1], then the first segment curve refers to the curve segment represented by segment[1] and segment[0] (i.e., the segment between pointDist[0] and pointDist[1]). Similarly, the process of determining the second mapping curve point is similar to the above, and will not be repeated here.
[0083] In this exemplary embodiment, a specific method for determining the first mapping curve point is provided to improve the logic for determining the first mapping curve point.
[0084] In an optional embodiment, determining a first offset value in the first direction, a second offset value in the second direction, and a fifth curve distance based on the first world coordinate position and the first mapping curve point includes: determining a first displacement vector based on the first world coordinate position and the first mapping curve point; and determining the first offset value, the second offset value, and the tangent offset value of the first displacement vector in the first direction, the second direction, and the tangent direction, respectively. Determine the mapping distance corresponding to the first mapping curve point on the group motion curve, and determine the distance of the fifth curve based on the mapping distance and the tangent offset value.
[0085] In this context, assuming the first world coordinate position is PrevWloc and the first mapping curve point is PrevShortDistPoint, then the first displacement vector is PrevWloc - PrevShortDistPoint.
[0086] The first direction refers to the upward direction, and the second direction refers to the rightward direction. The first offset value is the upward offset value PrevUpV of PrevWloc-PrevShortDistPoint, and the second offset value is the rightward offset value PrevRightV of PrevWloc-PrevShortDistPoint. The tangent offset value is the tangent offset value PrevTanV of PrevWloc-PrevShortDistPoint.
[0087] Figure 4 A schematic diagram of the first displacement vector in an embodiment of this disclosure is shown, such as... Figure 4 As shown, curve 410 is the group motion curve, curve point 420 is the first mapped curve point PrevShortDistPoint, position 421 is the first world coordinate position PrevWloc, and vector 430 is the first displacement vector. Then, based on the first displacement vector, the first offset value along the first direction 440, the second offset value along the second direction 450, and the tangent offset value along the tangent direction 460 can be determined.
[0088] The distance from the first mapped curve point to the starting point of the group motion curve is the mapping distance PrevPointDist. The fifth curve distance is the sum of the mapping distance PrevPointDist and the tangent offset value PrevTanV, PervTangentDist. Similarly, the third offset value, the fourth offset value, and the sixth curve distance can be determined according to the above steps.
[0089] In this exemplary embodiment, a method is provided for determining a first offset value, a second offset value, a fifth curve distance, a third offset value, a fourth offset value, and a sixth curve distance.
[0090] In an optional embodiment, the position of the group element in the group animation at the sampling point is determined based on the sampling ratio, the first world coordinate position, the first offset value, the second offset value, the fifth curve distance, the second world coordinate position, the third offset value, the fourth offset value, and the sixth curve distance. This includes: performing interpolation calculations on the fifth curve distance, the sixth curve distance, and the sampling ratio to obtain the interpolation calculation result; determining the first target breakpoint marker and the second target breakpoint marker corresponding to the curve distance in the breakpoint markers; determining the tangent interpolation result of the group motion curve in the tangent direction based on the size relationship between the interpolation calculation result, the first target breakpoint marker, and the second target breakpoint marker; obtaining the first direction interpolation result based on the first offset value, the third offset value, and the sampling ratio; obtaining the second direction interpolation result based on the second offset value, the fourth offset value, and the sampling ratio; determining the first tangent vector and the second tangent vector of the tangent interpolation result in the first direction and the second direction, respectively; and determining the position of the group element in the group animation at the sampling point based on the tangent interpolation result, the first tangent vector, the first direction interpolation result, the second tangent vector, and the second direction interpolation result.
[0091] The interpolation calculation results obtained by using the interpolation function lerp() to interpolate the distance of the fifth curve, the distance of the sixth curve, and the sampling ratio are shown in formula (2).
[0092] RDist=lerp(PervTangentDist, PostTangentDist, Perenct) (2)
[0093] Where PervTangentDist is the distance of the fifth curve, PostTangentDist is the distance of the sixth curve, Perenct is the sampling percentage, and RDist is the interpolation result.
[0094] The first target breakpoint marker and the second target breakpoint marker refer to breakpoint markers that are adjacent in sampling distance. Figure 5 This schematically illustrates a group motion curve displaying breakpoint markers in an embodiment of the present disclosure, such as... Figure 5 As shown, curve 510 is a group motion curve, with the starting point of the group motion curve at 0, and the total length of the group motion curve is splineLength. InputDist1 and OutputDist1 represent the first breakpoint markers on the group motion curve 510, and InputDist2 and OutputDist2 represent the first breakpoint markers on the group motion curve 510.
[0095] If the sampling distance CurrentDist is between OutputDist1 and InputDist2, then the first target breakpoint PrevBreakDist is marked as OutputDist1, and the second target breakpoint PostBreakDist is marked as InputDist2. It's worth noting that if the sampling distance is between InputDist1 and OutputDist1 or between InputDist2 and OutputDist2, the positions of the group elements are not updated.
[0096] The interpolation calculation results, the size of the first target breakpoint marker, and the size of the second target breakpoint marker are judged. Based on different judgment results, the tangent interpolation result RLoc of the group motion curve in the tangent direction can be determined.
[0097] The first direction interpolation result is the interpolation result of the group motion curve in the upward direction obtained based on the first offset value, the third offset value and the sampling ratio (as shown in formula (3)). The second direction interpolation result is the interpolation result of the group motion curve in the right direction obtained based on the second offset value, the fourth offset value and the sampling ratio (as shown in formula (4)).
[0098] First direction interpolation result = lerp(PrevUpV, PostUpV, Percent) (3)
[0099] Where PrevUpV is the first offset value, PostUpV is the third offset value, and Percent is the sampling percentage.
[0100] Second-direction interpolation result = lerp(PrevRightV, PostRightV, Percent) (4)
[0101] Among them, PrevRightV is the second offset value, and PostRightV is the fourth offset value.
[0102] The first interpolation vector refers to the component RUp of the interpolation result in the first direction (i.e., the upward direction), and the second interpolation vector refers to the component RRight of the interpolation result in the second direction (i.e., the rightward direction). Based on this, the positions of the group elements at the sampling points are as shown in formula (5).
[0103] The position of the group element at the sampling point = RLoc + RUp × first direction interpolation result + RRight × second direction interpolation result (5)
[0104] In this exemplary embodiment, the position of the group element at the sampling point can be obtained based on the tangent interpolation result, the first interpolation vector, the first direction interpolation result, the second interpolation vector, and the second direction interpolation result, which reduces the complexity of determining the position of the group element and improves the efficiency of determining the position of the group element.
[0105] In an optional embodiment, the tangent interpolation result of the group motion curve in the tangent direction is determined based on the size relationship between the interpolation calculation result, the first target breakpoint marker, and the second target breakpoint marker. This includes: if the interpolation calculation result is less than the first target breakpoint marker, the tangent interpolation result of the group motion curve in the tangent direction is determined based on the first world coordinate position, the tangent of the first sampling point, the interpolation calculation result, and the first target breakpoint marker; the distance between the first sampling point and the third curve corresponds; if the interpolation calculation result is greater than the second target breakpoint marker, the tangent interpolation result is determined based on the second world coordinate position, the tangent of the second sampling point, the interpolation calculation result, and the second target breakpoint marker; the distance between the second sampling point and the fourth curve corresponds; if the interpolation calculation result is greater than or equal to the first target breakpoint marker and less than or equal to the second target breakpoint marker, the interpolation curve point corresponding to the interpolation calculation result is determined in the group motion curve, and the sampling result of the interpolation curve point is determined as the tangent interpolation result.
[0106] The relationship between the interpolation result, the first target breakpoint marker, and the second target breakpoint marker can be divided into three cases. The first case is that the interpolation result is smaller than the first target breakpoint marker. In this case, the tangent interpolation result is shown in formula (6).
[0107] RLoc=PrevWloc+PrevTangent×(RDist-PrevBreakDist)(6)
[0108] Wherein, RLoc is the tangent interpolation result, PrevWloc is the first world coordinate position, PrevTangent is the tangent of the first sampling point, RDist is the interpolation calculation result, and PrevBreakDist is the first target breakpoint marker.
[0109] The second case is when the interpolation result is greater than the first target breakpoint mark. In this case, the tangent interpolation result is as shown in formula (7).
[0110] RLoc=PostWLoc+PostTangent×(RDist-PostBreakDist)(7)
[0111] Wherein, RLoc is the tangent interpolation result, PostWLoc is the second world coordinate position, PostTangent is the tangent of the second sampling point, RDist is the interpolation calculation result, and PostBreakDist is the second target breakpoint marker.
[0112] The third case is when the interpolation result is greater than or equal to the first target breakpoint mark and less than or equal to the second target breakpoint mark. In this case, the tangent interpolation result is the sampling result obtained by sampling at the interpolation curve point (the curve point on the group motion curve corresponding to RDist).
[0113] In this exemplary embodiment, different methods for determining the tangent interpolation result are provided, thus improving the logic for determining the tangent interpolation result.
[0114] In an optional embodiment, after determining the position of the group elements in the group animation, the method further includes: generating element motion curves corresponding to each group element according to the position of each group element in the group animation; obtaining the curve distance of the group elements, and determining the first element distance and the second element distance corresponding to the curve distance of the group elements among different curve distances; determining the third element distance and the fourth element distance in the element motion curve according to the first element distance and the second element distance; determining the element distance ratio according to the first element distance, the second element distance and the element curve distance; obtaining the target distance of the group elements on the element motion curve according to the element distance ratio, the third element distance and the fourth element distance; and the world coordinate position corresponding to the target distance is the movement position of the group elements on the curve distance of the group elements.
[0115] In group animation, there are many group elements. After determining the positions of the group elements at different sampling distances, the CharCurve of the element motion curve composed of these positions can be generated.
[0116] The element curve distance is a distance value InDist input by the user, used to determine the position of the group element at the target curve point of the element motion curve (the distance between the target curve point and the starting point of the element motion curve is the element curve distance).
[0117] The first and second distances of an element are two adjacent distance values on the group's motion curves. The third and fourth distances of an element are the distances from two curve points on the element's motion curve to the starting point of the element's motion curve. The third distance is determined by the index value of the first distance, and the fourth distance is determined by the index value of the second distance.
[0118] Specifically, assuming the first distance of an element is PrevDist1, the second distance is PostDist1, and the index corresponding to PrevDist1 is PrevID, and the index corresponding to PostDist1 is PostID, and SampleDistID records the index of the sampling distance, then in CharCurve, the distance value corresponding to SampleDistID[PrevID] is determined as the third distance of the element PrevCharDist, and the distance value corresponding to SampleDistID[PostID] is determined as the fourth distance of the element PostCharDist.
[0119] The element distance ratio is the ratio between two differences, which are the difference between the element curve distance and the first element distance, and the difference between the second element distance and the first element distance, as shown in formula (8).
[0120] InPercent=(InDist-PrevDist) / (PostDist-PrevDist)(8)
[0121] Where InPercent is the element distance percentage, InDist is the element curve distance, PrevDist is the element first distance, and PostDist is the element second distance.
[0122] The target distance is CharInDist, which is the distance from the target curve point to the starting point of the group's motion curve. Specifically, the formula for calculating CharInDist is shown in formula (9).
[0123] CharInDist=InPercent×(PostCharDist-PrevCharDist)+PrevCharDist(9)
[0124] Where CharInDist is the target distance, InPercent is the element distance percentage, PrevCharDist is the third element distance, and PostCharDist is the fourth element distance.
[0125] Based on this, the world coordinate position of the element's CharCurve at the target distance is the movement position of the group element at the group element distance.
[0126] In this exemplary embodiment, the position of a group element at a specified distance can be obtained based on the group element curve distance and the element motion curve, thereby improving the flexibility of determining the position of a group element at a specific distance.
[0127] In the method and apparatus provided in the exemplary embodiments of this disclosure, the sampling distance of the group animation curve is determined according to a preset sampling distance interval and different curve distances. Among the different curve distances, the target curve distance corresponding to the sampling distance is determined. Based on the target array data corresponding to the target curve distance, the position of the group element in the group animation can be determined. On the one hand, this reduces the professional requirements of the production personnel and reduces the complexity of determining the position of the group animation. On the other hand, after determining the target curve distance corresponding to the sampling distance, the position of the group element in the group animation can be determined based on the target array data corresponding to the target curve distance, thus improving the efficiency of determining the position of the group element in the group animation.
[0128] Furthermore, in an exemplary embodiment of this disclosure, a device for determining the position of a group animation is also provided. Figure 6 A schematic diagram of the structure of the group animation position determination device is shown, such as... Figure 6 As shown, the group animation position determination device 600 may include: an acquisition module 610, a sampling module 620, and a position module 630. Wherein: The acquisition module 610 is configured to acquire the group motion curve corresponding to the group animation and acquire the formation data corresponding to the group motion curve; the formation data corresponds to different curve distances on the group motion curve; the sampling module 620 is configured to determine the sampling distance of the group motion curve according to the preset sampling distance interval and different curve distances; the position module 630 is configured to determine the target curve distance corresponding to the sampling distance among different curve distances, and determine the position of the group elements in the group animation according to the target formation data corresponding to the target curve distance.
[0129] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the group motion curve includes curve breakpoints; the apparatus for acquiring formation data corresponding to the group motion curve includes: a breakpoint formation module configured to acquire formation data corresponding to different curve distances on the group motion curve; a tangent matrix module configured to determine breakpoint formation data corresponding to the curve breakpoints in the formation data, and determine a first tangent direction matrix and a second tangent direction matrix corresponding to the curve breakpoints; a target breakpoint formation data determination module configured to determine target breakpoint formation data corresponding to the curve breakpoint distances on the group motion curve based on the breakpoint formation data, the first tangent direction matrix, and the second tangent direction matrix; the curve breakpoint distance corresponds to the curve breakpoint; and a replacement module configured to replace the breakpoint formation data in the formation data with the target breakpoint formation data to obtain the replaced formation data.
[0130] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the curve breakpoint includes a curve start breakpoint and a curve end breakpoint corresponding to the curve start breakpoint; before determining the breakpoint array data corresponding to the curve breakpoint in the array data, the device further includes: a breakpoint marker acquisition module, configured to acquire breakpoint markers corresponding to the group motion curve; the breakpoint markers record the distance between the curve breakpoint and the start point of the group motion curve; a breakpoint marker correction module, configured to determine the curve length of the group motion curve, and if there is a target curve end breakpoint marker greater than the curve length, then correct the target curve end breakpoint marker to the curve length; and a breakpoint marker deletion module, configured to delete the curve start breakpoint marker and the curve end breakpoint marker from the breakpoint markers if there is a curve start breakpoint marker greater than the curve end breakpoint marker.
[0131] In one exemplary embodiment of this disclosure, based on the foregoing scheme, the apparatus further includes: an overlapping marker module configured to compare breakpoint markers pairwise to determine overlapping breakpoint markers; and an overlapping marker deletion module configured to delete overlapping breakpoint markers from the breakpoint markers; or to merge overlapping breakpoint markers into a target breakpoint marker to update the breakpoint markers.
[0132] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the curve breakpoint includes a curve start breakpoint and a curve end breakpoint corresponding to the curve start breakpoint; the apparatus for determining breakpoint array data corresponding to the curve breakpoint in the array data includes: a first breakpoint array data determination module, configured to determine the breakpoint start array data as breakpoint array data if the array data includes breakpoint start array data corresponding to the curve start breakpoint; a second breakpoint array data determination module, configured to determine the breakpoint end array data as breakpoint array data if the array data includes breakpoint end array data corresponding to the curve end breakpoint; and a third breakpoint array data determination module, configured to determine the target array data corresponding to the target distance value that has a distance adjacency relationship with the curve start breakpoint as breakpoint array data if the array data does not include breakpoint start array data and does not include breakpoint end array data.
[0133] In one exemplary embodiment of this disclosure, based on the aforementioned scheme, the apparatus determines target breakpoint pattern data corresponding to the distance between curve breakpoints on the group motion curve according to breakpoint pattern data, a first tangent direction matrix, and a second tangent direction matrix. The apparatus includes: a first target breakpoint pattern data module, configured to determine a first target world coordinate position based on the first tangent direction matrix and the breakpoint pattern data, and to determine target breakpoint pattern data corresponding to the distance between curve breakpoints on the group motion curve based on the first target world coordinate position and a first inverse matrix; the first inverse matrix is the inverse of the second tangent direction matrix; or: a second target breakpoint pattern data module, configured to determine a second world coordinate position based on the second target tangent direction matrix and the breakpoint pattern data, and to determine target breakpoint pattern data corresponding to the distance between curve breakpoints on the group motion curve based on the second world coordinate position and the second inverse matrix; the second inverse matrix is the inverse of the first tangent direction matrix.
[0134] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the sampling distance of a group motion curve is determined according to a preset sampling distance interval and different curve distances. The apparatus includes: a current sampling module configured to determine a current sampling distance; a curve distance determination module configured to determine a first curve distance and a second curve distance among different curve distances; a first sampling condition module configured to determine the current sampling distance as the sampling distance of the group motion curve if the current sampling distance, the first curve distance, and the second curve distance satisfy a first sampling condition; a second sampling condition module configured to determine the first curve distance and the current sampling distance as the sampling distance of the group motion curve if the current sampling distance, the first curve distance, and the second curve distance satisfy a second sampling condition; and an iterative loop module configured to determine a target sampling distance according to the current sampling distance and the preset sampling distance interval, and to determine the first curve distance and the second curve distance among different curve distances according to the target sampling distance, and to iterate until the sampling end condition is met.
[0135] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, a target curve distance corresponding to the sampling distance is determined among different curve distances. The apparatus includes a target curve distance module, configured such that if a sampling distance exists among the curve distances, then the curve distance is the target curve distance.
[0136] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the position of group elements in a group animation is determined according to the target array data corresponding to the target curve distance. The apparatus includes: a movement matrix module configured to determine the sampling array data corresponding to the curve distance and obtain the movement matrix of the sampling points corresponding to the sampling distance in the group motion curve; and a position determination module configured to determine the position of the group elements in the group animation at the sampling points according to the movement matrix and the sampling array data.
[0137] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, a target curve distance corresponding to the sampling distance is determined among different curve distances. The apparatus includes: a target curve distance determination module, configured to determine a third curve distance and a fourth curve distance among different curve distances based on the sampling distance if no sampling distance exists among the curve distances; and to determine the third curve distance and the fourth curve distance as the target curve distance.
[0138] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the position of group elements in a group animation is determined according to the target formation data corresponding to the target curve distance. The apparatus includes: a sampling ratio module configured to determine a sampling ratio based on a sampling distance, a third curve distance, and a fourth curve distance; a world coordinate determination module configured to determine a first world coordinate position of a group element in the group animation at the third curve distance, and a second world coordinate position of a group element at the fourth curve distance; a mapping curve point determination module configured to determine a first mapping curve point on the group motion curve where the first world coordinate position is located, and a second mapping curve point on the group motion curve where the second world coordinate position is located; and a first determination bias... The shift value module is configured to determine a first offset value in the first direction, a second offset value in the second direction, and a fifth curve distance based on the first world coordinate position and the first mapping curve point; the second offset value determination module is configured to determine a third offset value in the first direction, a fourth offset value in the second direction, and a sixth curve distance based on the second world coordinate position and the second mapping curve point; the sampling point position determination module is configured to determine the position of the group element in the group animation at the sampling point based on the sampling ratio, the first world coordinate position, the first offset value, the second offset value, the fifth curve distance, the second world coordinate position, the third offset value, the fourth offset value, and the sixth curve distance; the sampling point corresponds to the sampling distance.
[0139] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the apparatus for determining a first mapping curve point on a group motion curve with a first world coordinate position includes: a component determination module configured to determine distance matrix data of group elements in the group animation at a third curve distance, and determine a first component of the distance matrix data; a first segmented curve determination module configured to determine a first segmented curve in the group motion curve if the first component is greater than a preset value; the first segmented curve includes a target segmented curve and a next segmented curve that is adjacent to the target segmented curve; a first mapping point determination module configured to determine a first mapping curve point on the first segmented curve with the first world coordinate position; a second segmented curve determination module configured to determine a second segmented curve in the group motion curve if the first component is less than or equal to a preset value; the second segmented curve includes a target segmented curve and a previous segmented curve that is adjacent to the target segmented curve; and a second mapping point determination module configured to determine a first mapping curve point on the second segmented curve with the first world coordinate position.
[0140] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, a first offset value in a first direction, a second offset value in a second direction, and a fifth curve distance are determined according to the first world coordinate position and the first mapping curve point. The apparatus includes: a displacement vector determination module configured to determine a first displacement vector according to the first world coordinate position and the first mapping curve point; an offset value determination module configured to determine the first offset value, the second offset value, and the tangent offset value of the first displacement vector in the first direction, the second direction, and the tangent direction, respectively; and a mapping distance determination module configured to determine the mapping distance corresponding to the first mapping curve point on the group motion curve, and determine the fifth curve distance according to the mapping distance and the tangent offset value.
[0141] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the position of group elements in a group animation at a sampling point is determined according to the sampling ratio, a first world coordinate position, a first offset value, a second offset value, a fifth curve distance, a second world coordinate position, a third offset value, a fourth offset value, and a sixth curve distance. The apparatus includes: a first interpolation module configured to perform interpolation calculations on the fifth curve distance, the sixth curve distance, and the sampling ratio to obtain an interpolation calculation result, and to determine a first target breakpoint marker and a second target breakpoint marker corresponding to the curve distance in the breakpoint markers; and a second interpolation module configured to determine the position of group elements in a group animation at a sampling point based on the sampling ratio, a first world coordinate position, a first offset value, a second offset value, a fifth curve distance, a second world coordinate position, a third offset value, a fourth offset value, and a sixth curve distance. The relationship between the size of the record and the second target breakpoint marker is used to determine the tangent interpolation result of the group motion curve in the tangent direction; the module for determining the position of group elements is configured to obtain the first direction interpolation result based on the first offset value, the third offset value, and the sampling ratio, and to obtain the second direction interpolation result based on the second offset value, the fourth offset value, and the sampling ratio; the first tangent vector and the second tangent vector in the first direction and the second direction are determined respectively based on the tangent interpolation result, the first tangent vector, the first direction interpolation result, the second tangent vector, and the second direction interpolation result, and the position of the group elements in the group animation at the sampling point is determined.
[0142] In an exemplary embodiment of this disclosure, based on the aforementioned scheme, the tangent interpolation result of the group motion curve in the tangent direction is determined according to the interpolation calculation result, the size relationship between the first target breakpoint marker and the second target breakpoint marker. The device includes: a first tangent interpolation module, configured to determine the tangent interpolation result of the group motion curve in the tangent direction according to the first world coordinate position, the tangent of the first sampling point, the interpolation calculation result, and the first target breakpoint marker if the interpolation calculation result is less than the first target breakpoint marker; the first sampling point corresponds to the distance of the third curve; The second tangent interpolation module is configured to determine the tangent interpolation result based on the second world coordinate position, the tangent of the second sampling point, the interpolation result, and the second target breakpoint mark if the interpolation calculation result is greater than the second target breakpoint mark; and determine the distance between the second sampling point and the fourth curve. The third tangent interpolation module is configured to determine the interpolation curve point corresponding to the interpolation calculation result in the group motion curve if the interpolation calculation result is greater than or equal to the first target breakpoint mark and less than or equal to the second target breakpoint mark, and determine the sampling result of the interpolation curve point as the tangent interpolation result.
[0143] In an exemplary embodiment of this disclosure, after determining the position of the group elements in the group animation based on the aforementioned scheme, the apparatus further includes: an element motion curve module configured to generate an element motion curve corresponding to each group element according to the position of each group element in the group animation; a first element distance determination module configured to obtain the group element curve distance and determine a first element distance and a second element distance corresponding to the group element curve distance among different curve distances; a second element distance determination module configured to determine a third element distance and a fourth element distance in the element motion curve based on the first element distance and the second element distance; an element distance ratio module configured to determine the element distance ratio based on the first element distance, the second element distance, and the element curve distance; and an element motion curve position determination module configured to obtain the target distance of the group element on the element motion curve based on the element distance ratio, the third element distance, and the fourth element distance; the world coordinate position corresponding to the target distance is the movement position of the group element on the group element curve distance.
[0144] The specific details of the group animation position determination device 600 have been described in detail in the corresponding group animation position determination method, so they will not be repeated here.
[0145] It should be noted that although several modules or units of the group animation position determination device 600 are mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0146] Furthermore, in an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.
[0147] The following reference Figure 7 To describe an electronic device 700 according to such an embodiment of the present invention. Figure 7 The electronic device 700 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0148] like Figure 7 As shown, the electronic device 700 is manifested in the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, a bus 730 connecting different system components (including storage unit 720 and processing unit 710), and a display unit 740.
[0149] The storage unit stores program code that can be executed by the processing unit 710, causing the processing unit 710 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention.
[0150] Storage unit 720 may include readable media in the form of volatile storage units, such as random access memory (RAM) 721 and / or cache memory 722, and may further include read-only memory (ROM) 723.
[0151] Storage unit 720 may also include a program / utility 724 having a set (at least one) of program modules 725, such program modules 725 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may contain the reality of the network environment.
[0152] Bus 730 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0153] Electronic device 700 can also communicate with one or more external devices 770 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 700, and / or with any device that enables electronic device 700 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 750. Furthermore, electronic device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 760. As shown, network adapter 760 communicates with other modules of electronic device 700 via bus 730. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0154] The processor in the aforementioned electronic device, by executing machine-executable instructions, can perform the following operations in the aforementioned virtual background generation method: Obtain the group motion curve corresponding to the group animation, and obtain the formation data corresponding to the group motion curve; the formation data corresponds to different curve distances on the group motion curve; determine the sampling distance of the group motion curve based on the preset sampling distance interval and different curve distances; among the different curve distances, determine the target curve distance corresponding to the sampling distance, and determine the position of the group elements in the group animation based on the target formation data corresponding to the target curve distance.
[0155] Obtain formation data corresponding to different curve distances on the group's motion curve; determine the breakpoint formation data corresponding to the curve breakpoints in the formation data, and determine the first tangent direction matrix and the second tangent direction matrix corresponding to the curve breakpoints; based on the breakpoint formation data, the first tangent direction matrix, and the second tangent direction matrix, determine the target breakpoint formation data corresponding to the curve breakpoint distances on the group's motion curve; the curve breakpoint distance corresponds to the curve breakpoint; replace the breakpoint formation data in the formation data with the target breakpoint formation data to obtain the replaced formation data.
[0156] Obtain the breakpoint markers corresponding to the group motion curves; the breakpoint markers record the distance between the curve breakpoint and the starting point of the group motion curve; determine the curve length of the group motion curve; if there is a target curve termination breakpoint marker that is greater than the curve length, then correct the target curve termination breakpoint marker to the curve length; if there is a curve start breakpoint marker that is greater than the curve termination breakpoint marker, delete both the curve start breakpoint marker and the curve termination breakpoint marker from the breakpoint markers.
[0157] The breakpoint markers are compared pairwise to identify overlapping breakpoint markers; the overlapping breakpoint markers are then removed from the breakpoint markers; or the overlapping breakpoint markers are merged into the target breakpoint marker to update the breakpoint markers.
[0158] If the formation data includes breakpoint start formation data corresponding to the curve start breakpoint, then the breakpoint start formation data is determined as breakpoint formation data; if the formation data includes breakpoint end formation data corresponding to the curve end breakpoint, then the breakpoint end formation data is determined as breakpoint formation data; if the formation data does not include breakpoint start formation data or breakpoint end formation data, then the target formation data corresponding to the target distance value that has a distance adjacency relationship with the curve start breakpoint is determined as breakpoint formation data.
[0159] Based on the first tangent direction matrix and breakpoint array data, determine the world coordinate position of the first target. Based on the world coordinate position of the first target and the first inverse matrix, determine the target breakpoint array data corresponding to the distance of the curve breakpoint on the group motion curve; the first inverse matrix is the inverse matrix of the second tangent direction matrix. Alternatively, based on the second tangent direction matrix and breakpoint array data, determine the world coordinate position of the second target. Based on the world coordinate position of the second target and the second inverse matrix, determine the target breakpoint array data corresponding to the distance of the curve breakpoint on the group motion curve; the second inverse matrix is the inverse matrix of the first tangent direction matrix.
[0160] Determine the current sampling distance. Based on the current sampling distance, determine the first curve distance and the second curve distance from different curve distances. If the current sampling distance, the first curve distance, and the second curve distance satisfy the first sampling condition, then the current sampling distance is determined as the sampling distance of the group motion curve. If the current sampling distance, the first curve distance, and the second curve distance satisfy the second sampling condition, then the first curve distance and the current sampling distance are determined as the sampling distance of the group motion curve. Based on the current sampling distance and the preset sampling distance interval, determine the target sampling distance. Based on the target sampling distance, determine the first curve distance and the second curve distance from different curve distances. Iterate in a loop until the sampling end condition is met.
[0161] If the curve distance includes a sampling distance, then the curve distance is the target curve distance.
[0162] Determine the sampling array data corresponding to the curve distance, and obtain the movement matrix of the sampling points corresponding to the sampling distance in the group motion curve; based on the movement matrix and the sampling array data, determine the position of the group elements in the group animation at the sampling points.
[0163] If there is no sampling distance in the curve distance, determine the third curve distance and the fourth curve distance from different curve distances based on the sampling distance; determine the third curve distance and the fourth curve distance as the target curve distance.
[0164] Based on the sampling distance, the third curve distance, and the fourth curve distance, determine the sampling ratio; determine the first world coordinate position of the group element at the third curve distance in the group animation, and determine the second world coordinate position of the group element at the fourth curve distance; determine the first mapping curve point of the first world coordinate position on the group motion curve, and determine the second mapping curve point of the second world coordinate position on the group motion curve; based on the first world coordinate position and the first mapping curve point, determine the first offset value in the first direction, the second offset value in the second direction, and the fifth curve distance; based on the second world coordinate position and the second mapping curve point, determine the third offset value in the first direction, the fourth offset value in the second direction, and the sixth curve distance; based on the sampling ratio, the first world coordinate position, the first offset value, the second offset value, the fifth curve distance, the second world coordinate position, the third offset value, the fourth offset value, and the sixth curve distance, determine the position of the group element at the sampling point in the group animation; the sampling point corresponds to the sampling distance.
[0165] Determine the distance matrix data of group elements at the third curve distance in the group animation, and determine the first component of the distance matrix data; if the first component is greater than a preset value, determine the first segment curve in the group motion curve; the first segment curve includes the target segment curve and the next segment curve that is adjacent to the target segment curve; determine the first mapping curve point of the first world coordinate position on the first segment curve; if the first component is less than or equal to the preset value, determine the second segment curve in the group motion curve; the second segment curve includes the target segment curve and the previous segment curve that is adjacent to the target segment curve; determine the first mapping curve point of the first world coordinate position on the second segment curve.
[0166] Based on the first world coordinate position and the first mapping curve point, determine the first displacement vector; determine the first offset value, the second offset value, and the tangent offset value of the first displacement vector in the first direction, the second direction, and the tangent direction respectively; determine the mapping distance corresponding to the first mapping curve point on the group motion curve, and determine the fifth curve distance based on the mapping distance and the tangent offset value.
[0167] Interpolation calculations are performed on the distances to the fifth and sixth curves and the sampling ratio to obtain the interpolation results. The first and second target breakpoint markers corresponding to the curve distances are determined in the breakpoint markers. Based on the interpolation results, the size relationship between the first and second target breakpoint markers, the tangent interpolation results of the group motion curves in the tangent direction are determined. Based on the first and third offset values and the sampling ratio, the first direction interpolation results are obtained. Based on the second and fourth offset values and the sampling ratio, the second direction interpolation results are obtained. The first and second tangent vectors of the tangent interpolation results in the first and second directions are determined respectively. Based on the tangent interpolation results, the first tangent vector, the first direction interpolation results, the second tangent vector, and the second direction interpolation results, the positions of the group elements in the group animation at the sampling points are determined.
[0168] If the interpolation result is less than the first target breakpoint mark, the tangent interpolation result of the group motion curve in the tangent direction is determined based on the first world coordinate position, the tangent of the first sampling point, the interpolation result, and the first target breakpoint mark; the distance between the first sampling point and the third curve corresponds. If the interpolation result is greater than the second target breakpoint mark, the tangent interpolation result is determined based on the second world coordinate position, the tangent of the second sampling point, the interpolation result, and the second target breakpoint mark; the distance between the second sampling point and the fourth curve corresponds. If the interpolation result is greater than or equal to the first target breakpoint mark and less than or equal to the second target breakpoint mark, the interpolation curve point corresponding to the interpolation result is determined in the group motion curve, and the sampling result of the interpolation curve point is determined as the tangent interpolation result.
[0169] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0170] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the invention described in the "Exemplary Methods" section above.
[0171] refer to Figure 8 As shown, a program product 800 for implementing the above-described method according to an embodiment of the present invention is described. It may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0172] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0173] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0174] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0175] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0176] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
Claims
1. A method for determining the position of a group animation, characterized in that, The method includes: Obtain the group motion curve corresponding to the group animation, and obtain the formation data corresponding to the group motion curve; the formation data corresponds to the different curve distances on the group motion curve. The sampling distance of the group motion curve is determined based on the preset sampling distance interval and the different curve distances; Among the different curve distances, the target curve distance corresponding to the sampling distance is determined, and the position of the group element in the group animation is determined based on the target array data corresponding to the target curve distance.
2. The method for determining the position of group animation according to claim 1, characterized in that, The group motion curve includes curve breakpoints; The method for obtaining the formation data corresponding to the group motion curve includes: Obtain the formation data corresponding to different curve distances on the group's motion curve; In the array data, determine the breakpoint array data corresponding to the curve breakpoint, and determine the first tangent direction matrix and the second tangent direction matrix corresponding to the curve breakpoint; Based on the breakpoint pattern data, the first tangent direction matrix, and the second tangent direction matrix, the target breakpoint pattern data corresponding to the curve breakpoint distance on the group motion curve is determined; the curve breakpoint distance corresponds to the curve breakpoint. Replace the breakpoint array data in the array data with the target breakpoint array data to obtain the replaced array data.
3. The method for determining the position of group animation according to claim 2, characterized in that, The curve breakpoints include the curve start breakpoint and the curve end breakpoint corresponding to the curve start breakpoint. Before determining the breakpoint array data corresponding to the curve breakpoint in the array data, the method further includes: Obtain the breakpoint markers corresponding to the group motion curves; the breakpoint markers record the distance between the curve breakpoint and the starting point of the group motion curves; Determine the curve length of the group motion curve. If there is a target curve termination breakpoint marker that is longer than the curve length, then correct the target curve termination breakpoint marker to the curve length. If a curve start breakpoint marker is greater than a curve end breakpoint marker, both the curve start breakpoint marker and the curve end breakpoint marker are deleted from the breakpoint markers.
4. The method for determining the position of group animation according to claim 3, characterized in that, The method further includes: The breakpoint markers are compared pairwise to identify overlapping breakpoint markers. Remove the overlapping breakpoint marker from the breakpoint marker; or The overlapping breakpoint markers are merged into a target breakpoint marker to update the breakpoint markers.
5. The method for determining the position of group animation according to claim 2, characterized in that, The curve breakpoints include the curve start breakpoint and the curve end breakpoint corresponding to the curve start breakpoint. The step of determining the breakpoint array data corresponding to the curve breakpoint in the array data includes: If the array data includes breakpoint start array data corresponding to the curve start breakpoint, then the breakpoint start array data is determined as breakpoint array data; If the array data includes breakpoint termination array data corresponding to the curve termination breakpoint, then the breakpoint termination array data is determined as breakpoint array data. If the formation data does not include the breakpoint start formation data and does not include the breakpoint end formation data, then the target formation data corresponding to the target distance value that has a distance adjacency relationship with the curve start breakpoint is determined to be the breakpoint formation data.
6. The method for determining the position of group animation according to claim 2, characterized in that, The step of determining the target breakpoint pattern data corresponding to the distance of the breakpoint on the group motion curve based on the breakpoint pattern data, the first tangent direction matrix, and the second tangent direction matrix includes: Based on the first tangent direction matrix and the breakpoint pattern data, the world coordinate position of the first target is determined. Based on the first target world coordinate position and the first inverse matrix, the target breakpoint pattern data corresponding to the distance of the breakpoint on the group motion curve is determined; the first inverse matrix is the inverse of the second tangent direction matrix; or Based on the second tangent direction matrix and the breakpoint pattern data, the world coordinate position of the second target is determined. Based on the second target world coordinate position and the second inverse matrix, the target breakpoint pattern data corresponding to the distance of the breakpoint on the group motion curve is determined. The second inverse matrix is the inverse of the first tangent direction matrix.
7. The method for determining the position of group animation according to claim 1, characterized in that, Determining the sampling distance of the group motion curve based on the preset sampling distance interval and the different curve distances includes: Determine the current sampling distance, and based on the current sampling distance, determine the first curve distance and the second curve distance from the different curve distances; If the current sampling distance, the first curve distance, and the second curve distance satisfy the first sampling condition, then the current sampling distance is determined as the sampling distance of the group motion curve; If the current sampling distance, the first curve distance, and the second curve distance satisfy the second sampling condition, then the first curve distance and the current sampling distance are determined as the sampling distance of the group motion curve; Based on the current sampling distance and the preset sampling distance interval, a target sampling distance is determined. Based on the target sampling distance, a first curve distance and a second curve distance are determined among the different curve distances. The process is iterated until the sampling end condition is met.
8. The method for determining the position of group animation according to claim 1, characterized in that, Determining the target curve distance corresponding to the sampling distance among the different curve distances includes: If the sampling distance exists in the curve distance, then the curve distance is the target curve distance.
9. The method for determining the position of group animation according to claim 8, characterized in that, Based on the target formation data corresponding to the target curve distance, the positions of group elements in the group animation are determined, including: Determine the sampling array data corresponding to the target curve distance, and obtain the movement matrix of the sampling points in the group motion curve that correspond to the sampling distance; Based on the movement matrix and the sampling array data, the position of the group element in the group animation at the sampling point is determined.
10. The method for determining the position of group animation according to claim 1, characterized in that, Determining the target curve distance corresponding to the sampling distance among the different curve distances includes: If the sampling distance is not among the curve distances, the third curve distance and the fourth curve distance are determined from the different curve distances based on the sampling distance; The distance between the third curve and the distance between the fourth curve are determined as the target curve distance.
11. The method for determining the position of group animation according to claim 10, characterized in that, The step of determining the position of group elements in the group animation based on the target formation data corresponding to the target curve distance includes: The sampling ratio is determined based on the sampling distance, the third curve distance, and the fourth curve distance; Determine the first world coordinate position of the group element in the group animation at the distance of the third curve, and determine the second world coordinate position of the group element at the distance of the fourth curve; Determine the first world coordinate position as the first mapped curve point on the group motion curve, and determine the second world coordinate position as the second mapped curve point on the group motion curve; Based on the first world coordinate position and the first mapping curve point, determine the first offset value in the first direction, the second offset value in the second direction, and the distance of the fifth curve; Based on the second world coordinate position and the second mapping curve point, determine the third offset value in the first direction, the fourth offset value in the second direction, and the sixth curve distance; Based on the sampling ratio, the first world coordinate position, the first offset value, the second offset value, the fifth curve distance, the second world coordinate position, the third offset value, the fourth offset value, and the sixth curve distance, the position of the group element in the group animation at the sampling point is determined; the sampling point corresponds to the sampling distance.
12. The method for determining the position of group animation according to claim 11, characterized in that, Determining the first world coordinate position as the first mapped curve point on the group motion curve includes: Determine the distance matrix data of the group elements in the group animation at the distance of the third curve, and determine the first component of the distance matrix data; If the first component is greater than a preset value, a first segmented curve is determined in the group motion curve; the first segmented curve includes a target segmented curve and the next segmented curve that is adjacent to the target segmented curve; Determine the first mapped curve point on the first piecewise curve where the first world coordinate position is located; If the first component is less than or equal to the preset value, a second segmented curve is determined in the group motion curve; the second segmented curve includes the target segmented curve and the previous segmented curve that is adjacent to the target segmented curve; Determine the first mapping curve point on the second piecewise curve where the first world coordinate position is located.
13. The method for determining the position of group animation according to claim 11, characterized in that, The step of determining the first offset value in the first direction, the second offset value in the second direction, and the distance to the fifth curve based on the first world coordinate position and the first mapped curve point includes: The first displacement vector is determined based on the first world coordinate position and the first mapping curve point; The first displacement vector is determined by its first offset value, second offset value, and tangent offset value in the first direction, the second direction, and the tangent direction, respectively. The mapping distance corresponding to the first mapping curve point is determined on the group motion curve, and the distance of the fifth curve is determined based on the mapping distance and the tangent offset value.
14. The method for determining the position of group animation according to claim 11, characterized in that, The step of determining the position of the group element in the group animation at the sampling point based on the sampling ratio, the first world coordinate position, the first offset value, the second offset value, the fifth curve distance, the second world coordinate position, the third offset value, the fourth offset value, and the sixth curve distance includes: Interpolation calculations are performed on the distance of the fifth curve, the distance of the sixth curve, and the sampling ratio to obtain the interpolation calculation result. The first target breakpoint mark and the second target breakpoint mark corresponding to the sampling distance are determined in the breakpoint mark. Based on the interpolation calculation results, the size relationship between the first target breakpoint marker and the second target breakpoint marker, the tangent interpolation result of the group motion curve in the tangent direction is determined; Based on the first offset value, the third offset value, and the sampling ratio, a first-direction interpolation result is obtained; based on the second offset value, the fourth offset value, and the sampling ratio, a second-direction interpolation result is obtained. The interpolation calculation results are determined by first interpolation vectors and second interpolation vectors in the first and second directions, respectively. Based on the tangent interpolation result, the first interpolation vector, the first direction interpolation result, the second interpolation vector, and the second direction interpolation result, the position of the group element in the group animation at the sampling point is determined.
15. The method for determining the position of group animation according to claim 14, characterized in that, The step of determining the tangent interpolation result of the group motion curve in the tangent direction based on the interpolation calculation result, the size relationship between the first target breakpoint marker and the second target breakpoint marker includes: If the interpolation result is less than the first target breakpoint marker, the tangent interpolation result of the group motion curve in the tangent direction is determined based on the first world coordinate position, the tangent of the first sampling point, the interpolation result, and the first target breakpoint marker; the first sampling point corresponds to the distance of the third curve; If the interpolation result is greater than the second target breakpoint marker, the tangent interpolation result is determined based on the second world coordinate position, the tangent of the second sampling point, the interpolation result, and the second target breakpoint marker; the second sampling point corresponds to the distance of the fourth curve. If the interpolation calculation result is greater than or equal to the first target breakpoint mark and less than or equal to the second target breakpoint mark, the interpolation curve point corresponding to the interpolation calculation result is determined in the group motion curve, and the sampling result at the interpolation curve point is determined as the tangent interpolation result.
16. The method for determining the position of group animation according to claim 1, characterized in that, After determining the position of the group element in the group animation, the method further includes: Based on the position of each group element in the group animation, generate an element motion curve corresponding to each group element; Obtain the curve distances of group elements, and determine the first element distance and the second element distance corresponding to the curve distances of the group elements from the different curve distances; Based on the first distance and the second distance of the element, the third distance and the fourth distance of the element are determined in the element motion curve; The element distance percentage is determined based on the first element distance, the second element distance, and the element curve distance. Based on the element distance ratio, the element third distance, and the element fourth distance, the target distance of the group elements on the element motion curve is obtained; The world coordinate position corresponding to the target distance is the movement position of the group element at the group element curve distance.
17. A device for determining the position of a group animation, characterized in that, The device includes: The acquisition module is configured to acquire the group motion curve corresponding to the group animation and acquire the formation data corresponding to the group motion curve; the formation data corresponds to the distances of different curves on the group motion curve. The sampling module is configured to determine the sampling distance of the group motion curve based on a preset sampling distance interval and the different curve distances; The position module is configured to determine the target curve distance corresponding to the sampling distance among the different curve distances, and to determine the position of the group elements in the group animation based on the target array data corresponding to the target curve distance.
18. An electronic device, characterized in that, include: processor; Memory for storing the executable instructions of the processor; The processor is configured to execute the group animation position determination method according to any one of claims 1-16 by executing the executable instructions.
19. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by the processor, it implements the group animation position determination method according to any one of claims 1-16.
Citation Information
Patent Citations
Snake-shaped robot path following planning method
CN108994836A
Method and device for generating animation curve, readable medium and electronic equipment
CN116309989A