Paper model display method and device

By pre-recording the position information in the paper flip animation data, dynamically updating the position of the paper model, solving the problem of high resource consumption in the prior art, and achieving efficient paper flip effect.

CN113920237BActive Publication Date: 2025-08-22NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111177152.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-09
Publication Date
2025-08-22
Estimated Expiration
2041-10-09

AI Technical Summary

Technical Problem

When simulating the paper turn effect in a three-dimensional interface, the prior art requires consuming a large amount of memory resources and computing resources, especially when multiple sheets of paper are flipped, resource consumption increases significantly.

Method used

By pre-made paper flip animation data, the position information of each frame of paper model is recorded, and the position of the paper model in the scene is determined based on the position information recorded in the frame, and the frame is updated with time to realize the flip effect of the paper model and reduce the real-time calculation of vertex position changes.

Benefits of technology

With fewer memory resources and computing resources, the paper flip effect is efficiently realized, reducing resource consumption and improving rendering efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113920237B_ABST
    Figure CN113920237B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a paper model display method and device, the method comprising: determining the frames corresponding to the paper model in preset paper flipping animation data, and determining the position information of the paper model based on the position information recorded in the frames; rendering the paper model in a preset scene based on the position information of the paper model, so that the paper model is displayed in the scene; updating the frames corresponding to the paper model in the paper flipping animation data over time, and determining the updated position information of the paper model based on the position information recorded in the updated frames, so that the paper model flips in the scene. By using the preset paper flipping animation data, the paper model can be made to correspond to the frames in the paper flipping animation data, thus achieving a paper flipping effect, while occupying less memory resources and computing resources and having high rendering efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of graphics processing technology, and in particular to a paper model display method and a paper model display device. Background Art

[0002] In the prior art, if you need to display the flipping effect of paper in a three-dimensional interface, you can usually simulate the position change and deformation effect of the paper during the flipping process by continuously calculating the vertex-by-vertex difference between multiple grids in the paper model. However, using this method to display the flipping effect of paper requires a large amount of memory resources and CPU computing resources. In particular, when the flipping effect of multiple sheets of paper is required at the same time, the memory resources and CPU computing resources will increase significantly. Summary of the Invention

[0003] In view of the above problems, embodiments of the present invention are proposed to provide a paper model display method and a paper model display device that overcome the above problems or at least partially solve the above problems.

[0004] In order to solve the above problems, an embodiment of the present invention discloses a paper model display method, comprising:

[0005] Determining frames corresponding to the paper models in preset paper flipping animation data, and determining position information of the paper models according to position information recorded in the frames;

[0006] Rendering the paper model in a preset scene based on the position information of the paper model, so that the paper model is displayed in the scene;

[0007] The frames corresponding to the paper model in the paper flipping animation data are updated over time, and the updated position information of the paper model is determined according to the position information recorded in the updated frames, so that the paper model flips in the scene.

[0008] Optionally, the step of determining frames corresponding to the paper models in preset paper flipping animation data, and determining position information of the paper models according to position information recorded in the frames, includes:

[0009] Determine the frame corresponding to the paper model in a preset animation map, and determine the position information of the paper model according to the channel color values ​​of the pixel points corresponding to the frame in the animation map; wherein the channel color value of each column of pixel points in the animation map corresponds to the position information of a vertex in different frames of the paper flipping animation data, and the channel color value of each row of pixel points corresponds to the position information of the vertex in each frame of the paper flipping animation data.

[0010] Optionally, the step of determining the frames corresponding to the paper models in the preset paper flipping animation data includes:

[0011] Assign page numbers to paper models respectively;

[0012] Based on the page numbers, frames corresponding to the paper models in the preset paper flipping animation data are determined.

[0013] Optionally, the step of updating the frames corresponding to the paper model in the paper flipping animation data over time, and determining the updated position information of the paper model according to the position information recorded in the updated frames, includes:

[0014] determining an update frequency of the position information of the paper model according to a flipping speed of the paper model;

[0015] The updating frequency is used to update the frames corresponding to the paper model in the paper flipping animation data, and the updated position information of the paper model is determined according to the position information recorded in the updated frames.

[0016] Optionally, the method further includes:

[0017] According to a flipping operation performed by a user on the paper model, a flipping speed of the paper model is determined, so that the paper model flips in the scene following the flipping operation.

[0018] Optionally, the method further includes:

[0019] The position information of the paper model is randomly adjusted using a preset noise map, so that the shape of the paper model changes randomly.

[0020] Optionally, the method further includes:

[0021] Calculating a fluctuation offset value of the position information of the paper model in a horizontal direction based on the texture map coordinate information of the paper model;

[0022] The position information of the paper model is adjusted using the fluctuation offset value, so that the paper model simulates a paper fluttering effect.

[0023] Optionally, the method further includes:

[0024] Determining a bending offset value of the position information of the paper model based on the flipping direction and flipping speed of the paper model, at least one of the frames corresponding to the paper model in the paper flipping animation data, and texture map coordinate information of the paper model, with the horizontal center axis of the paper model as the center;

[0025] The bending offset value is used to adjust the position information of the paper model so that the paper model simulates the bending effect of paper.

[0026] Optionally, the step of rendering the paper model in a preset scene based on the position information of the paper model includes:

[0027] Each paper model is treated as a static mesh object instance and rendered simultaneously in a preset scene.

[0028] The embodiment of the present invention further discloses a paper model display device, comprising:

[0029] a position information determining module, configured to determine frames corresponding to the paper model in the preset paper flipping animation data, and determine the position information of the paper model according to the position information recorded in the frames;

[0030] a display module, configured to render the paper model in a preset scene based on the position information of the paper model, so that the paper model is displayed in the scene;

[0031] The flipping module is used to update the frames corresponding to the paper model in the paper flipping animation data over time, and determine the updated position information of the paper model according to the position information recorded in the updated frames, so that the paper model flips in the scene.

[0032] Optionally, the location information determining module includes:

[0033] A texture position determination submodule is used to determine the frame corresponding to the paper model in a preset animation texture, and determine the position information of the paper model based on the channel color values ​​of the pixel points corresponding to the frame in the animation texture; wherein the channel color value of each column of pixel points in the animation texture corresponds to the position information of a vertex in different frames of the paper flipping animation data, and the channel color value of each row of pixel points corresponds to the position information of the vertex in each frame of the paper flipping animation data.

[0034] Optionally, the location information determination module includes:

[0035] The page number allocation submodule is used to allocate page numbers to paper models respectively;

[0036] The frame matching submodule is used to determine the frames corresponding to the paper models in the preset paper flipping animation data based on the page numbers.

[0037] Optionally, the flipping module includes:

[0038] an update frequency determination submodule, configured to determine an update frequency of the position information of the paper model according to a flipping speed of the paper model;

[0039] The flipping submodule is configured to update the frames corresponding to the paper model in the paper flipping animation data using the update frequency, and determine the updated position information of the paper model according to the position information recorded in the updated frames.

[0040] Optionally, the device further comprises:

[0041] The user flipping module is configured to determine a flipping speed of the paper model according to a flipping operation performed by a user on the paper model, so that the paper model flips in the scene following the flipping operation.

[0042] Optionally, the device further comprises:

[0043] The morphology change module is used to randomly adjust the position information of the paper model using a preset noise map so as to randomly change the morphology of the paper model.

[0044] Optionally, the device further comprises:

[0045] a vibration module, configured to calculate a fluctuation offset value of the position information of the paper model in a horizontal direction based on the texture map coordinate information of the paper model;

[0046] The position information of the paper model is adjusted using the fluctuation offset value, so that the paper model simulates a paper fluttering effect.

[0047] Optionally, the device further comprises:

[0048] a bending offset determining module, configured to determine a bending offset value of the position information of the paper model based on at least one of a flipping direction and a flipping speed of the paper model, frames corresponding to the paper model in the paper flipping animation data, and texture map coordinate information of the paper model, with the horizontal center axis of the paper model as the center;

[0049] The bending module is used to adjust the position information of the paper model by using the bending offset value so that the paper model simulates the bending effect of paper.

[0050] Optionally, the modules presented include:

[0051] The display submodule is used to treat each paper model as a static mesh object instance and simultaneously render the paper models in a preset scene.

[0052] An embodiment of the present invention further discloses an electronic device, including:

[0053] one or more processors; and

[0054] One or more machine-readable media having instructions stored thereon, when executed by the one or more processors, enable the electronic device to perform one or more methods as described in the embodiments of the present invention.

[0055] The embodiments of the present invention further disclose one or more machine-readable media having instructions stored thereon, which, when executed by one or more processors, enable the processors to perform one or more methods as described in the embodiments of the present invention.

[0056] The embodiments of the present invention include the following advantages:

[0057] Through the paper model display method of the embodiment of the present invention, the frames corresponding to the paper model in the preset paper flipping animation data are determined, and the position information of the paper model is determined based on the vertex coordinate information recorded in the frames. Based on the position information of the paper model, the paper model is rendered in a preset scene so that the paper model is displayed in the scene. The frames corresponding to the paper model in the paper flipping animation data are updated over time, and the updated position information of the paper model is determined based on the vertex coordinate information recorded in the updated frames so that the paper model flips in the scene. By using the preset paper flipping animation data, the paper model can be made to correspond to the frames in the paper flipping animation data, thus achieving a paper flipping effect, while occupying less memory resources and computing resources and having high rendering efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 This is a flowchart of a method for displaying a paper model according to an embodiment of the present invention;

[0059] Figure 2 is a schematic diagram of a paper model in an embodiment of the present invention;

[0060] Figure 3 is a flowchart of another paper model display method embodiment of the present invention;

[0061] Figure 4 is a schematic diagram of an animated map according to an embodiment of the present invention;

[0062] Figure 5 is a schematic diagram of a paper model in an embodiment of the present invention;

[0063] Figure 6 is a schematic diagram of a paper model in an embodiment of the present invention;

[0064] Figure 7 This is a structural block diagram of a paper model display device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0065] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0066] In an embodiment of the present invention, a paper flipping animation is pre-created to simulate a paper flipping effect, which requires a large amount of computing and memory resources. The animation also records the position information of the paper model for each frame in the paper flipping animation data. Subsequently, if it is necessary to render flipping paper in a scene, the frame corresponding to the paper model in the paper flipping animation data can be determined, and the position information of the paper model can be determined based on the position information recorded in the frame. That is, the position information can be used to render the paper model in different flipping states in the scene. The corresponding frames of the paper model in the paper flipping animation data are continuously updated over time, so that the position information of the paper model is continuously updated, thereby achieving continuous movement of the paper model and displaying the effect of paper flipping. As a result, the rendering process of the paper model does not require real-time calculation of the position changes of the vertices on the paper model, which can significantly reduce the computing and memory resources required to simulate the paper flipping effect. Even if it is necessary to display multiple sheets of paper flipping simultaneously, this can be achieved with relatively small computing and memory resources.

[0067] Reference Figure 1 , shows a flowchart of a paper model display method according to an embodiment of the present invention, which may specifically include the following steps:

[0068] Step 101, determining frames corresponding to paper models in preset paper flipping animation data, and determining position information of the paper models according to position information recorded in the frames;

[0069] In an embodiment of the present invention, a paper flipping animation of a single paper model can be pre-produced, and the position information of the paper model in each frame of the paper flipping animation can be recorded to obtain paper flipping animation data, so that it is possible to subsequently quickly determine how the current paper model should be displayed in the scene based on the position information of the paper model preset in the paper flipping animation.

[0070] The position information may be coordinate information of a vertex in the paper model. The spatial position of the vertex in the scene may be determined based on the vertex coordinate information. The vertex coordinate information may be three-dimensional coordinate information, such as X-axis coordinate information, Y-axis coordinate information, and Z-axis coordinate information.

[0071] When at least one flipping paper needs to be displayed in the scene, the frames corresponding to each paper model in the preset paper flipping animation data can be determined to determine how each paper model should be initially displayed in the scene.

[0072] Specifically, a page number can be assigned to each paper model, and the order in which the paper models are displayed in the scene can be determined according to the page number sequence. Thus, the frame corresponding to each paper model in the preset paper-flipping animation data can be determined according to the page number sequence. For example, a paper model with a smaller page number can correspond to an earlier frame in the paper-flipping animation data, while a paper model with a larger page number can correspond to a later frame in the paper-flipping animation data.

[0073] After determining the frames corresponding to the paper model in the preset paper flipping animation data, the position information of the paper model in the scene can be determined according to the position information recorded in the frames, thereby obtaining the position information of the paper model.

[0074] Specifically, the vertex coordinate information recorded in the frame can be directly used as the vertex coordinate information of the paper model to obtain the position information of the paper model, or the vertex coordinate information of the paper model can be calculated based on the expected display position of the paper model in the scene and the vertex coordinate information recorded in the frame to obtain the position information of the paper model.

[0075] Step 102: Rendering the paper model in a preset scene based on the position information of the paper model, so that the paper model is displayed in the scene;

[0076] In an embodiment of the present invention, after determining the position information of at least one of the paper models, a vertex shader can be used to render the paper model in a preset scene based on the position information of the paper model, so that the paper model can be displayed in the scene according to the form preset in the paper flipping animation data.

[0077] In a specific implementation, since paper models may have similar structures, in order to increase the speed of paper model rendering, the paper models may be rendered in batches to improve the efficiency of paper model rendering.

[0078] Step 103 : updating the frames corresponding to the paper model in the paper flipping animation data over time, and determining the updated position information of the paper model according to the position information recorded in the updated frames, so that the paper model flips in the scene.

[0079] In an embodiment of the present invention, to achieve the effect of paper flipping, the paper model needs to continuously change over time. Therefore, the frames corresponding to the paper model in the paper flipping animation data can be updated over time, and the updated position information of the paper model can be determined based on the position information recorded in the updated frame. This allows the paper model to continuously update its position information in chronological order, achieving the flipping of the paper model within the scene.

[0080] In a specific implementation, the frames in the paper flipping animation data can have a time sequence. Thus, the frame corresponding to the paper model in the paper flipping animation data can be continuously updated as time changes, and the frame can be the next frame in the current frame time sequence, so that the paper model can flip in the scene like the paper flipping animation data.

[0081] Therefore, when rendering a paper flipping effect is required, it is only necessary to use the preset paper flipping animation data, make the paper model correspond to the frames in the paper flipping animation data, use the position information in the preset paper flipping animation data to determine the position information of the paper model, and continuously update the frames corresponding to the paper model to continuously update the position information of the paper model, thereby achieving the paper flipping effect. The paper flipping effect can be displayed while using fewer memory resources and computing resources. At the same time, because the paper flipping animation data can be reused by the paper model, the workload required to produce the paper model flipping display effect can be reduced.

[0082] As an example of the present invention, Figure 2 This is a schematic diagram of a paper model rendering in an embodiment of the present invention. By determining the frames corresponding to several paper models in the preset paper flipping animation data, and determining the position information of several paper models according to the position information recorded in the frames; then rendering the paper model in a preset scene based on the position information of the paper model, so that the paper model is displayed in the scene, so that Figure 2 As shown, multiple paper models are rendered simultaneously in a scene. Subsequently, the frames corresponding to the paper models in the paper flipping animation data can be updated over time, and the updated position information of the paper models is determined based on the position information recorded in the updated frames, so that the paper models flip in the scene.

[0083] Through the paper model display method of the embodiment of the present invention, the frames corresponding to the paper model in the preset paper flipping animation data are determined, and the position information of the paper model is determined based on the position information recorded in the frames. Based on the position information of the paper model, the paper model is rendered in a preset scene so that the paper model is displayed in the scene. The frames corresponding to the paper model in the paper flipping animation data are updated over time, and the updated position information of the paper model is determined based on the position information recorded in the updated frames so that the paper model flips in the scene. By using the preset paper flipping animation data, the paper model can be made to correspond to the frames in the paper flipping animation data, thus achieving a paper flipping effect, while occupying less memory resources and computing resources and having high rendering efficiency.

[0084] Reference Figure 3, shows a flowchart of a paper model display method according to an embodiment of the present invention, which may specifically include the following steps:

[0085] Step 301, determining frames corresponding to paper models in preset paper flipping animation data, and determining position information of the paper models according to position information recorded in the frames;

[0086] In an embodiment of the present invention, a paper flipping animation of a single paper model can be pre-produced, and the position information of the paper model in each frame of the paper flipping animation can be recorded to obtain paper flipping animation data, so that it is possible to subsequently quickly determine how the current paper model should be displayed in the scene based on the position information of the paper model preset in the paper flipping animation.

[0087] The position information may be coordinate information of a vertex in the paper model. The spatial position of the vertex in the scene may be determined based on the vertex coordinate information. The vertex coordinate information may be three-dimensional coordinate information, such as X-axis coordinate information, Y-axis coordinate information, and Z-axis coordinate information.

[0088] When at least one flipping paper is required to be displayed in a scene, the frames corresponding to each paper model in the preset paper flipping animation data can be determined to determine how each paper model should be initially displayed in the scene. The number of pages required to be displayed in the scene can be determined based on actual needs and is not limited in this regard by the present invention.

[0089] After determining the frames corresponding to the paper model in the preset paper flipping animation data, the position information of the paper model in the scene can be determined according to the position information recorded in the frames, thereby obtaining the position information of the paper model.

[0090] In one embodiment of the present invention, the step of determining the frames corresponding to the paper models in the preset paper flipping animation data, and determining the position information of the paper models according to the position information recorded in the frames, includes:

[0091] S11 , determining a frame corresponding to a paper model in a preset animation map, and determining position information of the paper model according to channel color values ​​of pixel points corresponding to the frame in the animation map.

[0092] In an embodiment of the present invention, to improve the rendering efficiency of the paper model, the position information of the paper model in each frame of the paper flipping animation data can be stored in an animation map. Therefore, when it is necessary to extract the position information recorded in the corresponding frame of the paper model, the vertex shader can be directly used to sample the position information recorded in the corresponding frame of the paper model from the animation map, thus efficiently completing the subsequent rendering of the paper model.

[0093] Specifically, the animated map can record the position information of each frame in the paper flipping animation into the channel color value of the pixel point. For example, the pixel point has three color channels: red, green, and blue. The red channel color value can be used to record the X-axis coordinate of the vertex, the green channel color value can be used to record the Y-axis coordinate of the vertex, and the blue channel color value can be used to record the Z-axis coordinate of the vertex. Therefore, the channel color value of each pixel point can represent the position information of a vertex in the paper model.

[0094] As a specific embodiment of the present invention, Figure 4 This is a schematic diagram of an animation map according to an embodiment of the present invention. The position information of all vertices of the paper model in each frame is recorded in the paper flipping animation data. In the animation map, the channel color value of each row of pixels corresponds to the position information of the vertices in each frame in the paper flipping animation data, and the channel color value of each column of pixels in the animation map corresponds to the position information of a vertex in different frames in the paper flipping animation data. Therefore, after determining the frame corresponding to the paper model in the preset animation map, the column corresponding to the frame can be searched in the animation map, and the channel color value of each pixel in the column can be used as the position information of each vertex recorded in the frame, and the position information of the paper model can be determined based on the position information of each vertex recorded in the frame.

[0095] In one embodiment of the present invention, the step of determining the frames corresponding to the paper models in the preset paper flipping animation data includes:

[0096] S21, assigning page numbers to the paper models respectively;

[0097] In the embodiment of the present invention, in order to determine the frames corresponding to the paper models in the preset paper flipping animation data, page numbers may be allocated to the paper models to determine the order of the paper models.

[0098] S22: Based on the page numbers, determine the frames corresponding to the paper models in the preset paper flipping animation data.

[0099] In an embodiment of the present invention, after determining the page numbers of the paper models, the frames corresponding to the paper models in the preset paper flipping animation data can be determined based on the page numbers, so that the paper models can be arranged in order of page numbers.

[0100] In a specific implementation, generally speaking, papers with smaller page numbers are usually turned earlier, while papers with larger page numbers can be turned later. Therefore, the paper models with smaller page numbers can correspond to earlier frames in the paper turning animation data, and the paper models with larger page numbers can correspond to later frames in the paper turning animation data, so that the paper models can achieve the effect of turning in the order of page numbers.

[0101] In one embodiment of the present invention, the method further comprises:

[0102] S31, using a preset noise map to randomly adjust the position information of the paper model so that the shape of the paper model changes randomly.

[0103] In an embodiment of the present invention, in order to enrich the appearance of the paper model, a preset noise map can be used to randomly adjust the position information of the paper model, so that the paper model's appearance changes randomly, and the display effect of the paper model is more diverse. At the same time, because the paper model randomly adjusts its position information based on the noise map, it can be efficiently calculated using a graphics processor in the shader. Therefore, it can complete the random adjustment of the paper model's position information while occupying relatively low memory resources and computing resources, and has better rendering efficiency.

[0104] Specifically, in addition to coordinate information representing the spatial position of a vertex in the paper model, the vertices may also have texture mapping coordinate information. Texture mapping coordinate information can be two-dimensional, such as horizontal and vertical coordinate information. This information represents the coordinate information of the pixel in the texture corresponding to the vertex. Therefore, the vertex's texture mapping coordinate information can be used to determine its position in the paper model. For example, it can be determined whether the vertex is near the gutter, near the center, or near the outer edge of the paper model.

[0105] The value of each pixel in the noise map can be randomly determined. The pixel in the noise map corresponding to each vertex in the paper model can be determined based on the texture map coordinate information of the paper model. The position information of the vertices in the paper model is then randomly adjusted based on the random pixel values ​​in the noise map. This allows the paper model to exhibit a certain degree of random concavity and convexity, thereby achieving random variations in the paper model's shape.

[0106] Generally speaking, when the paper is just beginning to flip or is nearly finished flipping, and is close to a horizontal state, it usually does not have obvious deformation. However, when the paper is halfway through flipping and is close to a vertical state, it usually has more obvious deformation. At the same time, since each frame in the paper flipping animation data corresponds to a variety of different states of the paper during the flipping process, such as when the paper has just begun to flip, is nearly finished flipping, or is halfway flipping, the state of the paper model can be determined based on the corresponding frame of the paper model in the paper flipping animation data, and different noise coefficients can be assigned. In the process of randomly adjusting the position information of the paper model using a noise map, the noise coefficient can be further used to randomly adjust the paper model. Therefore, the degree of deformation of the paper can be adjusted using the noise coefficient according to the current state of the paper, so that the degree of deformation of the paper has a certain degree of regularity.

[0107] Specifically, for a paper model that has just begun to flip or is nearly finished flipping, a smaller noise coefficient can be assigned during the process of randomly adjusting the position information of the paper model using a noise map. Thus, a paper model that has just begun to flip or is nearly finished flipping can have a less noticeable deformation. Conversely, for a paper model that is nearly halfway through flipping, a larger noise coefficient can be assigned during the process of randomly adjusting the position information of the paper model using a noise map. Thus, a paper model that is nearly halfway through flipping can have a more noticeable deformation. This results in a certain regularity in the degree of deformation of the paper model, and a more natural display effect.

[0108] In a specific implementation, to randomly change the shape of the paper model, the texture map coordinates corresponding to at least one vertex in the paper model can be adjusted as needed, causing the vertex's texture map coordinates to shift to a certain degree. Thus, when a texture map is added to the paper model, the pixels in the texture map corresponding to the vertices of the paper model can shift, thereby changing the way the texture map is displayed on the paper model. For example, the texture map can produce effects such as rotation, displacement, enlargement, reduction, and local distortion, thereby simulating the deformation effect of paper to a certain extent.

[0109] In one embodiment of the present invention, the method further comprises:

[0110] S41, calculating a fluctuation offset value of the position information of the paper model in the horizontal direction based on the texture map coordinate information of the paper model;

[0111] In the embodiment of the present invention, in order to reflect the effect of slight vibration of paper in the air, fluctuations may be added to the horizontal direction of the paper model to cause the vertices to be offset.

[0112] The paper model can determine the horizontal direction and vertical direction of the paper model's own texture mapping based on its own two-dimensional coordinate system of texture mapping coordinate information. As an example of the present invention, Figure 5 This is a schematic diagram of a paper model according to the present invention. The paper model exhibits wavy horizontal curvature, creating the effect of paper trembling in the air. To demonstrate this effect, the horizontal offset of the paper model's position information can be calculated based on the paper model's texture map coordinates.

[0113] Specifically, because the fluctuation only varies in the horizontal direction of the paper model's texture, but is uniform in the vertical direction, vertices with the same horizontal coordinates in the texture map coordinate information can have the same fluctuation offset value. Therefore, the horizontal coordinates of the vertices can be used as the input of a random sinusoidal fluctuation function to calculate the horizontal fluctuation offset value of the paper model.

[0114] S42: Using the fluctuation offset value to adjust the position information of the paper model, so that the paper model simulates a paper vibration effect.

[0115] In this embodiment of the present invention, the positional information of the paper model can be adjusted using the fluctuation offset value, causing the positional information of the paper model to shift up and down in the horizontal direction of the map, creating a ripple effect. This simulates the trembling effect of the paper model and provides a more diverse display experience for the paper model. Furthermore, since the adjustment of the positional information of the paper model based on the fluctuation offset value in the horizontal direction of the map can be efficiently performed in the shader using a graphics processor, the adjustment of the positional information of the paper model can be completed with relatively low memory and computing resources, resulting in improved rendering efficiency.

[0116] Specifically, the fluctuation offset value can be used to know how the paper model should be offset in the horizontal direction of its own mapping. Based on the fluctuation offset value, the coordinate information of the vertices of the paper model after adjustment is calculated to know how the coordinates of the vertices of the paper model in space should change, and the fluctuation of the paper model in the horizontal direction of its own mapping can be displayed.

[0117] Specifically, during the subsequent process of updating the position information of the paper model over time, the fluctuation offset value of the position information of the paper model in the horizontal direction of the map can be simultaneously updated. This allows the fluctuation of the paper model to continuously change over time, thereby simulating the effect of the paper constantly shaking.

[0118] In a specific implementation, the vibration effect of the paper model in the air can be displayed all the time, or the vibration effect can be displayed only when the paper model is stationary. The present invention does not impose any limitation on this.

[0119] In one embodiment of the present invention, the method further comprises:

[0120] S51, determining a bending offset value of the position information of the paper model based on at least one of the flipping direction and flipping speed of the paper model, the frames corresponding to the paper model in the paper flipping animation data, and the texture map coordinate information of the paper model, with the horizontal center axis of the texture of the paper model as the center;

[0121] In embodiments of the present invention, generally speaking, the paper may exhibit different bending effects depending on its state during flipping due to the influence of gravity. For example, a paper that has just begun flipping or is nearing completion is nearly horizontal and may not exhibit a noticeable bending effect. However, a paper that is halfway through flipping, nearing a vertical position, will be more noticeably affected by gravity and exhibit a bending effect. Figure 6 This is a schematic diagram of a paper model according to an embodiment of the present invention. It can be seen that the paper model in the middle of flipping can have a more obvious bending effect, while the paper model in the state of just starting to flip or nearly completing flipping can have a less obvious bending effect.

[0122] In order to achieve this effect, the bending offset value of the position information of the paper model can be determined based on the flipping direction and flipping speed of the paper model, at least one of the frames corresponding to the paper model in the paper flipping animation data, and the texture map coordinate information of the paper model, with the horizontal center axis of the paper model's map as the center.

[0123] Specifically, when paper bends, it generally begins to bend from its own horizontal axis. Therefore, if the horizontal coordinates in the texture mapping coordinate information of the paper model are closer to the central axis, it can have a larger bend offset value, while if the horizontal coordinates in the texture mapping coordinate information of the paper model are farther from the central axis, it can have a smaller bend offset value. Therefore, when determining the bend offset value of the paper model's position information, the horizontal coordinates in the texture mapping coordinate information of the paper model can be referenced.

[0124] The bending direction of the paper model can vary depending on the flipping direction of the paper model. For example, if the paper is flipped from left to right, the paper may bend to the right. If the paper is flipped from right to left, the paper may bend to the left. Therefore, the flipping direction of the paper model can be used as a reference when determining the bending offset value of the position information of the paper model.

[0125] The degree of curvature of the paper model may vary depending on the speed at which the paper model is flipped. When the paper model is flipped quickly, the paper model may have a more pronounced curvature, and thus the position information of the paper model may have a larger curvature offset value. When the paper model is flipped slowly, the paper model may have a less pronounced curvature, and thus the position information of the paper model may have a smaller curvature offset value. Therefore, the flipping speed of the paper model may be used as a reference in determining the curvature offset value of the position information of the paper model.

[0126] Since the paper is affected by gravity according to different states during the flipping process, it can show different bending effects. Therefore, in the process of determining the bending offset value of the position information of the paper model, the frames corresponding to the paper model in the paper flipping animation data can be referred to. If the frame corresponds to the state of just starting to flip or nearly turning over, the paper model can have a smaller bending offset value as a whole. If the frame corresponds to the state of flipping to the middle, the paper model can have a larger bending offset value as a whole. Specifically, in the process of calculating the bending offset value of the position information of the paper model, a bending offset coefficient can be assigned to the frames corresponding to the paper model in the paper flipping animation data. The bending offset coefficient is larger in the frame corresponding to the state of flipping to the middle, and smaller in the frame corresponding to the state of just starting to flip or nearly turning over, thereby achieving an overall adjustment of the bending offset value of the paper model.

[0127] S52: Using the bending offset value, adjust the position information of the paper model so that the paper model simulates a bending effect of paper.

[0128] In embodiments of the present invention, the bend offset value can be used to adjust the dimensional position information of the paper model, thereby simulating the effect of paper curvature and providing a more diverse display experience. Furthermore, since the paper model's position information is adjusted based on the bend offset value, it can be efficiently computed within the shader using a graphics processor. Therefore, the paper model's position information can be adjusted while utilizing relatively low memory and computing resources, resulting in improved rendering efficiency.

[0129] Optionally, the position information of the paper model can be adjusted using the bend offset value. A skew offset value can also be added to the vertical direction of the paper model's texture to impart a certain degree of skew distortion to the paper model. The skew distortion effect, combined with the bend effect, can more naturally simulate the bending and deformation of paper during flipping, providing a more diverse display experience for the paper model.

[0130] Step 302 , treating each paper model as a static mesh instance and rendering the paper models simultaneously in a preset scene;

[0131] In an embodiment of the present invention, in order to further improve the rendering efficiency of the paper model, each paper model can be used as a static mesh object instance for instanced rendering. Instanced rendering can simultaneously render models with similar structures, and can be rendered using a graphics processing unit (GPU). This avoids multiple calls to the graphics drawing interface, significantly improving rendering efficiency. At the same time, using a graphics processor for rendering can more fully utilize the computing resources in the computer, and achieve better rendering effects. Since instanced rendering is not sensitive to the number of instances included in a single rendering, even if a single rendering includes a large number of paper models, it will not significantly increase the consumption of memory and computing resources.

[0132] Step 303 : updating the frames corresponding to the paper model in the paper flipping animation data over time, and determining the updated position information of the paper model according to the position information recorded in the updated frames, so that the paper model flips in the scene.

[0133] In an embodiment of the present invention, to achieve the effect of paper flipping, the paper model needs to continuously change over time. Therefore, the frames corresponding to the paper model in the paper flipping animation data can be updated over time, and the updated position information of the paper model can be determined based on the position information recorded in the updated frame. This allows the paper model to continuously update its position information in chronological order, achieving the flipping of the paper model within the scene.

[0134] In a specific implementation, the frames in the paper flipping animation data can have a time sequence. Thus, the frame corresponding to the paper model in the paper flipping animation data can be continuously updated as time changes, and the frame can be the next frame in the current frame time sequence, so that the paper model can flip in the scene like the paper flipping animation data.

[0135] In an embodiment of the present invention, after the position information of the paper model is updated, according to actual needs, a preset noise map can be used to randomly adjust the position information of the paper model so that the shape of the paper model changes randomly; or based on the texture map coordinate information of the paper model, a fluctuation offset value of the position information of the paper model in the horizontal direction of the map can be calculated; and the position information of the paper model can be adjusted using the fluctuation offset value so that the paper model simulates the paper fluttering effect; or based on the flipping direction and flipping speed of the paper model, and at least one of the frames corresponding to the paper model in the paper flipping animation data, and the texture map coordinate information of the paper model, a bending offset value of the position information of the paper model can be determined with the central axis of the horizontal direction of the map of the paper model as the center; and the bending offset value can be used to adjust the position information of the paper model so that the paper model simulates the paper bending effect. The present invention does not impose any restrictions on this.

[0136] Therefore, when it is necessary to render a paper flipping effect, it is only necessary to use the preset paper flipping animation data, make the paper model correspond to the frames in the paper flipping animation data, use the position information in the preset paper flipping animation data to determine the position information of the paper model, and continuously update the frames corresponding to the paper model to continuously update the position information of the paper model, so as to achieve the paper flipping effect. The display of the paper flipping effect can be completed while using fewer memory resources and computing resources. At the same time, since the paper flipping animation data can be reused by the paper model, the workload required to produce the paper model flipping display effect can be reduced. Afterwards, a variety of different methods can still be used to expand the paper model to produce different display effects. For example, the random change of the shape of the paper model, the trembling effect of the paper model, the bending effect of the paper model, etc.

[0137] In one embodiment of the present invention, the step of updating the frames corresponding to the paper model in the paper flipping animation data over time, and determining the updated position information of the paper model based on the position information recorded in the updated frames, includes:

[0138] S61, determining an update frequency of the position information of the paper model according to a flipping speed of the paper model;

[0139] In an embodiment of the present invention, the flipping speed of the paper model can be adjusted according to actual needs. The flipping speed of the paper model can be determined based on the update frequency of the position information of the paper model. If the update frequency is faster, the position of the paper model needs to be adjusted more times within the same period of time, thereby demonstrating a faster paper flipping effect. If the update frequency is slower, the position of the paper model needs to be adjusted fewer times within the same period of time, thereby demonstrating a slower paper flipping effect.

[0140] S62: updating the frames corresponding to the paper model in the paper flipping animation data using the update frequency, and determining updated position information of the paper model according to the position information recorded in the updated frames.

[0141] In an embodiment of the present invention, after determining the update frequency, the update frequency can be used to update the frames corresponding to the paper model in the paper flipping animation data, and the updated position information of the paper model can be determined based on the position information recorded in the updated frame, thereby achieving the effect of adjusting the flipping speed of the paper model.

[0142] In one embodiment of the present invention, the method further comprises:

[0143] S71 : Determine a flipping speed of the paper model according to a flipping operation performed by a user on the paper model, so that the paper model flips in the scene following the flipping operation.

[0144] In the embodiment of the present invention, the flipping of the paper model may be automatic, or may be achieved based on a flipping operation performed by a user on the paper model.

[0145] Specifically, in the case of automatic flipping, the paper model can select an update frequency according to actual needs, update the frames corresponding to the paper model in the paper flipping animation data, and determine the updated position information of the paper model based on the position information recorded in the updated frame, so as to realize automatic flipping of the paper model.

[0146] When the flipping operation is implemented based on the user's flipping operation on the paper model, it is necessary to achieve the effect of the paper model flipping in the scene according to the user operation. Therefore, it is necessary to make the flipping speed of the paper model the same as the movement speed of the user operation, so that the paper model can flip in the scene according to the user operation, showing the effect of the paper model being flipped by the user operation.

[0147] Specifically, the paper model can be displayed in an interface of an electronic device. The electronic device can be a mobile phone, tablet computer, desktop computer, laptop computer, smartwatch, television, etc., although the present invention is not limited thereto. A user can connect an input device such as a touch screen, keyboard, mouse, microphone, etc. to the electronic device and issue a flipping operation on the paper model. The flipping operation can be used to control the flipping of the paper model.

[0148] Generally speaking, a user's flipping operation can be a sliding movement in a certain direction starting from the paper model, and thus the flipping operation can have a speed and a direction. Thus, after the user initiates a flipping operation on the paper model, the electronic device can respond to the user's flipping operation and determine the speed and direction of the flipping operation. Subsequently, the flipping speed of the paper model can be set to be the same as the speed of the flipping operation, and the flipping direction of the paper model can be set to be the same as the direction of the flipping operation, thereby causing the paper model to move within the scene according to the user's operation.

[0149] Through the paper model display method of the embodiment of the present invention, the frames corresponding to the paper models in the preset paper flipping animation data are determined, and the position information of the paper models is determined based on the position information recorded in the frames. Each paper model is treated as an instance of a static mesh object, and the paper models are simultaneously rendered in a preset scene so that the paper models are displayed in the scene. The frames corresponding to the paper models in the paper flipping animation data are updated over time, and the updated position information of the paper models is determined based on the position information recorded in the updated frames so that the paper models flip in the scene. By using the preset paper flipping animation data, the paper models can be made to correspond to the frames in the paper flipping animation data, thus achieving a paper flipping effect, while occupying less memory resources and computing resources and having high rendering efficiency.

[0150] It should be noted that for the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0151] Reference Figure 7 , shows a structural block diagram of a paper model display device according to an embodiment of the present invention, which may specifically include the following modules:

[0152] The position information determining module 701 is used to determine the frames corresponding to the paper model in the preset paper flipping animation data, and determine the position information of the paper model according to the position information recorded in the frames;

[0153] A display module 702 is configured to render the paper model in a preset scene based on the position information of the paper model, so that the paper model is displayed in the scene;

[0154] The flipping module 703 is configured to update the frames corresponding to the paper model in the paper flipping animation data over time, and determine the updated position information of the paper model according to the position information recorded in the updated frames, so that the paper model flips in the scene.

[0155] In one embodiment of the present invention, the location information determination module includes:

[0156] A texture position determination submodule is used to determine the frame corresponding to the paper model in a preset animation texture, and determine the position information of the paper model based on the channel color values ​​of the pixel points corresponding to the frame in the animation texture; wherein the channel color value of each column of pixel points in the animation texture corresponds to the position information of a vertex in different frames of the paper flipping animation data, and the channel color value of each row of pixel points corresponds to the position information of the vertex in each frame of the paper flipping animation data.

[0157] In one embodiment of the present invention, the location information determination module includes:

[0158] The page number allocation submodule is used to allocate page numbers to paper models respectively;

[0159] The frame matching submodule is used to determine the frames corresponding to the paper models in the preset paper flipping animation data based on the page numbers.

[0160] In one embodiment of the present invention, the flip module includes:

[0161] an update frequency determination submodule, configured to determine an update frequency of the position information of the paper model according to a flipping speed of the paper model;

[0162] The flipping submodule is configured to update the frames corresponding to the paper model in the paper flipping animation data using the update frequency, and determine the updated position information of the paper model according to the position information recorded in the updated frames.

[0163] In one embodiment of the present invention, the device further comprises:

[0164] The user flipping module is configured to determine a flipping speed of the paper model according to a flipping operation performed by a user on the paper model, so that the paper model flips in the scene following the flipping operation.

[0165] In one embodiment of the present invention, the device further comprises:

[0166] The morphology change module is used to randomly adjust the position information of the paper model using a preset noise map so as to randomly change the morphology of the paper model.

[0167] In one embodiment of the present invention, the device further comprises:

[0168] a vibration module, configured to calculate a fluctuation offset value of the position information of the paper model in a horizontal direction based on the texture map coordinate information of the paper model;

[0169] The position information of the paper model is adjusted using the fluctuation offset value, so that the paper model simulates a paper fluttering effect.

[0170] In one embodiment of the present invention, the device further comprises:

[0171] a bending offset determining module, configured to determine a bending offset value of the position information of the paper model based on at least one of a flipping direction and a flipping speed of the paper model, frames corresponding to the paper model in the paper flipping animation data, and texture map coordinate information of the paper model, with the horizontal center axis of the paper model as the center;

[0172] The bending module is used to adjust the position information of the paper model by using the bending offset value so that the paper model simulates the bending effect of paper.

[0173] In one embodiment of the present invention, the displayed modules include:

[0174] The display submodule is used to treat each paper model as a static mesh object instance and simultaneously render the paper models in a preset scene.

[0175] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0176] An embodiment of the present invention further provides an electronic device, including:

[0177] one or more processors; and

[0178] One or more machine-readable media having instructions stored thereon, when executed by the one or more processors, enable the electronic device to perform the method described in the embodiment of the present invention.

[0179] The embodiments of the present invention further provide one or more machine-readable media having instructions stored thereon, which, when executed by one or more processors, enable the processors to perform the methods described in the embodiments of the present invention.

[0180] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0181] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, apparatus, or computer program products. Thus, embodiments of the present invention may take the form of a fully hardware embodiment, a fully software embodiment, or an embodiment combining software and hardware. Furthermore, embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0182] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the process in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0183] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0184] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0185] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0186] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.

[0187] The above is a detailed introduction to a paper model display method and a paper model display device provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A paper model display method, characterized in that: include: Determining a frame corresponding to a paper model in a preset animation map, and determining position information of the paper model based on channel color values ​​of pixels corresponding to the frame in the animation map; wherein the channel color value of each column of pixels in the animation map corresponds to position information of a vertex in different frames of the paper flipping animation data, and the channel color value of each row of pixels corresponds to position information of a vertex in each frame of the paper flipping animation data; Rendering the paper model in a preset scene based on the position information of the paper model, so that the paper model is displayed in the scene; updating frames corresponding to the paper model in the paper flipping animation data over time, and determining updated position information of the paper model according to position information recorded in the updated frames, so that the paper model flips in the scene; Using a preset noise map, randomly adjusting the position information of the paper model so that the shape of the paper model changes randomly; Calculating a fluctuation offset value of the position information of the paper model in a horizontal direction based on the texture map coordinate information of the paper model; The position information of the paper model is adjusted using the fluctuation offset value, so that the paper model simulates a paper fluttering effect.

2. The method according to claim 1, characterized in that The step of determining the frames corresponding to the paper models in the preset paper flipping animation data includes: Assign page numbers to paper models respectively; Based on the page numbers, frames corresponding to the paper models in the preset paper flipping animation data are determined.

3. The method according to claim 1, characterized in that The step of updating the frames corresponding to the paper model in the paper flipping animation data over time, and determining the updated position information of the paper model according to the position information recorded in the updated frames, includes: determining an update frequency of the position information of the paper model according to a flipping speed of the paper model; The updating frequency is used to update the frames corresponding to the paper model in the paper flipping animation data, and the updated position information of the paper model is determined according to the position information recorded in the updated frames.

4. The method according to claim 3, characterized in that The method further comprises: According to a flipping operation performed by a user on the paper model, a flipping speed of the paper model is determined, so that the paper model flips in the scene following the flipping operation.

5. The method according to claim 1, wherein The method further comprises: Determining a bending offset value of the position information of the paper model based on the flipping direction and flipping speed of the paper model, at least one of the frames corresponding to the paper model in the paper flipping animation data, and texture map coordinate information of the paper model, with the horizontal center axis of the paper model as the center; The bending offset value is used to adjust the position information of the paper model so that the paper model simulates the bending effect of paper.

6. The method according to claim 1, wherein The step of rendering the paper model in a preset scene based on the position information of the paper model includes: Each paper model is treated as a static mesh object instance and rendered simultaneously in a preset scene.

7. A paper model display device, characterized in that: include: A texture position determination submodule is configured to determine the corresponding frame of the paper model in a preset animation texture, and determine the position information of the paper model based on the channel color values ​​of the pixels corresponding to the frames in the animation texture; wherein the channel color value of each column of pixels in the animation texture corresponds to the position information of a vertex in different frames of the paper flipping animation data, and the channel color value of each row of pixels corresponds to the position information of a vertex in each frame of the paper flipping animation data; a display module, configured to render the paper model in a preset scene based on the position information of the paper model, so that the paper model is displayed in the scene; a flipping module, configured to update the frames corresponding to the paper model in the paper flipping animation data over time, and determine updated position information of the paper model based on position information recorded in the updated frames, so as to flip the paper model in the scene; A morphology change module, configured to randomly adjust the position information of the paper model using a preset noise map, so as to randomly change the morphology of the paper model; a vibration module, configured to calculate a fluctuation offset value of the position information of the paper model in a horizontal direction based on the texture map coordinate information of the paper model; The position information of the paper model is adjusted using the fluctuation offset value, so that the paper model simulates a paper fluttering effect.

8. An electronic device, characterized in that: include: one or more processors; and One or more machine-readable media having instructions stored thereon, when executed by the one or more processors, cause the electronic device to perform the method of any one of claims 1-6.

9. One or more machine-readable media having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Book information browsing method and device, book information browsing program and recording medium recording the program

    JP2003091343A

  • Electronic simulation of interaction with printed matter

    US20030117425A1