Moiré animation generation method and apparatus, computer device, and storage medium
Patent Information
- Application Number
- CN202211400800.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-09
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2042-11-09
AI Technical Summary
摩尔纹动画可用于不同的艺术装置上,但是针对不同的艺术装置,摩尔纹动画的生成往往需要针对性的物理测试,导致摩尔纹动画生成效率低
[0023]The aforementioned moiré animation generation method, apparatus, computer equipment, and storage medium acquire a reference plane and a target object model; determine an animation display area on the reference plane based on the size information of the reference plane and the target object model; generate scattering patterns with equal central angles based on the reference point of the reference plane, and divide the animation display area into multiple first unit sectors according to the patterns; divide the side surface of the target object model into multiple second unit sectors according to the size of the first unit sectors; acquire animation frame images, and generate moiré animation materials corresponding to each first unit sector in the animation display area based on the animation frame images; generate animation material reflection stripes in the second unit sectors according to the number of animation frame images; wherein, the animation material reflection stripes are used to reflect the moiré animation materials in the first unit sectors on the reference plane when the target object model rotates based on the reference point to generate moiré animation. By using the size information of the reference plane and the target object model, the animation frame image is adapted to be converted into moiré animation material corresponding to each first unit sector on the reference plane. At the same time, for the size of the first unit sector on the reference plane, corresponding animation material reflection stripes are generated on the target object model to ensure the success rate of subsequent moiré animation generation. Finally, the target object model is controlled to rotate based on the reference point so that the moiré animation material on the reference plane is reflected by the animation material reflection stripes. This achieves automated construction of moiré animation effects, avoiding the need for repeated adjustments and tests of the moiré animation material and the animation material reflection stripes when the reference plane or the target object model changes. It can flexibly realize moiré animation effects on any target object model, improving the efficiency of moiré animation generation.
Smart Images

Figure CN115861489B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, specifically to a method, apparatus, computer device, and computer-readable storage medium (hereinafter referred to as storage medium) for generating moiré animation. Background Technology
[0002] Moiré animation, also known as raster animation, is created by sequentially piecing together a series of frame patterns in a stripe-like pattern. When a set of evenly spaced raster patterns slides across the image, one frame will appear at a certain moment while obscuring the others, displaying the content frame by frame. Based on the principle of "visual persistence," this creates the illusion of animation. Moiré animation can be used on various art installations; however, the generation of moiré animation often requires specific physical testing for different installations, resulting in low generation efficiency. Summary of the Invention
[0003] Therefore, it is necessary to provide a method, apparatus, computer device, and storage medium for generating moiré animations to address the aforementioned technical problems and improve the efficiency of moiré animation generation.
[0004] Firstly, this application provides a method for generating moiré pattern animations, the method comprising:
[0005] Obtain the reference plane and the target object model;
[0006] The animation display area is determined on the reference plane based on the size information of the reference plane and the size information of the target object model.
[0007] Based on the reference point of the reference plane, a scattering pattern with equal central angles is generated, and the animation display area is divided into multiple first unit sectors according to the pattern.
[0008] Based on the size of the first unit sector, the side surface of the target object model is divided into multiple second unit sectors;
[0009] Acquire animation frame images, and generate moiré animation materials corresponding to each of the first unit sectors in the animation display area based on the animation frame images;
[0010] Animation material reflection stripes are generated in the second unit sector according to the number of animation frame images; wherein, the animation material reflection stripes are used to reflect the moiré animation material in the first unit sector on the reference plane to generate moiré animation when the target object model rotates based on the reference point.
[0011] Secondly, this application provides a moiré animation generation device, the device comprising:
[0012] The object determination module is used to obtain the reference plane and the target object model;
[0013] The display area determination module is used to determine the animation display area on the reference plane based on the size information of the reference plane and the size information of the target object model;
[0014] The reference sector determination module is used to generate scattering patterns with equal central angles based on the reference points of the reference plane, and to divide the animation display area into multiple first unit sectors according to the patterns.
[0015] The reflection sector determination module is used to divide the side surface of the target object model into multiple second unit sectors according to the size of the first unit sector;
[0016] An animation material acquisition module is used to acquire animation frame images and generate moiré animation materials corresponding to each of the first unit sectors in the animation display area based on the animation frame images;
[0017] The reflection area acquisition module is used to generate animation material reflection stripes in the second unit sector according to the number of animation frame images; wherein, the animation material reflection stripes are used to reflect the moiré animation material in the first unit sector on the reference plane to generate moiré animation when the target object model rotates based on the reference point.
[0018] Thirdly, this application also provides a computer device, which includes:
[0019] One or more processors;
[0020] Memory; and
[0021] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the moiré animation generation method.
[0022] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to execute the steps in the moiré animation generation method.
[0023] The aforementioned moiré animation generation method, apparatus, computer equipment, and storage medium acquire a reference plane and a target object model; determine an animation display area on the reference plane based on the size information of the reference plane and the target object model; generate scattering patterns with equal central angles based on the reference point of the reference plane, and divide the animation display area into multiple first unit sectors according to the patterns; divide the side surface of the target object model into multiple second unit sectors according to the size of the first unit sectors; acquire animation frame images, and generate moiré animation materials corresponding to each first unit sector in the animation display area based on the animation frame images; generate animation material reflection stripes in the second unit sectors according to the number of animation frame images; wherein, the animation material reflection stripes are used to reflect the moiré animation materials in the first unit sectors on the reference plane when the target object model rotates based on the reference point to generate moiré animation. By using the size information of the reference plane and the target object model, the animation frame image is adapted to be converted into moiré animation material corresponding to each first unit sector on the reference plane. At the same time, for the size of the first unit sector on the reference plane, corresponding animation material reflection stripes are generated on the target object model to ensure the success rate of subsequent moiré animation generation. Finally, the target object model is controlled to rotate based on the reference point so that the moiré animation material on the reference plane is reflected by the animation material reflection stripes. This achieves automated construction of moiré animation effects, avoiding the need for repeated adjustments and tests of the moiré animation material and the animation material reflection stripes when the reference plane or the target object model changes. It can flexibly realize moiré animation effects on any target object model, improving the efficiency of moiré animation generation. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a flowchart illustrating the moiré animation generation method in the embodiments of this application;
[0026] Figure 2A This is a schematic diagram of the reference plane and the target object model in an embodiment of this application;
[0027] Figure 2B This is another schematic diagram of the reference plane and the target object model in the embodiments of this application;
[0028] Figure 2C This is yet another schematic diagram of the reference plane and the target object model in the embodiments of this application;
[0029] Figure 3 This is a flowchart illustrating the second unit sector acquisition step in an embodiment of this application;
[0030] Figure 4 This is a flowchart illustrating the steps for obtaining moiré animation materials in an embodiment of this application;
[0031] Figure 5A This is a schematic diagram of the animation frame images in the embodiments of this application;
[0032] Figure 5B This is a schematic diagram of the animation frame image filling the animation display area in an embodiment of this application;
[0033] Figure 5C This is a schematic diagram of the moiré animation material in the embodiments of this application;
[0034] Figure 5D This is a schematic diagram of the side unfolded view of the target object model in the embodiments of this application;
[0035] Figure 6 This is a schematic diagram of the structure of the moiré animation generation device in the embodiments of this application;
[0036] Figure 7 This is a schematic diagram of the structure of the computer device in the embodiments of this application. Detailed Implementation
[0037] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0038] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0039] In the description of this application, the word "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0040] The moiré animation generation method provided in this application can run on a terminal device or a server. The terminal device can be a local terminal device. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0041] See Figure 1 This application provides a method for generating moiré pattern animations, mainly illustrating the application of this method to a server. The method includes steps S110 to S160, as follows:
[0042] Step S110: Obtain the reference plane and the target object model.
[0043] The target object model refers to the model of the target object to be displayed in the moiré animation. Specifically, it can be a 3D model of a physical object or a 3D model of a virtual object. More specifically, in one implementation, the target object model can be a physical object with shapes such as a cylinder or a frustum, or a 3D model corresponding to a cylinder or a frustum. The reference plane refers to the two-dimensional plane containing the target object model. It can be understood that the reference plane is used to record the animation image corresponding to the moiré animation, and the target object model is used to reflect the frame image recorded by the reference plane to generate the moiré animation.
[0044] Step S120: Determine the animation display area on the reference plane based on the size information of the reference plane and the size information of the target object model.
[0045] The animation display area refers to the area on the reference plane where the animation image corresponding to the moiré animation is drawn. Since the target object model will cover a part of the reference plane when it is placed on the reference plane, the animation display area cannot be set on the covered part of the reference plane.
[0046] After obtaining the size information of the reference plane and the size information of the target object model, the size information of the contact surface between the target object model and the reference plane can be obtained from the size information of the target object model to determine the covered area of the reference plane, and then the animation display area can be determined in the area outside the covered area of the reference plane.
[0047] Furthermore, when the reference plane is a circular plane and the target object model is equivalent to a cylindrical model or a frustum model, in one embodiment, the step of determining the animation display area on the reference plane based on the size information of the reference plane and the size information of the target object model may specifically include: obtaining a target annular region in the reference plane based on the radius value of the reference plane and the radius value of the bottom surface of the target object model; and determining the animation display area in the target annular region.
[0048] The bottom surface of the target object model refers to the surface of the target object model that contacts the reference plane; the target annular region is the area in the reference plane not covered by the target object model. Specifically, the center point of the reference plane can be taken as the base point of the target object model's rotation on the reference plane. Based on the radius of the reference plane and the radius of the bottom surface of the target object model, the target annular region outside the bottom surface of the target object model can be determined on the reference plane. The entire target annular region can then be designated as the animation display area, or a portion of the entire target annular region can be selected as the animation display area. See also... Figure 2A , Figure 2A The radius value of the circular plane is shown in D1, and the radius value of the bottom surface of the target object model is shown in D2. The animation display area can be determined in the annular region 210.
[0049] Furthermore, the base point for rotating the target object model on the reference plane can be any point other than the center point of the reference plane. The step of determining the animation display area on the reference plane based on the dimensions of the reference plane and the target object model can specifically include: obtaining a first region on the reference plane where the bottom surface of the target object model is located, based on the radius value of the reference plane and the radius value of the bottom surface of the target object model; and determining the animation display area in a second region on the reference plane other than the first region. For example, see... Figure 2B , Figure 2B The center point of the reference plane is point A, the radius of the reference plane is shown in D1, and the radius of the bottom surface of the target object model is shown in D2. The animation display area can be determined in region 220.
[0050] Step S130: Generate scattering patterns with equal central angles based on the reference points of the reference plane, and divide the animation display area into multiple first unit sectors according to the patterns.
[0051] Here, the reference point can refer to the base point on which the target object model rotates on the reference plane; specifically, the reference point can be the center point of the reference plane, for example, when the reference plane is a circular plane, the reference point can be the center of the circular plane; or it can be a point that is a certain distance away from the center point of the reference plane. After determining the reference point to the reference plane, textures with equal central angles can be generated based on the reference point, and the animation display area can be divided into multiple first unit sectors based on these textures.
[0052] See Figure 2C Taking the reference plane as equivalent to a circular plane and the target object model as equivalent to a cylindrical model or a frustum model as an example, the reference point can be the center point of the reference plane. Based on the reference point, scattering patterns can be generated on the reference plane. The central angle values between adjacent patterns are equal. The animation display area is divided into multiple sectors.
[0053] Step S140: Divide the side surface of the target object model into multiple second unit sectors according to the size of the first unit sector.
[0054] The size of the first unit sector includes, but is not limited to, the central angle, outer arc length, inner arc length, first width between the two ends of the outer arc, and second width between the two ends of the inner arc. After obtaining the first unit sector, a second unit sector with a matching size can be obtained on the side surface of the target object model based on the size of the first unit sector; it can be understood that the second unit sector can be equivalent to the area obtained by reflecting the first unit sector onto the side surface of the target object model.
[0055] In one embodiment, when the target object model is equivalent to a cylindrical model, the step of dividing the side surface of the target object model into multiple second unit sectors according to the size of the first unit sector includes: obtaining the inner arc length of the first unit sector; determining multiple unit regions on the side surface of the target object model with a width equal to the inner arc length and a height equal to the height of the target object model, to obtain the second unit sectors on the outer surface of the target object model.
[0056] The inner arc length of the first unit sector refers to the arc length of the inner arc in the first unit sector. Its value can also be the value of the corresponding central angle of the first unit sector in the circumference of the cylindrical model.
[0057] Specifically, when the target object model is a cylindrical model, the inner arc length of the first unit sector can be determined as the width of the corresponding second unit sector on the outer surface of the cylindrical model, thus obtaining the width of the moiré pattern on the outer surface of the target object model. After obtaining the inner arc length of the first unit sector, the side surface of the target object model can be divided into multiple unit regions with a width equal to the inner arc length of the first unit sector and a height equal to the height of the target object model; these unit regions are the second unit sectors. When the target object model is equivalent to a cylindrical model, multiple second unit sectors with a width equal to the inner arc length of the first unit sector are generated on the side surface of the target object model, ensuring that the size of the second unit sector matches that of the first unit sector, thus improving the imaging effect of the subsequent moiré animation.
[0058] Furthermore, when the target object model is equivalent to a frustum model; such as Figure 3 As shown, the steps of dividing the side surface of the target object model into multiple second unit sectors based on the size of the first unit sector include:
[0059] Step S310: Obtain the first width value and the second width value of the first sector.
[0060] The first width value refers to the top width corresponding to the first unit sector, specifically the straight-line distance between the two endpoints of the upper arc of the first unit sector; the second width value refers to the bottom width corresponding to the first unit sector, specifically the straight-line distance between the two endpoints of the lower arc of the first unit sector. See also Figure 2C , Figure 2C The first width value is shown in G1, and the second width value is shown in G2. After obtaining the first and second width values of the first unit sector, multiple second unit sectors with the upper width of the first width value and the lower width of the second width value can be generated on the side surface of the target object model to ensure that the size of the second unit sector is adapted to the size of the first unit sector, thus ensuring the moiré animation effect.
[0061] Step S320: Obtain the equivalent plane of the side surface of the target object model based on the size information of the target object model, and construct a trapezoidal region on the equivalent plane with an upper width equal to the first width value and a lower width equal to the second width value.
[0062] The equivalent plane of the side surface of the target object model can be the planar space after the side surface of the target object model is unfolded; specifically, when the target object model is equivalent to a frustum model, the equivalent plane of the side surface of the target object model is a sector.
[0063] After obtaining the equivalent plane of the target object model, the center line of the equivalent plane can be used as the center line of the trapezoidal region to construct a trapezoidal region with an upper width equal to the first width value and a lower width equal to the second width value. It can be understood that the trapezoidal region is an isosceles trapezoid, and the center line of the equivalent plane can also be regarded as the height of the trapezoidal region. The trapezoidal region is adapted to the size of the first unit sector.
[0064] Step S330: Calculate the central angle value of the sector corresponding to the first unit sector based on the trapezoidal region.
[0065] After obtaining the trapezoidal region, an isosceles triangle can be constructed using the longer base of the trapezoidal region as the base and through the legs of the trapezoidal region. The angle value of the vertex angle formed by the two legs of the isosceles triangle is the central angle value of the sector corresponding to the first unit sector.
[0066] Step S340: Divide the outer surface of the target object model into multiple second unit sectors based on the central angle value.
[0067] After determining the central angle value, the outer surface of the target object model can be divided into multiple second unit sectors with a central angle equal to that value. The equivalent plane of the target object model's side surface is obtained using the model's dimensions. Then, the first and second width values of the first unit sector are substituted into the midline of the equivalent plane to obtain a trapezoidal region with an upper width equal to the first width and a lower width equal to the second width. The apex angle of this trapezoidal region is then obtained, and using this apex angle as the central angle value, the outer surface of the target object model is divided into multiple second unit sectors. This effectively ensures that the second unit sectors match the first unit sectors in size, guaranteeing the subsequent moiré animation effect.
[0068] Step S150: Obtain animation frame images and generate moiré animation materials corresponding to each first unit sector in the animation display area based on the animation frame images.
[0069] The animation frame images can be one or more. After obtaining the animation frame images, the first unit sector corresponding to each animation frame image can be determined from the animation display area. Then, the region image of the animation frame image in the corresponding first unit sector can be obtained. Finally, the region images in all the first unit sectors are stitched together to obtain the moiré animation material.
[0070] Specifically, in one embodiment, such as Figure 4As shown, the steps of acquiring animation frame images and generating moiré animation materials corresponding to each first unit sector in the animation display area based on the animation frame images include: Step S410, grouping the first unit sectors in the animation display area according to the number of animation frame images to obtain sector groups; Step S420, for any sector group, determining the animation frame image corresponding to each first unit sector according to the sorting of each first unit sector in the sector group; Step S430, cropping the animation frame image corresponding to each first unit sector based on the position information of each first unit sector to obtain the moiré animation material of each first unit sector.
[0071] In the display of moiré animation, each frame of the animation is stored as stripes within the moiré animation material. As a set of evenly spaced grid patterns slide across the moiré animation material, one frame will be displayed at a certain moment, obscuring the others. This sequential display of animation frames, based on the principle of "visual persistence," creates the illusion of animation. Therefore, after acquiring the animation frame images, the first unit sector in the animation display area is grouped according to the number of frames, resulting in sector groups. For any sector group, the first first unit sector in the group is used as a display area for the first animation frame, the second first unit sector as a display area for the second animation frame, and so on, thus determining the animation frame corresponding to each first unit sector.
[0072] After determining the animation frame image corresponding to each first unit sector, each first unit sector is the display area of its corresponding animation frame image in the animation display area. Then, based on the position information of each first unit sector, the animation frame image corresponding to each first unit sector can be cropped to obtain the regional image of the animation frame image in its display area (i.e., the first unit sector corresponding to the animation frame image). Finally, the moiré animation material of each first unit sector is obtained by using the regional images of all first unit sectors.
[0073] Furthermore, considering that the animation frame image will undergo mirror flipping when reflected onto the target object model from the reference plane, before the step of cropping the animation frame image corresponding to each first unit sector based on the position information of each first unit sector to obtain the moiré animation material of each first unit sector, the method further includes: horizontally flipping the animation frame image and performing arc deformation processing on the animation frame image using the reference point of the reference plane as the base point in conjunction with the animation display area. By horizontally flipping the animation frame image, the user can view the correct animation frame image when it is reflected onto the surface of the target object model; in addition, after horizontally flipping the animation frame image, arc deformation processing can be performed on the animation frame image based on the reference point of the reference plane as the base point, so that when the animation frame image fills the animation display area, it can cover the entire animation display area, that is, cover all the first unit sectors, to ensure that the animation frame image adapts to the animation display area.
[0074] Step S160: Generate animation material reflection stripes in the second unit sector according to the number of animation frame images; wherein, the animation material reflection stripes are used to reflect the moiré animation material in the first unit sector on the reference plane to generate moiré animation when the target object model rotates based on the reference point.
[0075] In this context, the animated material reflection stripes refer to the areas on the outer surface of the target object model used to reflect the moiré animation material on the reference plane, equivalent to the grid pattern in moiré animation. It can be understood that within each second-unit sector on the outer surface of the target object model, the second-unit sector with generated animated material reflection stripes serves as the visible window of the moiré animation material, while the second-unit sector without generated animated material reflection stripes serves as the overlay window of the moiré animation material.
[0076] In one embodiment, the step of generating animation material reflection stripes in a second unit sector based on the number of animation frame images includes: determining the interval frame number of the animation material reflection stripes based on the number of animation frame images; using any second unit sector as the starting frame, determining a second unit sector as the target unit sector every interval frame number; and generating animation material reflection stripes based on the target unit sector.
[0077] Specifically, assuming the number of animation frame images is K (i.e. the number of frames in the complete animation is K), an animation material reflection stripe is set every K second unit sectors, so that when the target object model rotates based on the reference point, each second unit sector rotation can present an animation frame image. Through continuous rotation, a moiré animation effect can be achieved.
[0078] In the above moiré animation generation method, a reference plane and a target object model are obtained; an animation display area is determined on the reference plane based on the size information of the reference plane and the target object model; a scattering pattern with equal central angles is generated based on the reference point of the reference plane, and the animation display area is divided into multiple first unit sectors according to the pattern; the side surface of the target object model is divided into multiple second unit sectors according to the size of the first unit sectors; animation frame images are obtained, and moiré animation materials corresponding to each first unit sector are generated in the animation display area based on the animation frame images; and animation material reflection stripes are generated in the second unit sectors according to the number of animation frame images. The animation material reflection stripes are used to reflect the moiré animation materials in the first unit sectors on the reference plane when the target object model rotates based on the reference point to generate the moiré animation. By using the size information of the reference plane and the target object model, the animation frame image is adapted to be converted into moiré animation material corresponding to each first unit sector on the reference plane. At the same time, for the size of the first unit sector on the reference plane, corresponding animation material reflection stripes are generated on the target object model to ensure the success rate of subsequent moiré animation generation. Finally, the target object model is controlled to rotate based on the reference point so that the moiré animation material on the reference plane is reflected by the animation material reflection stripes. This achieves automated construction of moiré animation effects, avoiding the need for repeated adjustments and tests of the moiré animation material and the animation material reflection stripes when the reference plane or the target object model changes. It can flexibly realize moiré animation effects on any target object model, improving the efficiency of moiré animation construction.
[0079] The following section provides a further explanation of the above moiré animation generation method using specific application scenarios; the moiré animation generation method includes:
[0080] Step 1: Establish the reference section;
[0081] Specifically, a circular plane is constructed, which serves as the reference plane for subsequently providing the reflection pattern; this is called the reference section.
[0082] Step two: Creating the latitude and longitude lines of the reference section;
[0083] Draw the latitude and longitude lines on the reference part; specifically, make the longitude lines with equal central angles on the reference part. The rule for the value of the central angle angle is: divide the circle into 24 sectors, that is, 15 degrees per sector. Divide each sector equally according to the size of the device to be made. Taking the mug (i.e. the reflector) as an example, divide each sector into 12 grids, and the central angle angle between adjacent longitude lines is 1.25 degrees. The latitude lines record the diameter D1 of the reference part and the diameter D2 of the bottom of the reflector.
[0084] Based on the warp lines of the scattering device, the reference part is divided into multiple first unit sectors, and each first unit sector serves as the unit stripe of the sequence frame of the moiré animation.
[0085] Step 3, production of the animation pattern of the reference part;
[0086] Through the reference of the warp and weft lines of the reference part, define the animation display area for displaying the animation frame images; at the same time, obtain the animation frame images, horizontally flip the animation frame images, and perform arc deformation on each animation frame image with the center of the reference part as the base point in combination with the animation display area to obtain the preprocessed animation frame images, and fill the preprocessed animation frame images into the animation display area.
[0087] See Figure 5A , the animation frame images include the text pictures "society", "awesome", "make friends", and "be friends"; after obtaining the animation frame images, horizontally flip the animation frame images, and perform arc deformation on each animation frame image with the center of the reference part as the base point in combination with the animation display area to obtain the animation frame images as shown on the Figure 5A right side. After obtaining the preprocessed animation frame images, the animation frame images can be filled into the animation display area, as shown in Figure 5B .
[0088] After obtaining the animation frame images, based on the number of frames of the animation frame images, group the first unit sectors in the animation display area to obtain sector groups. For any sector group, use the first first unit sector in the sector group as a display area for the first animation frame image, use the second first unit sector in the sector group as a display area for the second animation frame image, and so on, to determine the animation frame images corresponding to each first unit sector; after filling the animation frame images into the animation display area, intercept the animation frame images corresponding to each first unit sector based on the position information of each first unit sector in the animation display area to obtain the moiré animation materials of each first unit sector.
[0089] Continuing with the example where the animated frame image includes the text pictures "social", "awesome", "interact", and "make friends", in the animated display area, every 4 first unit sectors are divided into a sector group; in each sector group, the first first unit sector in the sector group is used as a display area for the text picture "social", the second first unit sector in the sector group is used as a display area for the text picture "awesome", the first first unit sector in the sector group is used as a display area for the text picture "interact", and the first first unit sector in the sector group is used as a display area for the text picture "make friends". After determining the display areas of the animated frame image, that is, after obtaining the animated frame images corresponding to each first unit sector, intercept the animated frame images corresponding to each first unit sector based on the position information of each first unit sector in the animated display area to obtain the moiré animation materials for each first unit sector. For example, the moiré animation materials are like Figure 5C the moiré animation materials shown
[0090] Step Four, establish the reflection part;
[0091] Define the object part that needs to present the reflection pattern as the reflection part. The reflection part takes a conical shape as an example, but is not limited to cylinders, frustums, etc.
[0092] Step Five, produce the display area of the reflection part;
[0093] Taking the reflection part as a frustum as an example, based on the top diameter and the bottom diameter of the reflection part, obtain the upper perimeter L1 and the lower perimeter L2 of the reflection part respectively; furthermore, based on the upper perimeter L1 and the lower perimeter L2 of the reflection part, construct the lateral development view of the reflection part; for example, set the two endpoints of the upper perimeter of the reflection part as point a and point b, set the two endpoints of the lower perimeter as point c and point d, connect point a and point c and extend, connect point b and point d and extend, generate an included angle between the line segment ac and the line segment bd, take this included angle as the central angle, establish an arc connecting point a and point b, establish an arc connecting point c and point d, and then the abcd sector can be obtained, and this area is the lateral development view of the side of the reflection part, as Figure 5D shown
[0094] Obtain the linear distance value between the two endpoints of the upper arc of the first unit sector of the reference part to get G1, and obtain the linear distance value between the two endpoints of the lower arc of the first unit sector of the reference part to get G2; substitute G1 and G2 into the center position of the lateral development view to construct the second unit sector. The second unit sector is like Figure 5DIn region 510, the central angle of the second unit sector is obtained; it can be understood that the second unit sector is the new stripe generated after the first unit sector on the base part is reflected onto the reflective part. The central angle of the second unit sector is the central angle angle of the unit stripe required for the moiré animation playback, that is, the stripe size of the unit stripe of the animation material reflected on the reflective part. The second unit sector is defined as X.
[0095] According to the principle of moiré animation, the second unit sector X is used as the content image space of the current frame during the playback of moiré animation. Assuming that the number of animation frame images is K (that is, the number of frames of the complete animation is K), the (K+1) second unit sectors are set as a unit group. The first second unit sector in one unit group is determined as the animation material reflection stripe X, and the remaining second unit sectors are the occlusion area K. In other words, the animation material reflection stripe X is the pattern display area, and the occlusion area K is the pattern occlusion area.
[0096] Step six: Generating moiré animation;
[0097] The reflector is placed on the center of the base section. The moiré animation material of each first unit sector of the base section can be reflected onto the reflective stripe X of the animation material. By controlling the reflector to slowly rotate around the base point on the base section, a moiré animation effect can be produced.
[0098] To better implement the moiré animation generation method provided in the embodiments of this application, based on the moiré animation generation method proposed in the embodiments of this application, this application also provides a moiré animation generation device, such as... Figure 6 As shown, the moiré animation generation device 600 includes:
[0099] The object determination module 610 is used to obtain the reference plane and the target object model;
[0100] The display area determination module 620 is used to determine the animation display area on the reference plane based on the size information of the reference plane and the size information of the target object model;
[0101] The reference sector determination module 630 is used to generate scattering patterns with equal central angles based on the reference points of the reference plane, and divide the animation display area into multiple first unit sectors according to the patterns.
[0102] The reflection sector determination module 640 is used to divide the side surface of the target object model into multiple second unit sectors according to the size of the first unit sector;
[0103] The animation material acquisition module 650 is used to acquire animation frame images and generate moiré animation materials corresponding to each first unit sector in the animation display area based on the animation frame images.
[0104] The reflection area acquisition module 660 is used to generate animation material reflection stripes in the second unit sector according to the number of animation frame images; wherein, the animation material reflection stripes are used to reflect the moiré animation material in the first unit sector on the reference plane to generate moiré animation when the target object model rotates based on the reference point.
[0105] In some embodiments of this application, the target object model is equivalent to a cylindrical model; the reflection sector determination module is specifically used to obtain the inner arc length of the first unit sector; and to determine multiple unit regions with a width equal to the inner arc length and a height equal to the height of the target object model on the side surface of the target object model, thereby obtaining the second unit sector on the outer surface of the target object model.
[0106] In some embodiments of this application, the target object model is equivalent to a frustum model; the reflection sector determination module is specifically used to obtain the first width value and the second width value of the first sector; obtain the equivalent plane of the side surface of the target object model according to the size information of the target object model, and construct a trapezoidal region on the equivalent plane with an upper width equal to the first width value and a lower width equal to the second width value; calculate the central angle value of the sector corresponding to the first unit sector according to the trapezoidal region; and divide the outer surface of the target object model into multiple second unit sectors based on the central angle value.
[0107] In some embodiments of this application, the animation material acquisition module is used to group the first unit sector in the animation display area according to the number of animation frame images to obtain a sector group; for any sector group, determine the animation frame image corresponding to each first unit sector according to the sorting of each first unit sector in the sector group; and crop the animation frame image corresponding to each first unit sector based on the position information of each first unit sector to obtain the moiré animation material of each first unit sector.
[0108] In some embodiments of this application, the animation material acquisition module is further used to perform horizontal flipping processing on the animation frame image, and to perform arc deformation processing on the animation frame image in combination with the reference point of the reference plane and the animation display area.
[0109] In some embodiments of this application, the reflection area acquisition module is used to determine the interval frame number of the animation material reflection stripes based on the number of animation frame images; take any second unit sector as the starting frame, and determine a second unit sector as the target unit sector every interval frame number; and generate the animation material reflection stripes based on the target unit sector.
[0110] In some embodiments of this application, the reference plane is equivalent to a circular plane, and the target object model is equivalent to a cylindrical model or a frustum model; the display area determination module is used to obtain a target annular region in the reference plane based on the radius value of the reference plane and the radius value of the bottom surface of the target object model; and to determine the animation display area in the target annular region.
[0111] In some embodiments of this application, the moiré animation generation device 600 can be implemented as a computer program, which can be implemented in, for example... Figure 7 The device operates on the computer shown. The computer's memory can store the various program modules that make up the moiré animation generation device 600, for example, Figure 6 The illustrated modules are object determination module 610, display area determination module 620, reference sector determination module 630, reflection sector determination module 640, animation material acquisition module 650, and reflection area acquisition module 660. The computer program, comprised of these modules, causes the processor to execute the steps in the moiré animation generation methods of the various embodiments of this application described in this specification.
[0112] For example, Figure 7 The computer equipment shown can be used as follows Figure 6 The object determination module 610 in the illustrated moiré animation generation device 600 executes step S110. The computer device can execute step S120 via the display area determination module 620. The computer device can execute step S130 via the reference sector determination module 630. The computer device can execute step S140 via the reflection sector determination module 640. The computer device can execute step S150 via the animation material acquisition module 650. The computer device can execute step S160 via the reflection area acquisition module 660. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communication with external computer devices via a network connection. When the computer program is executed by the processor, it implements a moiré animation generation method.
[0113] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0114] In some embodiments of this application, a computer device is provided, including one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor in the following steps:
[0115] Obtain the reference plane and the target object model;
[0116] The animation display area is determined on the reference plane based on the size information of the reference plane and the size information of the target object model;
[0117] Based on the reference point of the reference plane, a scattering pattern with equal central angles is generated, and the animation display area is divided into multiple first unit sectors according to the pattern.
[0118] Based on the size of the first unit sector, the side surface of the target object model is divided into multiple second unit sectors;
[0119] Acquire animation frame images, and generate moiré animation materials corresponding to each first unit sector in the animation display area based on the animation frame images;
[0120] Animation material reflection stripes are generated in the second unit sector based on the number of animation frame images; wherein, the animation material reflection stripes are used to reflect the moiré animation material in the first unit sector on the reference plane to generate moiré animation when the target object model rotates based on the reference point.
[0121] In some embodiments of this application, the target object model is equivalent to a cylindrical model; when the processor executes the computer program, it also implements the following steps: obtaining the inner arc length of the first unit sector; determining multiple unit regions on the side surface of the target object model with a width equal to the inner arc length and a height equal to the height of the target object model, to obtain the second unit sector on the outer surface of the target object model.
[0122] In some embodiments of this application, the target object model is equivalent to a frustum model; when the processor executes the computer program, it also performs the following steps: obtaining the first width value and the second width value of the first sector; obtaining the equivalent plane of the side surface of the target object model according to the size information of the target object model, and constructing a trapezoidal region on the equivalent plane with an upper width equal to the first width value and a lower width equal to the second width value; calculating the central angle value of the sector corresponding to the first unit sector according to the trapezoidal region; and dividing the outer surface of the target object model into multiple second unit sectors based on the central angle value.
[0123] In some embodiments of this application, when the processor executes the computer program, it further implements the following steps: grouping the first unit sector in the animation display area according to the number of animation frame images to obtain a sector group; for any sector group, determining the animation frame image corresponding to each first unit sector according to the sorting of each first unit sector in the sector group; and cropping the animation frame image corresponding to each first unit sector based on the position information of each first unit sector to obtain the moiré animation material of each first unit sector.
[0124] In some embodiments of this application, when the processor executes the computer program, it also performs the following steps: horizontally flipping the animation frame image, and using the reference point of the reference plane as the base point and combining the animation display area to perform arc deformation processing on the animation frame image.
[0125] In some embodiments of this application, when the processor executes the computer program, it also performs the following steps: determining the interval frame number of the animation material reflection stripes based on the number of animation frame images; taking any second unit sector as the starting frame, determining a second unit sector as the target unit sector every interval frame number; and generating the animation material reflection stripes based on the target unit sector.
[0126] In some embodiments of this application, the reference plane is equivalent to a circular plane, and the target object model is equivalent to a cylindrical model or a frustum model; when the processor executes the computer program, it also implements the following steps: based on the radius value of the reference plane and the radius value of the bottom surface of the target object model, obtain the target annular region in the reference plane; and determine the animation display area in the target annular region.
[0127] In some embodiments of this application, a computer-readable storage medium is provided, storing a computer program that is loaded by a processor, causing the processor to perform the following steps:
[0128] Obtain the reference plane and the target object model;
[0129] The animation display area is determined on the reference plane based on the size information of the reference plane and the size information of the target object model;
[0130] Based on the reference point of the reference plane, a scattering pattern with equal central angles is generated, and the animation display area is divided into multiple first unit sectors according to the pattern.
[0131] Based on the size of the first unit sector, the side surface of the target object model is divided into multiple second unit sectors;
[0132] Acquire animation frame images, and generate moiré animation materials corresponding to each first unit sector in the animation display area based on the animation frame images;
[0133] Animation material reflection stripes are generated in the second unit sector based on the number of animation frame images; wherein, the animation material reflection stripes are used to reflect the moiré animation material in the first unit sector on the reference plane to generate moiré animation when the target object model rotates based on the reference point.
[0134] In some embodiments of this application, the target object model is equivalent to a cylindrical model; when the computer program is executed by the processor, it also performs the following steps: obtaining the inner arc length of the first unit sector; determining multiple unit regions on the side surface of the target object model with a width equal to the inner arc length and a height equal to the height of the target object model, to obtain the second unit sector on the outer surface of the target object model.
[0135] In some embodiments of this application, the target object model is equivalent to a frustum model; when the computer program is executed by the processor, it further implements the following steps: obtaining the first width value and the second width value of the first sector; obtaining the equivalent plane of the side surface of the target object model according to the size information of the target object model, and constructing a trapezoidal region on the equivalent plane with an upper width equal to the first width value and a lower width equal to the second width value; calculating the central angle value of the sector corresponding to the first unit sector according to the trapezoidal region; and dividing the outer surface of the target object model into multiple second unit sectors based on the central angle value.
[0136] In some embodiments of this application, when the computer program is executed by the processor, it further implements the following steps: grouping the first unit sector in the animation display area according to the number of animation frame images to obtain a sector group; for any sector group, determining the animation frame image corresponding to each first unit sector according to the sorting of each first unit sector in the sector group; and cropping the animation frame image corresponding to each first unit sector based on the position information of each first unit sector to obtain the moiré animation material of each first unit sector.
[0137] In some embodiments of this application, when the computer program is executed by the processor, it also performs the following steps: horizontally flipping the animation frame image, and performing arc deformation processing on the animation frame image with the reference point of the reference plane as the base point and the animation display area.
[0138] In some embodiments of this application, when the computer program is executed by the processor, it further implements the following steps: determining the interval frame number of the animation material reflection stripes based on the number of animation frame images; taking any second unit sector as the starting frame, determining a second unit sector as the target unit sector every interval frame number; and generating the animation material reflection stripes based on the target unit sector.
[0139] In some embodiments of this application, the reference plane is equivalent to a circular plane, and the target object model is equivalent to a cylindrical model or a frustum model; when the computer program is executed by the processor, it also performs the following steps: based on the radius value of the reference plane and the radius value of the bottom surface of the target object model, obtain the target annular region in the reference plane; and determine the animation display area in the target annular region.
[0140] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0141] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0142] The foregoing has provided a detailed description of a moiré animation generation method, apparatus, computer device, and storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for generating moiré pattern animation, characterized in that, The method includes: Obtain a reference plane and a target object model, wherein the reference plane is equivalent to a circular plane and the target object model is equivalent to a cylinder model or a frustum model; The animation display area is determined on the reference plane based on the size information of the reference plane and the size information of the target object model. Based on the reference point of the reference plane, a scattering pattern with equal central angles is generated, and the animation display area is divided into multiple first unit sectors according to the pattern. Based on the size of the first unit sector, the side surface of the target object model is divided into multiple second unit sectors; Acquire animation frame images, and generate moiré animation materials corresponding to each of the first unit sectors in the animation display area based on the animation frame images; Animation material reflection stripes are generated in the second unit sector according to the number of animation frame images; wherein, the animation material reflection stripes are used to reflect the moiré animation material in the first unit sector on the reference plane to generate moiré animation when the target object model rotates based on the reference point.
2. The method according to claim 1, characterized in that, The target object model is equivalent to a cylinder model; The step of dividing the side surface of the target object model into multiple second unit sectors based on the size of the first unit sector includes: Obtain the inner arc length of the first unit sector; Multiple unit regions with widths equal to the inner arc length and heights equal to the height of the target object model are defined on the side surface of the target object model to obtain a second unit sector on the outer surface of the target object model.
3. The method according to claim 1, characterized in that, The target object model is equivalent to a frustum model; The step of dividing the side surface of the target object model into multiple second unit sectors based on the size of the first unit sector includes: Obtain the first width value and the second width value of the first unit sector; Based on the size information of the target object model, obtain the equivalent plane of the side surface of the target object model, and construct a trapezoidal region on the equivalent plane with an upper width equal to the first width value and a lower width equal to the second width value; Calculate the central angle value of the sector corresponding to the first unit sector based on the trapezoidal region; The outer surface of the target object model is divided into multiple second unit sectors based on the central angle value.
4. The method according to claim 1, characterized in that, The step of acquiring animation frame images and generating moiré animation materials corresponding to each of the first unit sectors in the animation display area based on the animation frame images includes: The first unit sector in the animation display area is grouped according to the number of animation frame images to obtain sector groups; For any sector group, the animation frame image corresponding to each first unit sector is determined according to the sorting of each first unit sector within the sector group; Based on the position information of each first unit sector, the animation frame image corresponding to each first unit sector is extracted to obtain the moiré animation material of each first unit sector.
5. The method according to claim 4, characterized in that, Before the step of extracting the animation frame image corresponding to each first unit sector based on the position information of each first unit sector to obtain the moiré animation material of each first unit sector, the method further includes: The animation frame image is horizontally flipped, and the animation frame image is subjected to arc deformation processing based on the reference point of the reference plane and the animation display area.
6. The method according to claim 1, characterized in that, The step of generating animation material reflection stripes in the second unit sector based on the number of animation frame images includes: The interval frame number of the reflective stripes in the animation material is determined based on the number of animation frame images; Using any second unit sector as the starting frame, a second unit sector is determined as the target unit sector every interval of the specified interval frame number; Animation material reflection stripes are generated based on the target unit sector.
7. The method according to claim 1, characterized in that, The step of determining the animation display area on the reference plane based on the size information of the reference plane and the size information of the target object model includes: Based on the radius value of the reference plane and the radius value of the bottom surface of the target object model, the target annular region is obtained in the reference plane; The animation display area is determined within the target annular region.
8. A moiré pattern animation generation device, characterized in that, The device includes: The object determination module is used to obtain a reference plane and a target object model. The reference plane is equivalent to a circular plane, and the target object model is equivalent to a cylinder model or a frustum model. The display area determination module is used to determine the animation display area on the reference plane based on the size information of the reference plane and the size information of the target object model; The reference sector determination module is used to generate scattering patterns with equal central angles based on the reference points of the reference plane, and to divide the animation display area into multiple first unit sectors according to the patterns. The reflection sector determination module is used to divide the side surface of the target object model into multiple second unit sectors according to the size of the first unit sector; An animation material acquisition module is used to acquire animation frame images and generate moiré animation materials corresponding to each of the first unit sectors in the animation display area based on the animation frame images; The reflection area acquisition module is used to generate animation material reflection stripes in the second unit sector according to the number of animation frame images; wherein, the animation material reflection stripes are used to reflect the moiré animation material in the first unit sector on the reference plane to generate moiré animation when the target object model rotates based on the reference point.
9. A computer device, characterized in that, The computer device includes: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the moiré animation generation method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to perform the steps in the moiré animation generation method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Grating animation demonstration device and a method for manufacturing the same
CN107505718A
Method and system for generating loop animation
CN113888683A