Image rendering method, device, electronic device and storage medium
By obtaining user interaction instructions, updating the depth information and coordinates of the three-dimensional model, controlling the rotation of nodes, the effect of dynamic changes in the rendered object in the trajectory movement is achieved, and the problem of not dynamic changes in the rendered object in the prior art is solved.
Patent Information
- Application Number
- CN202210074077.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-21
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2042-01-21
AI Technical Summary
The prior art is difficult to achieve the effect of dynamic changes in the rendering object while moving according to a certain trajectory during the three-dimensional image rendering process.
During the display process of target rendering object, users' interaction instructions are obtained, the three-dimensional model depth information of the rendering object is updated, and the target coordinates of the rendering object in the world coordinate system are determined according to the interactive operation instructions, the coordinates of each node are updated synchronously, and the node rotation is controlled to complete rendering.
It realizes that the rendered object shows depth changes during the trajectory movement, and different parts of the rendered object move in curves during the movement, achieving a dynamic and real rendering effect.
Smart Images

Figure CN114419230B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of image processing technology, and in particular to an image rendering method, device, electronic device, and storage medium. Background Art
[0002] At present, in the process of 3D image rendering, depth information is mostly added to the pixel coordinate information of the 2D image, and the corresponding 3D image is rendered. In some scenes that interact with stickers or props, it is necessary to make the rendered object produce a dynamic and continuous 3D rendering effect during the interaction with the user. However, there is no better solution that can achieve a 3D dynamic image rendering effect in which the rendered object itself changes dynamically while moving along a certain trajectory. Summary of the invention
[0003] The embodiments of the present disclosure provide an image rendering method, device, electronic device and storage medium, which can realize a rendering method in a three-dimensional space with depth, so that the rendered object presents depth changes during the movement of the corresponding trajectory, and different parts of the rendered object also perform curved motion during the movement of the corresponding trajectory.
[0004] In a first aspect, an embodiment of the present disclosure provides an image rendering method, comprising:
[0005] During the display process of the target rendering object, after obtaining an interactive operation instruction of the user to move and control the target rendering object, for each frame image of the target rendering object, updating the depth information of the first node of the three-dimensional model of the target rendering object in the current frame image;
[0006] Determine the target coordinates of the first node in the world coordinate system corresponding to the current frame image according to the screen coordinates corresponding to the moving trajectory corresponding to the interactive operation instruction in the current frame image and the depth information;
[0007] Based on the target coordinates and the world coordinate system coordinates of each node in the three-dimensional model in the previous frame image of the current frame image, the world coordinate system coordinates of each node in the current frame image are synchronously updated, and during the coordinate updating process, each node is controlled to rotate according to a preset model node rotation strategy to complete the image rendering of the target rendering object.
[0008] In a second aspect, the present disclosure also provides an image rendering device, including:
[0009] A depth information updating module is used to update the depth information of the first node of the three-dimensional model of the target rendering object in the current frame image for each frame image of the target rendering object after obtaining an interactive operation instruction of the user to move and control the target rendering object during the display process of the target rendering object;
[0010] A rendering guide coordinate determination module, used to determine the target coordinates of the first node in the world coordinate system corresponding to the current frame image according to the screen coordinates corresponding to the movement trajectory corresponding to the interactive operation instruction in the current frame image and the depth information;
[0011] An image rendering module is used to synchronously update the world coordinate system coordinates of each node in the current frame image frame based on the target coordinates and the world coordinate system coordinates of each node in the three-dimensional model in the previous frame image of the current frame image, and control each node to rotate according to a preset model node rotation strategy during the coordinate update process to complete the image rendering of the target rendering object.
[0012] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0013] one or more processors;
[0014] a storage device for storing one or more programs,
[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the image rendering method as described in any one of the embodiments of the present disclosure.
[0016] In a fourth aspect, the embodiments of the present disclosure further provide a storage medium comprising computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute the image rendering method as described in any one of the embodiments of the present disclosure.
[0017] The technical solution of the disclosed embodiment is that during the display process of the target rendering object, if the user interacts with the target object, the user's interactive operation instruction for moving the target rendering object can be obtained; then, during the interactive process of the user moving the target rendering object, for each frame image of the target rendering object, the depth information of the first node of the three-dimensional model of the target rendering object in the current frame image is updated; according to the screen coordinates and depth information corresponding to the movement trajectory corresponding to the interactive operation instruction in the current frame image, the target coordinates of the first node in the world coordinate system corresponding to the current frame image are determined; the target coordinates are used as the overall moving target position of the target rendering object, based on the target coordinates and the world coordinate system coordinates of each node in the three-dimensional model in the previous frame image of the current frame image, the world coordinate system coordinates of each node in the current frame image frame are synchronously updated, and in the process of updating the coordinates, each node is controlled to rotate according to the preset model node rotation strategy to complete the image rendering of the target rendering object. The technical solution of the disclosed embodiment fills the gap in the dynamic three-dimensional image rendering scheme with depth changes, and realizes a rendering method in a three-dimensional space with depth, so that the rendering object presents depth changes during the movement of the corresponding trajectory, and different parts of the rendering object also perform curved motion during the movement of the corresponding trajectory. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0019] Figure 1 A flowchart of an image rendering method provided in the first embodiment of the present disclosure;
[0020] Figure 2 A schematic plan view of a node of a rendering object provided in the first embodiment of the present disclosure;
[0021] Figure 3 A schematic diagram of a plane dynamic change of a two-dimensional rendering object provided in the first embodiment of the present disclosure under a user's interactive operation instruction;
[0022] Figure 4 A flowchart of an image rendering method provided in the second embodiment of the present disclosure;
[0023] Figure 5 A schematic diagram of a first node and a preset object in a space provided in the second embodiment of the present disclosure being close to each other;
[0024] Figure 6A schematic diagram of a target rendering object instance provided in the second embodiment of the present disclosure;
[0025] Figure 7 A schematic diagram of a skinning structure of a target rendering object instance provided in the second embodiment of the present disclosure;
[0026] Figure 8 A schematic diagram of the structure of an image rendering device provided in Embodiment 3 of the present disclosure;
[0027] Fig. 9 A schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present disclosure. DETAILED DESCRIPTION
[0028] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0029] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0030] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0031] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0032] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0033] Embodiment 1
[0034] Figure 1This is a flow chart of an image rendering method provided by the first embodiment of the present disclosure. The embodiment of the present disclosure is applicable to dynamic three-dimensional image rendering scenes, and is particularly applicable to dynamic three-dimensional image rendering in some small games, special effects or prop scenes that can interact with users. The method can be executed by an image rendering device, which can be implemented in the form of software and / or hardware, and the device can be configured in an electronic device, such as a mobile terminal or a server device.
[0035] like Figure 1 As shown, the image rendering method provided by this embodiment includes:
[0036] S110. During display of a target rendering object, after obtaining an interactive operation instruction from a user to control movement of the target rendering object, updating depth information of a first node of a three-dimensional model of the target rendering object in a current frame image for each frame image of the target rendering object.
[0037] Currently, in social media applications, such as short video platforms, in order to increase the fun and interactivity of users' use of social media, many interactive mini-games and various categories of dynamic stickers and other video shooting props are set up to generate interactive content with users.
[0038] In this embodiment, the target rendering object can be an interactive video prop or an interactive animation. In particular, in this embodiment, the target rendering object is a three-dimensional object with depth information. When the user opens the corresponding video prop or animation of the target rendering object, the target display object will be displayed in the interactive interface of the application client in the initial state of the target display object, and its initial state can be a preset three-dimensional image with initial depth information. The specific three-dimensional model of the target display object can be a corresponding model established in advance according to preset scenes, topics and other related content, such as a three-dimensional animal model, a three-dimensional food model or a daily necessities model.
[0039] The user can interact with the target rendering object in the terminal interactive interface displaying the target rendering object, and the interactive methods include tapping, long pressing, dragging, or gesture recognition, etc. Among them, gesture recognition means that the interactive operation instructions for the target rendering object can be triggered by recognizing the user's gestures (including facial movements), such as changing the movement trajectory of the target rendering object by the movement trajectory of the hand.
[0040] When the user's interactive operation instruction to move the target rendering object is obtained, it indicates that the initial rendering display state of the target rendering object has begun to change. Therefore, it is necessary to update the depth information change of the target rendering object after the start of the change, so as to dynamically render and update the display effect of the target object according to the user's interactive operation instruction.
[0041] Specifically, in the initial rendering state of the target rendering object, each bone node in its three-dimensional model has an initial depth value, which is a constant, indicating the depth from the terminal screen display interface to the camera. By setting the corresponding depth constant value, the distance between the target rendering object and the terminal screen display interface can be adjusted. In this embodiment, the change in depth is associated with the time when the target rendering object starts to be displayed, or the time when the user interacts with the target display object, so that the depth change can be changed accordingly according to the time value. For example, the sine value of the cumulative duration of the target rendering object display or the cumulative duration of the user interacting with the target display object is taken, and on this basis, a numerical operation is performed with the depth constant to finally obtain the updated depth information. In one embodiment, the updated depth value (zDistance) can be expressed as: zDistance = DIS_BASE + sin (time) * DIS_BASE / 5, where DIS_BASE is a depth constant, and time is the cumulative time of the target rendering object from the start of display or interaction to the current display of the image frame of the target rendering object.
[0042] It is understandable that the depth information obtained is the first node in the three-dimensional model of the target rendering object. The first node is the bone node of the starting point of the dynamic change of the target rendering object. The other bone nodes change continuously according to the corresponding preset node order under the change transmission of the first node position information, thereby realizing the overall change of the target rendering object. Figure 2 In the figure, the initial display state of the target object is shown in the form of a two-dimensional plane image. The plane can be understood as the coronal plane where the nodes of the target rendering object are located. Among them, the target rendering object as a whole includes multiple model sub-units (diamond blocks), and the black dots exemplarily show the various bone nodes of the target rendering object. Furthermore, the bone nodes are link nodes and non-link nodes. The link node is a node used to link two model sub-units together, and the non-link node is a node within a model sub-unit. When two model sub-units are linked, the corresponding two link nodes can be directly overlapped.
[0043] When the user interacts with the target rendering object in any possible way, for example, by dragging the target rendering object to move it, the target rendering object will start to move from the model subunit where the first node is located. Figure 3 As shown in the figure, when the user moves along the curved track represented by the dotted line through gestures, the target rendering object will also move along the corresponding track. The final rendering effect is achieved by calculating the position information of each node according to the depth change of the first node and the change of the spatial coordinate position in the subsequent steps. It can be understood that Figure 2 and Figure 3 The content does not contain depth information and is not the final rendering effect. It is only used to facilitate the explanation of the rendering process.
[0044] S120: Determine the target coordinates of the first node in the world coordinate system corresponding to the current frame image according to the screen coordinates corresponding to the moving trajectory corresponding to the interactive operation instruction in the current frame image and the depth information.
[0045] When the target rendering object moves in response to the user's interactive operation instruction, it moves along the movement trajectory of the user's finger on the screen or the corresponding trajectory of the gesture on the screen. Then, in each frame of the image, the coordinates of the finger on the terminal interface are the target coordinates of the first node. This is equivalent to the target coordinate being a movement guide for the first node. The first node should move closer to the target coordinate, or even overlap with the target coordinate; then, other nodes sequentially pass through the path passed by the first node.
[0046] When the user interacts with the target rendering object through the terminal interface, the screen coordinates of the user's gesture movement trajectory in the current image frame can be obtained in real time. Then, the coordinates are calculated in combination with the depth information to obtain the target coordinates in the world coordinate system.
[0047] S130. Based on the target coordinates and the world coordinate system coordinates of each node in the three-dimensional model in the previous frame image of the current frame image, the world coordinate system coordinates of each node in the current frame image are synchronously updated, and during the coordinate updating process, each node is controlled to rotate according to a preset model node rotation strategy to complete the image rendering of the target rendering object.
[0048] Specifically, the rendering process of the target object is a process of calculating and updating rendering parameters such as coordinate values of each node of the three-dimensional model of the target rendering object in each frame of the image showing the target rendering object, combined with the dynamic changes of the target coordinates.
[0049] First, since the first node moves from the coordinate position in the previous frame image to the target coordinates in the current frame, the moving direction and moving distance of the first node can be determined based on the target coordinates and the world coordinate system coordinates of the first node in the previous frame image, and the first node is moved in the corresponding moving direction and the corresponding moving distance to complete the coordinate update of the first node in the current frame image.
[0050] The moving direction and moving distance of the first node are specifically based on the first coordinate vector between the world coordinate system coordinates and the target coordinates of the first node in the previous frame image, and the vector direction is from the world coordinate system coordinates of the first node in the previous frame image to the target coordinates. The first coordinate vector V1 can be expressed as V1 = (targetPos-pos1), where targetPos represents the target coordinates and pos1 is the world coordinate system coordinates of the first coordinate in the previous frame image. Then, the vector direction of the first coordinate vector can be used as the moving direction of the first node, that is, the direction of V1 is the moving direction of the first node. As for the moving distance in the direction of V1, the unit distance of the pixel movement between two adjacent image frames and the length of the vector V1 should be considered. The relationship between the preset pixel movement unit distance and the vector length of the first coordinate vector V1 can be first determined. When the preset pixel movement unit distance is less than or equal to the vector length of the first coordinate vector, the preset pixel movement unit distance is used as the moving distance of the first node in the corresponding moving direction, otherwise, the vector length of the first coordinate vector is used as the moving distance of the first node in the corresponding moving direction, that is, the moving distance of the first node in the vector direction of V1 will not exceed the length of the vector V1.
[0051] Furthermore, the world coordinate system coordinates of each node except the first node in the current frame image are also updated synchronously. The moving target of each node except the first node is to move toward the position of the previous point adjacent to it. Then, for each node except the first node, the moving direction and moving distance of each node can be determined according to the world coordinate system coordinates of each node and the previous node adjacent to it in the previous frame image, and each node is moved by the corresponding moving distance according to the corresponding moving direction to complete the coordinate update of each node in the current frame image. Specifically, when determining the moving direction and moving distance of each node except the first node, the second coordinate vector V2 between the world coordinate system coordinates of each node and the previous node adjacent to it in the previous frame image can be used; then, the vector direction of the second coordinate vector is used as the moving direction of each node; when the preset pixel moving unit distance is less than or equal to the vector length of the second coordinate vector, the preset pixel moving unit distance is used as the moving distance of each node in the corresponding moving direction, otherwise, the vector length of the second coordinate vector is used as the moving distance of each node in the corresponding moving direction. That is, between two adjacent frames of images, the pixel movement unit distance corresponding to each pixel point is consistent, that is, the movement distance of each node in its respective movement direction is consistent.
[0052] However, it should be noted that, among the nodes other than the first node, there are link nodes and non-link nodes (such as Figure 2As shown). When determining the moving distance of a non-linked node in the corresponding moving direction, the distance between the exit nodes must be considered. After the entry node moves, the distance of the non-linked node cannot be less than the preset distance between nodes. That is to say, for the moving direction corresponding to the non-linked node, the difference between the vector length of V2 and the moving distance must be greater than or equal to the preset distance between nodes. Then, in the process of determining the moving distance of a non-linked node, first, it is necessary to determine whether the difference between the vector length of the second coordinate vector and the preset distance between adjacent nodes is greater than or equal to the preset pixel moving unit distance; if so, the preset pixel moving unit distance is used as the moving distance of each node in the vector direction of the second coordinate vector. Otherwise, the distance difference is used as the moving distance of the non-linked node in the vector direction of the second coordinate vector.
[0053] After the moving direction and moving distance of each node are synchronously determined, each node can complete the moving process, and after the movement is completed, the world coordinate system coordinates of each node in the current frame image can be updated.
[0054] In particular, in this embodiment, each node will also rotate around the coordinate axis of the three-dimensional model itself during the movement process, so as to achieve a visual rendering effect of spiral movement. Specifically, different rotation strategies are set for different nodes. In the process of the first node moving the corresponding moving distance in the corresponding moving direction, the first node is controlled to rotate around the preset coordinate axis of the target rendering object in the vector direction of the first coordinate vector by a preset angle. Among them, the preset angle is a fixed angle value, and the same angle is rotated every time it rotates. In the process of each node except the first node moving in the corresponding moving direction, each node is controlled to rotate around the preset coordinate axis of the target rendering object in the vector direction of the second coordinate vector, and the rotation angle is the angle rotated by the previous node adjacent to each node in the process of updating the coordinates in the previous frame image. Further, for the non-linked nodes in each node except the first node, in the process of each non-linked node moving in the corresponding moving direction, each non-linked node can be controlled to rotate in the vector direction of the third coordinate vector of the adjacent next node and the previous node in the previous frame image, and the rotation angle is less than or equal to the angle rotated by the previous node adjacent to each node in the process of updating the coordinates in the previous frame image. This setting can make the rotation rendering effect smoother and less abrupt.
[0055] The technical solution of the disclosed embodiment can obtain an interactive operation instruction of the user to control the movement of the target rendering object when the user interacts with the target object during the display process of the target rendering object; then, in the interactive process of the user controlling the movement of the target rendering object, for each frame image of the target rendering object, update the depth information of the first node of the three-dimensional model of the target rendering object in the current frame image; determine the target coordinates of the first node in the world coordinate system corresponding to the current frame image according to the screen coordinates and depth information corresponding to the movement trajectory corresponding to the interactive operation instruction in the current frame image; use the target coordinates as the overall moving target position of the target rendering object, based on the target coordinates and the world coordinate system coordinates of each node in the three-dimensional model in the previous frame image of the current frame image, synchronously update the world coordinate system coordinates of each node in the current frame image frame, and control each node to rotate according to a preset model node rotation strategy during the coordinate update process to complete the image rendering of the target rendering object, thereby obtaining a rendering effect with dynamic depth change and spiral motion. The technical solution of the disclosed embodiment fills the gap in dynamic three-dimensional image rendering solutions with depth changes, and realizes a rendering method in a three-dimensional space with depth, so that the rendered object presents depth changes during the movement of the corresponding trajectory, and different parts of the rendered object also perform curved motion during the movement of the corresponding trajectory.
[0056] Embodiment 2
[0057] The embodiments of the present disclosure can be combined with the various optional solutions in the image rendering method provided in the above embodiments. The image rendering method provided in this embodiment further describes the dynamic rendering process of a three-dimensional image in a scene with an added model sub-unit.
[0058] Figure 4 This is a flow chart of an image rendering method provided by Embodiment 2 of the present disclosure. Figure 4 As shown, the image rendering method provided by this embodiment includes:
[0059] S210: During display of a target rendering object, after obtaining an interactive operation instruction from a user to control movement of the target rendering object, updating depth information of a first node of a three-dimensional model of the target rendering object in a current frame image for each frame image of the target rendering object.
[0060] S220 , determining the target coordinates of the first node in the world coordinate system corresponding to the current frame image according to the screen coordinates corresponding to the moving trajectory corresponding to the interactive operation instruction in the current frame image and the depth information.
[0061] S230. Based on the target coordinates and the world coordinate system coordinates of each node in the three-dimensional model in the previous frame image of the current frame image, the world coordinate system coordinates of each node in the current frame image are synchronously updated, and during the coordinate updating process, each node is controlled to rotate according to a preset model node rotation strategy.
[0062] S240: When the distance between the world coordinate system coordinate of the first node and the preset object position in the space is less than a preset distance threshold, add a preset model subunit before the link node of the tail model subunit of the three-dimensional model.
[0063] Among them, the spatial preset object is a pre-set object with depth information, which can be randomly set at multiple positions in the space where the target rendering object is displayed, or can be set at multiple positions in the space according to a certain setting strategy. When the first node is less than the preset distance threshold from the preset object position in the space, a model update instruction of the target rendering object will be triggered. During the interaction process with the target rendering object, the user can drag the target rendering object and preset the object to each space according to a certain motion trajectory. Therefore, when the client receives the model update instruction during the rendering of the target rendering object, a model subunit will be added to the three-dimensional model of the target rendering object. From the rendering effect of the model update, it is equivalent to increasing the three-dimensional model of the target rendering object in a certain dimension, such as increasing the height and length of the side. The preset objects in the space can be set to a form or content associated with the prop scene, for example, in some small games, the target rendering object is controlled to move to obtain food or game scores, such as snakes.
[0064] In this embodiment, when adding a model subunit, it is preferably added from the end of the model so as not to affect the movement state of the previous node. Specifically, a preset model subunit can be added before the link node of the tail model subunit of the 3D model of the target rendering object. Figure 5 This is a two-dimensional diagram that illustrates the process of adding model subunits. Figure 5 In the figure, the small triangle represents the preset object in the space. When the distance between the first node and the small triangle becomes smaller until it is less than the preset distance value, a preset model subunit (dashed diamond box) is added at the link node before the tail model subunit. The reason for adding it before the tail model subunit is that, usually in the target rendering object model, the head model subunit and the tail model subunit are different in shape structure, and the added preset model subunit is a subunit with unified settings. Of course, if the tail model subunit is connected to the preset model subunit, the added preset model subunit can be directly used as a new tail model subunit.
[0065] S250, adding multiple nodes in the preset model subunit to the three-dimensional model of the target rendering object, and setting the moving direction, moving distance and rotation angle of each newly added node in the current frame image to complete the image rendering of the target rendering object.
[0066] After determining the location of adding the preset model subunit, the rendering parameters of the model subunit are initialized. In a preset model subunit, there are usually multiple nodes. The more nodes there are, the smaller the corresponding skin coverage is. The better the effect after rendering, the more realistic the movement state of the target rendering object is.
[0067] In order to avoid the abrupt rendering effect of the newly added model subunit, the initial value of the rendering parameter of each node of the newly added model subunit is usually set to the rendering parameter value of the node of the previous model subunit adjacent to it. For example, the coordinate position and rotation angle of all nodes in the newly added preset model subunit are set to be the same as the corresponding values of the node in front of the tail model subunit. After the model is updated, the rendering effect of the target rendering object can show the effect of the dynamic growth of the snake model.
[0068] In a preferred embodiment, animation effects can also be added to non-node parts of the 3D model of the target rendering object. For example, if the target rendering object is a bug, the non-node parts of the bug model include wings or antennae of the bug, and special effects can be added to the parts, such as flapping wings, to increase the overall vivid and realistic rendering effect.
[0069] In addition, the technical solution of this embodiment is particularly suitable for a target rendering object that is a streamlined object model, and the streamlined object is a dragon or snake-shaped object.
[0070] In a specific example, the target rendering object is a dragon, and its specific 3D model is as follows: Figure 6 As shown, the dots represent nodes in the three-dimensional model, and the nodes at the positions indicated by the two arrows are the positions of the two linked nodes. Figure 6 In the figure, the dragon model is divided into three sections with the location of the link node as the dividing line. These three sections are the head model sub-unit, the middle body of the dragon obtained by linking multiple identical model sub-units in the middle, and the model position sub-unit.
[0071] Through the technical solution of this embodiment, after the user triggers the corresponding props or animation display, the initial rendering state of the dragon can be displayed on the terminal screen. Then, in the process of interacting with the terminal interface, the user can drag the dragon head with his hand to make the dragon move according to the user's gesture sliding trajectory. In the process of moving the dragon, the client updates the depth information of the first node (the first node of the head) of the dragon's three-dimensional model in each frame image in the current frame image; then, according to the screen coordinates and depth information corresponding to the user's gesture movement trajectory in the current frame image, the target coordinates of the first node in the world coordinate system corresponding to the current frame image are determined; finally, based on the target coordinates and the world coordinate system coordinates of each node in the three-dimensional model of the dragon in the previous frame image of the current frame image, the world coordinate system coordinates of each node in the current frame image frame are synchronously updated, and in the process of updating the coordinates, each node is controlled to rotate according to the preset model node rotation strategy, presenting a rendering effect of a three-dimensional dragon with depth changes and position changes.
[0072] Furthermore, the user can drag the dragon to move and play small games such as eating gold coins, wherein the location of the gold coins is a preset location where a node is added with prompt information. When the dragon eats a gold coin, the length of the dragon's body can be increased by one unit. The body of the dragon of this unit length corresponds to a preset model sub-unit. Preferably, a preset model sub-unit is added in front of the dragon's tail sub-model, and the rendering parameters of the model sub-unit are assigned, so that a rendering effect of a dragon in motion, with dynamic depth changes and a growing body can be obtained. In addition, in the three-dimensional model of the dragon, the dragon's horns, tail, feet and other non-skeletal node parts can also be rendered with animation special effects, making the rendering effect of the entire dragon more vivid and agile.
[0073] To make the dragon's motion and rendering effects more realistic and the dynamic changes look smoother, the skinning effect can be set to Figure 7 The structure covers the surface of the model, and the unit area of the skin should not be set too large.
[0074] The technical solution of the disclosed embodiment is as follows: during the display process of the target rendering object, if the user interacts with the target object, the interactive operation instruction of the user to control the movement of the target rendering object can be obtained; then, during the interactive process of the user controlling the movement of the target rendering object, for each frame image of the target rendering object, the depth information of the first node of the three-dimensional model of the target rendering object in the current frame image is updated; according to the screen coordinates and depth information corresponding to the movement trajectory corresponding to the interactive operation instruction in the current frame image, the target coordinates of the first node in the world coordinate system corresponding to the current frame image are determined; the target coordinates are used as the overall moving target position of the target rendering object, based on the target coordinates and the world coordinate system coordinates of each node in the three-dimensional model in the previous frame image of the current frame image, the world coordinate system coordinates of each node in the current frame image are synchronously updated, and in the process of updating the coordinates, each node is controlled to rotate according to a preset model node rotation strategy, so as to complete the image rendering of the target rendering object, thereby obtaining a rendering effect with dynamic depth change and spiral motion. In addition, when the distance between the coordinates of the first node and the preset position of the node adding prompt information is less than the preset distance threshold, a preset model subunit can be added in front of the link node of the tail model subunit of the three-dimensional model to update the model of the target rendering object. The technical solution of the disclosed embodiment fills the gap in the dynamic three-dimensional image rendering solution with depth changes, and realizes a rendering method in a three-dimensional space with depth, so that the rendering object presents depth changes during the movement of the corresponding trajectory, and different parts of the rendering object also perform curved motion during the movement of the corresponding trajectory, and the model of the target rendering object can also grow dynamically.
[0075] Embodiment 3
[0076] Figure 8 This is a schematic diagram of the structure of an image rendering device provided in the third embodiment of the present disclosure. The image rendering device provided in this embodiment is suitable for dynamic three-dimensional image rendering scenes, and is particularly suitable for dynamic three-dimensional image rendering in some small games, special effects or prop scenes that can interact with users. The device can be implemented in the form of software and / or hardware, and the device can be configured in an electronic device, such as a mobile terminal or a server device.
[0077] like Figure 8 As shown, the image rendering device includes: a depth information updating module 310 , a rendering guidance coordinate determining module 320 and an image rendering module 330 .
[0078] Among them, the depth information updating module 310 is used to update the depth information of the first node of the three-dimensional model of the target rendering object in the current frame image for each frame image of the target rendering object after obtaining the user's interactive operation instruction for moving and controlling the target rendering object during the display process of the target rendering object; the rendering guidance coordinate determination module 320 is used to determine the target coordinates of the first node in the world coordinate system corresponding to the current frame image according to the screen coordinates corresponding to the movement trajectory corresponding to the interactive operation instruction in the current frame image and the depth information; the image rendering module 330 is used to synchronously update the world coordinate system coordinates of each node in the current frame image frame based on the target coordinates and the world coordinate system coordinates of each node in the three-dimensional model in the previous frame image of the current frame image, and control each node to rotate according to the preset model node rotation strategy during the coordinate update process to complete the image rendering of the target rendering object.
[0079] The technical solution of the disclosed embodiment is as follows: during the display process of the target rendering object, if the user interacts with the target object, the interactive operation instruction of the user to control the movement of the target rendering object can be obtained; then, during the interactive process of the user controlling the movement of the target rendering object, for each frame image of the target rendering object, the depth information of the first node of the three-dimensional model of the target rendering object in the current frame image is updated; according to the screen coordinates and depth information corresponding to the movement trajectory corresponding to the interactive operation instruction in the current frame image, the target coordinates of the first node in the world coordinate system corresponding to the current frame image are determined; the target coordinates are used as the overall moving target position of the target rendering object, based on the target coordinates and the world coordinate system coordinates of each node in the three-dimensional model in the previous frame image of the current frame image, the world coordinate system coordinates of each node in the current frame image are synchronously updated, and in the process of updating the coordinates, each node is controlled to rotate according to a preset model node rotation strategy, so as to complete the image rendering of the target rendering object, thereby obtaining a rendering effect with dynamic depth change and spiral motion. The technical solution of the disclosed embodiment fills the gap in dynamic three-dimensional image rendering solutions with depth changes, and realizes a rendering method in a three-dimensional space with depth, so that the rendered object presents depth changes during the movement of the corresponding trajectory, and different parts of the rendered object also perform curved motion during the movement of the corresponding trajectory.
[0080] In some optional implementations, the depth information updating module 310 is specifically configured to:
[0081] Determining a node depth variable of the first node in the current frame image according to a cumulative display time of the target rendering object from the start of image display to the current frame image;
[0082] The node depth variable is superimposed on the basis of a preset depth constant, and the superimposed result is updated as the depth information of the first node in the current frame image.
[0083] In some optional implementations, the image rendering module 330 is used to:
[0084] Determine the moving direction and moving distance of the first node according to the target coordinates and the world coordinate system coordinates of the first node in the previous frame image, and move the first node in the corresponding moving direction and the corresponding moving distance to complete the coordinate update of the first node in the current frame image;
[0085] For each node except the first node, the moving direction and moving distance of each node are determined based on the world coordinate system coordinates of each node and its adjacent previous node in the previous frame image, and each node is moved a corresponding moving distance in the corresponding moving direction to complete the coordinate update of each node in the current frame image.
[0086] In some optional implementations, the image rendering module 330 is further configured to:
[0087] Determine a first coordinate vector between the world coordinate system coordinates of the first node in the previous frame image and the target coordinates;
[0088] Using the vector direction of the first coordinate vector as the moving direction of the first node;
[0089] When the preset pixel movement unit distance is less than or equal to the vector length of the first coordinate vector, the preset pixel movement unit distance is used as the movement distance of the first node in the corresponding movement direction; otherwise, the vector length of the first coordinate vector is used as the movement distance of the first node in the corresponding movement direction.
[0090] In some optional implementations, the image rendering module 330 is further configured to:
[0091] For each node except the first node, determine a second coordinate vector between the world coordinate system coordinates of each node and its adjacent previous node in the previous frame image;
[0092] Using the vector direction of the second coordinate vector as the moving direction of each node;
[0093] When the preset pixel movement unit distance is less than or equal to the vector length of the second coordinate vector, the preset pixel movement unit distance is used as the movement distance of each node in the corresponding movement direction; otherwise, the vector length of the second coordinate vector is used as the movement distance of each node in the corresponding movement direction.
[0094] In some optional implementations, the image rendering module 330 is further configured to:
[0095] When each node except the first node is not a link node between each model sub-unit of the three-dimensional model, determining whether the difference between the vector length of the second coordinate vector and the preset distance between adjacent nodes is greater than or equal to the preset pixel movement unit distance;
[0096] If so, the preset pixel movement unit distance is used as the movement distance of each node in the vector direction of the second coordinate vector; otherwise, the distance difference is used as the movement distance of each node in the vector direction of the second coordinate vector.
[0097] In some optional implementations, the image rendering module 330 is further configured to:
[0098] In a process in which the first node moves a corresponding moving distance in a corresponding moving direction, controlling the first node to rotate around a preset coordinate axis of the target rendering object in a vector direction of the first coordinate vector by a preset angle;
[0099] During the process of each node except the first node moving a corresponding moving distance in a corresponding moving direction, each node is controlled to rotate around the preset coordinate axis of the target rendering object in the vector direction toward the second coordinate vector, and the rotation angle is the angle of rotation of the previous node adjacent to each node during the process of updating the coordinates in the previous frame image.
[0100] In some optional implementations, the image rendering module 330 is further configured to:
[0101] In the process of each node moving a corresponding distance in a corresponding moving direction, each node is controlled to rotate toward the vector direction of the third coordinate vector of the subsequent node and the previous node adjacent to it in the previous frame image, and the rotation angle is less than or equal to the angle of rotation of the previous node adjacent to each node in the process of updating the coordinates in the previous frame image.
[0102] In some optional implementations, the image rendering apparatus further includes a rendering object model updating module, which is used to:
[0103] When the distance between the world coordinate system coordinate of the first node and the preset object position in the space is less than a preset distance threshold, adding a preset model subunit before the link node of the tail model subunit of the three-dimensional model;
[0104] Add multiple nodes in the preset model subunit to the three-dimensional model of the target rendering object, and set the moving direction, moving distance and rotation angle of each newly added node in the current frame image.
[0105] In some optional implementations, the image rendering device further includes an animation effect adding module, which is used to add animation effects to non-node parts in the three-dimensional model of the target rendering object.
[0106] In some optional implementations, the target rendering object includes a streamlined object, and the streamlined object is a dragon or snake-shaped object.
[0107] The image rendering device provided in the embodiments of the present disclosure can execute the image rendering method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0108] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0109] Embodiment 4
[0110] Reference below Fig. 9 , which shows an electronic device (eg, Fig. 9 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0111] like Fig. 9As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 406 to a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0112] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Fig. 9 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0113] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 409, or installed from a storage device 406, or installed from a ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the image rendering method of the embodiment of the present disclosure are executed.
[0114] The electronic device provided by the embodiment of the present disclosure and the image rendering method provided by the above embodiment belong to the same disclosed concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0115] Embodiment 5
[0116] The embodiments of the present disclosure provide a computer storage medium on which a computer program is stored. When the program is executed by a processor, the image rendering method provided by the above embodiments is implemented.
[0117] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM) or a flash memory (FLASH), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0118] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0119] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0120] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0121] During the display process of the target rendering object, after obtaining an interactive operation instruction of the user to move and control the target rendering object, for each frame image of the target rendering object, updating the depth information of the first node of the three-dimensional model of the target rendering object in the current frame image;
[0122] Determine the target coordinates of the first node in the world coordinate system corresponding to the current frame image according to the screen coordinates corresponding to the moving trajectory corresponding to the interactive operation instruction in the current frame image and the depth information;
[0123] Based on the target coordinates and the world coordinate system coordinates of each node in the three-dimensional model in the previous frame image of the current frame image, the world coordinate system coordinates of each node in the current frame image are synchronously updated, and during the coordinate updating process, each node is controlled to rotate according to a preset model node rotation strategy to complete the image rendering of the target rendering object.
[0124] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0125] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0126] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The names of the units and modules do not, in some cases, limit the units and modules themselves. For example, the data generation module may also be described as a "video data generation module".
[0127] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Parts (ASSP), System on Chip (SOC), Complex Programmable Logic Device (CPLD), etc.
[0128] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0129] According to one or more embodiments of the present disclosure, [Example 1] provides an image rendering method, the method comprising:
[0130] During the display process of the target rendering object, after obtaining an interactive operation instruction of the user to move and control the target rendering object, for each frame image of the target rendering object, updating the depth information of the first node of the three-dimensional model of the target rendering object in the current frame image;
[0131] Determine the target coordinates of the first node in the world coordinate system corresponding to the current frame image according to the screen coordinates corresponding to the moving trajectory corresponding to the interactive operation instruction in the current frame image and the depth information;
[0132] Based on the target coordinates and the world coordinate system coordinates of each node in the three-dimensional model in the previous frame image of the current frame image, the world coordinate system coordinates of each node in the current frame image are synchronously updated, and during the coordinate updating process, each node is controlled to rotate according to a preset model node rotation strategy to complete the image rendering of the target rendering object.
[0133] According to one or more embodiments of the present disclosure, [Example 2] provides an image rendering method, further comprising:
[0134] In some optional implementations, updating the depth information of the first node of the three-dimensional model of the target rendering object in the current frame image includes:
[0135] Determining a node depth variable of the first node in the current frame image according to a cumulative display time of the target rendering object from the start of image display to the current frame image;
[0136] The node depth variable is superimposed on the basis of a preset depth constant, and the superimposed result is updated as the depth information of the first node in the current frame image.
[0137] According to one or more embodiments of the present disclosure, [Example 3] provides an image rendering method, further comprising:
[0138] In some optional implementations, synchronously updating the world coordinate system coordinates of each node in the current frame image frame based on the target coordinates and the world coordinate system coordinates of each node in the three-dimensional model in a previous frame image of the current frame image includes:
[0139] Determine the moving direction and moving distance of the first node according to the target coordinates and the world coordinate system coordinates of the first node in the previous frame image, and move the first node in the corresponding moving direction and the corresponding moving distance to complete the coordinate update of the first node in the current frame image;
[0140] For each node except the first node, the moving direction and moving distance of each node are determined based on the world coordinate system coordinates of each node and its adjacent previous node in the previous frame image, and each node is moved a corresponding moving distance in the corresponding moving direction to complete the coordinate update of each node in the current frame image.
[0141] According to one or more embodiments of the present disclosure, [Example 4] provides an image rendering method, further comprising:
[0142] In some optional implementations, determining the moving direction and moving distance of the first node according to the target coordinates and the world coordinate system coordinates of the first node in the previous frame of image includes:
[0143] Determine a first coordinate vector between the world coordinate system coordinates of the first node in the previous frame image and the target coordinates;
[0144] Using the vector direction of the first coordinate vector as the moving direction of the first node;
[0145] When the preset pixel movement unit distance is less than or equal to the vector length of the first coordinate vector, the preset pixel movement unit distance is used as the movement distance of the first node in the corresponding movement direction; otherwise, the vector length of the first coordinate vector is used as the movement distance of the first node in the corresponding movement direction.
[0146] According to one or more embodiments of the present disclosure, [Example 5] provides an image rendering method, further comprising:
[0147] In some optional implementations,
[0148] For each node except the first node, determining the moving direction and moving distance of each node according to the world coordinate system coordinates of each node and a previous node adjacent to the node in the previous frame image, includes:
[0149] For each node except the first node, determine a second coordinate vector between the world coordinate system coordinates of each node and its adjacent previous node in the previous frame image;
[0150] Using the vector direction of the second coordinate vector as the moving direction of each node;
[0151] When the preset pixel movement unit distance is less than or equal to the vector length of the second coordinate vector, the preset pixel movement unit distance is used as the movement distance of each node in the corresponding movement direction; otherwise, the vector length of the second coordinate vector is used as the movement distance of each node in the corresponding movement direction.
[0152] According to one or more embodiments of the present disclosure, [Example 6] provides an image rendering method, further comprising:
[0153] In some optional implementations, when each node except the first node is not a link node between each model sub-unit of the three-dimensional model, determining the moving direction and moving distance of each node except the first node according to the world coordinate system coordinates of each node and a previous node adjacent to it in the previous frame image, further includes:
[0154] Determine whether the difference between the vector length of the second coordinate vector and the preset distance between adjacent nodes is greater than or equal to the preset pixel movement unit distance;
[0155] If so, the preset pixel movement unit distance is used as the movement distance of each node in the vector direction of the second coordinate vector; otherwise, the distance difference is used as the movement distance of each node in the vector direction of the second coordinate vector.
[0156] According to one or more embodiments of the present disclosure, [Example 7] provides an image rendering method, further comprising:
[0157] In some optional implementations, controlling each node to rotate according to a preset model node rotation strategy during the coordinate update process includes:
[0158] In a process in which the first node moves a corresponding moving distance in a corresponding moving direction, controlling the first node to rotate around a preset coordinate axis of the target rendering object in a vector direction of the first coordinate vector by a preset angle;
[0159] During the process of each node except the first node moving a corresponding moving distance in a corresponding moving direction, each node is controlled to rotate around the preset coordinate axis of the target rendering object in the vector direction toward the second coordinate vector, and the rotation angle is the angle of rotation of the previous node adjacent to each node during the process of updating the coordinates in the previous frame image.
[0160] According to one or more embodiments of the present disclosure, [Example 8] provides an image rendering method, further comprising:
[0161] In some optional implementations, when each node except the first node is not a link node between each model sub-unit of the three-dimensional model, controlling each node to rotate according to a preset model node rotation strategy during the coordinate update process further includes:
[0162] In the process of each node moving a corresponding distance in a corresponding moving direction, each node is controlled to rotate toward the vector direction of the third coordinate vector of the subsequent node and the previous node adjacent to it in the previous frame image, and the rotation angle is less than or equal to the angle of rotation of the previous node adjacent to each node in the process of updating the coordinates in the previous frame image.
[0163] According to one or more embodiments of the present disclosure, [Example 9] provides an image rendering method, further comprising:
[0164] In some optional implementations, the method further includes:
[0165] When the distance between the world coordinate system coordinate of the first node and the preset object position in the space is less than a preset distance threshold, adding a preset model subunit before the link node of the tail model subunit of the three-dimensional model;
[0166] Add multiple nodes in the preset model subunit to the three-dimensional model of the target rendering object, and set the moving direction, moving distance and rotation angle of each newly added node in the current frame image.
[0167] According to one or more embodiments of the present disclosure, [Example 10] provides an image rendering method, further comprising:
[0168] In some optional implementations, the method further includes:
[0169] Add animation effects to non-node parts of the three-dimensional model of the target rendering object.
[0170] According to one or more embodiments of the present disclosure, [Example 11] provides an image rendering method, further comprising:
[0171] In some optional implementations, the target rendering object includes a streamlined object, and the streamlined object is a dragon or snake-shaped object.
[0172] According to one or more embodiments of the present disclosure, [Example 12] provides an image rendering device, including:
[0173] A depth information updating module is used to update the depth information of the first node of the three-dimensional model of the target rendering object in the current frame image for each frame image of the target rendering object after obtaining an interactive operation instruction of the user to move and control the target rendering object during the display process of the target rendering object;
[0174] A rendering guide coordinate determination module, used to determine the target coordinates of the first node in the world coordinate system corresponding to the current frame image according to the screen coordinates corresponding to the movement trajectory corresponding to the interactive operation instruction in the current frame image and the depth information;
[0175] An image rendering module is used to synchronously update the world coordinate system coordinates of each node in the current frame image frame based on the target coordinates and the world coordinate system coordinates of each node in the three-dimensional model in the previous frame image of the current frame image, and control each node to rotate according to a preset model node rotation strategy during the coordinate update process to complete the image rendering of the target rendering object.
[0176] According to one or more embodiments of the present disclosure, [Example 13] provides an image rendering device, further comprising:
[0177] In some optional implementations, the depth information updating module is specifically configured to:
[0178] Determining a node depth variable of the first node in the current frame image according to a cumulative display time of the target rendering object from the start of image display to the current frame image;
[0179] The node depth variable is superimposed on the basis of a preset depth constant, and the superimposed result is updated as the depth information of the first node in the current frame image.
[0180] According to one or more embodiments of the present disclosure, [Example 14] provides an image rendering device, further comprising:
[0181] In some optional implementations, in some optional implementations, the image rendering module is used to:
[0182] Determine the moving direction and moving distance of the first node according to the target coordinates and the world coordinate system coordinates of the first node in the previous frame image, and move the first node in the corresponding moving direction and the corresponding moving distance to complete the coordinate update of the first node in the current frame image;
[0183] For each node except the first node, the moving direction and moving distance of each node are determined based on the world coordinate system coordinates of each node and its adjacent previous node in the previous frame image, and each node is moved a corresponding moving distance in the corresponding moving direction to complete the coordinate update of each node in the current frame image.
[0184] According to one or more embodiments of the present disclosure, [Example 15] provides an image rendering device, further comprising:
[0185] In some optional implementations, the image rendering module is further used to:
[0186] Determine a first coordinate vector between the world coordinate system coordinates of the first node in the previous frame image and the target coordinates;
[0187] Using the vector direction of the first coordinate vector as the moving direction of the first node;
[0188] When the preset pixel movement unit distance is less than or equal to the vector length of the first coordinate vector, the preset pixel movement unit distance is used as the movement distance of the first node in the corresponding movement direction; otherwise, the vector length of the first coordinate vector is used as the movement distance of the first node in the corresponding movement direction.
[0189] According to one or more embodiments of the present disclosure, [Example 16] provides an image rendering device, further comprising:
[0190] In some optional implementations, the image rendering module is further used to:
[0191] For each node except the first node, determine a second coordinate vector between the world coordinate system coordinates of each node and its adjacent previous node in the previous frame image;
[0192] Using the vector direction of the second coordinate vector as the moving direction of each node;
[0193] When the preset pixel movement unit distance is less than or equal to the vector length of the second coordinate vector, the preset pixel movement unit distance is used as the movement distance of each node in the corresponding movement direction; otherwise, the vector length of the second coordinate vector is used as the movement distance of each node in the corresponding movement direction.
[0194] According to one or more embodiments of the present disclosure, [Example 17] provides an image rendering device, further comprising:
[0195] In some optional implementations, the image rendering module is further used to:
[0196] When each node except the first node is not a link node between each model sub-unit of the three-dimensional model, determining whether the difference between the vector length of the second coordinate vector and the preset distance between adjacent nodes is greater than or equal to the preset pixel movement unit distance;
[0197] If so, the preset pixel movement unit distance is used as the movement distance of each node in the vector direction of the second coordinate vector; otherwise, the distance difference is used as the movement distance of each node in the vector direction of the second coordinate vector.
[0198] According to one or more embodiments of the present disclosure, [Example 18] provides an image rendering device, further comprising:
[0199] In some optional implementations, the image rendering module is further used to:
[0200] In a process in which the first node moves a corresponding moving distance in a corresponding moving direction, controlling the first node to rotate around a preset coordinate axis of the target rendering object in a vector direction of the first coordinate vector by a preset angle;
[0201] During the process of each node except the first node moving a corresponding moving distance in a corresponding moving direction, each node is controlled to rotate around the preset coordinate axis of the target rendering object in the vector direction toward the second coordinate vector, and the rotation angle is the angle of rotation of the previous node adjacent to each node during the process of updating the coordinates in the previous frame image.
[0202] According to one or more embodiments of the present disclosure, [Example 19] provides an image rendering device, further comprising:
[0203] In some optional implementations, the image rendering module is further used to:
[0204] In the process of each node moving a corresponding distance in a corresponding moving direction, each node is controlled to rotate toward the vector direction of the third coordinate vector of the subsequent node and the previous node adjacent to it in the previous frame image, and the rotation angle is less than or equal to the angle of rotation of the previous node adjacent to each node in the process of updating the coordinates in the previous frame image.
[0205] According to one or more embodiments of the present disclosure, [Example 20] provides an image rendering device, further comprising:
[0206] In some optional implementations, the image rendering apparatus further includes a rendering object model updating module, which is used to:
[0207] When the distance between the world coordinate system coordinate of the first node and the preset object position in the space is less than a preset distance threshold, adding a preset model subunit before the link node of the tail model subunit of the three-dimensional model;
[0208] Add multiple nodes in the preset model subunit to the three-dimensional model of the target rendering object, and set the moving direction, moving distance and rotation angle of each newly added node in the current frame image.
[0209] According to one or more embodiments of the present disclosure, [Example 21] provides an image rendering device, further comprising:
[0210] In some optional implementations, the image rendering device further includes an animation effect adding module, which is used to add animation effects to non-node parts in the three-dimensional model of the target rendering object.
[0211] According to one or more embodiments of the present disclosure, [Example 22] provides an image rendering device, further comprising:
[0212] In some optional implementations, the target rendering object includes a streamlined object, and the streamlined object is a dragon or snake-shaped object.
[0213] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0214] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0215] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. An image rendering method, characterized in that: include: During the display process of the target rendering object, after obtaining an interactive operation instruction of the user to move and control the target rendering object, for each frame image of the target rendering object, updating the depth information of the first node of the three-dimensional model of the target rendering object in the current frame image; Determine the target coordinates of the first node in the world coordinate system corresponding to the current frame image according to the screen coordinates corresponding to the moving trajectory corresponding to the interactive operation instruction in the current frame image and the depth information; Based on the target coordinates and the world coordinate system coordinates of each node in the three-dimensional model in the previous frame image of the current frame image, the world coordinate system coordinates of each node in the current frame image are synchronously updated, and during the coordinate update process, each node is controlled to rotate according to a preset model node rotation strategy to complete the image rendering of the target rendering object; The method of synchronously updating the world coordinate system coordinates of each node in the current frame image based on the target coordinates and the world coordinate system coordinates of each node in the three-dimensional model in a previous frame image of the current frame image includes: Determine the moving direction and moving distance of the first node according to the target coordinates and the world coordinate system coordinates of the first node in the previous frame image, and move the first node in the corresponding moving direction and the corresponding moving distance to complete the coordinate update of the first node in the current frame image; For each node except the first node, the moving direction and moving distance of each node are determined based on the world coordinate system coordinates of each node and its adjacent previous node in the previous frame image, and each node is moved a corresponding moving distance in the corresponding moving direction to complete the coordinate update of each node in the current frame image.
2. The method according to claim 1, characterized in that The updating of the depth information of the first node of the three-dimensional model of the target rendering object in the current frame image includes: Determining a node depth variable of the first node in the current frame image according to a cumulative display time of the target rendering object from the start of image display to the current frame image; The node depth variable is superimposed on the basis of a preset depth constant, and the superimposed result is updated as the depth information of the first node in the current frame image.
3. The method according to claim 1, characterized in that Determining the moving direction and moving distance of the first node according to the target coordinates and the world coordinate system coordinates of the first node in the previous frame image includes: Determine a first coordinate vector between the world coordinate system coordinates of the first node in the previous frame image and the target coordinates; Using the vector direction of the first coordinate vector as the moving direction of the first node; When the preset pixel movement unit distance is less than or equal to the vector length of the first coordinate vector, the preset pixel movement unit distance is used as the movement distance of the first node in the corresponding movement direction; otherwise, the vector length of the first coordinate vector is used as the movement distance of the first node in the corresponding movement direction.
4. The method according to claim 3, characterized in that For each node except the first node, determining the moving direction and moving distance of each node according to the world coordinate system coordinates of each node and a previous node adjacent to the node in the previous frame image, includes: For each node except the first node, determine a second coordinate vector between the world coordinate system coordinates of each node and its adjacent previous node in the previous frame image; Using the vector direction of the second coordinate vector as the moving direction of each node; When the preset pixel movement unit distance is less than or equal to the vector length of the second coordinate vector, the preset pixel movement unit distance is used as the movement distance of each node in the corresponding movement direction; otherwise, the vector length of the second coordinate vector is used as the movement distance of each node in the corresponding movement direction.
5. The method according to claim 4, characterized in that When each node except the first node is not a link node between each model sub-unit of the three-dimensional model, for each node except the first node, according to the world coordinate system coordinates of each node and the previous node adjacent to it in the previous frame image, determining the moving direction and moving distance of each node, further comprising: Determine whether the difference between the vector length of the second coordinate vector and the preset distance between adjacent nodes is greater than or equal to the preset pixel movement unit distance; If so, the preset pixel movement unit distance is used as the movement distance of each node in the vector direction of the second coordinate vector; otherwise, the distance difference is used as the movement distance of each node in the vector direction of the second coordinate vector.
6. The method according to claim 5, characterized in that The process of controlling each node to rotate according to a preset model node rotation strategy during the coordinate update process includes: In a process in which the first node moves a corresponding moving distance in a corresponding moving direction, controlling the first node to rotate around a preset coordinate axis of the target rendering object in a vector direction of the first coordinate vector by a preset angle; During the process of each node except the first node moving a corresponding moving distance in a corresponding moving direction, each node is controlled to rotate around the preset coordinate axis of the target rendering object in the vector direction toward the second coordinate vector, and the rotation angle is the angle of rotation of the previous node adjacent to each node during the process of updating the coordinates in the previous frame image.
7. The method according to claim 6, characterized in that When each node except the first node is not a link node between each model sub-unit of the three-dimensional model, controlling each node to rotate according to a preset model node rotation strategy during the coordinate update process also includes: In the process of each node moving a corresponding distance in a corresponding moving direction, each node is controlled to rotate toward the vector direction of the third coordinate vector of the subsequent node and the previous node adjacent to it in the previous frame image, and the rotation angle is less than or equal to the angle of rotation of the previous node adjacent to each node in the process of updating the coordinates in the previous frame image.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: When the distance between the world coordinate system coordinate of the first node and the preset object position in the space is less than a preset distance threshold, adding a preset model subunit before the link node of the tail model subunit of the three-dimensional model; Add multiple nodes in the preset model subunit to the three-dimensional model of the target rendering object, and set the moving direction, moving distance and rotation angle of each newly added node in the current frame image.
9. The method according to claim 8, characterized in that The method further comprises: Add animation effects to non-node parts of the three-dimensional model of the target rendering object.
10. The method according to claim 9, characterized in that The target rendering object includes a streamlined object, and the streamlined object is a dragon or snake-shaped object.
11. An image rendering device, characterized in that: include: A depth information updating module is used to update the depth information of the first node of the three-dimensional model of the target rendering object in the current frame image for each frame image of the target rendering object after obtaining an interactive operation instruction of the user to move and control the target rendering object during the display process of the target rendering object; A rendering guide coordinate determination module, used to determine the target coordinates of the first node in the world coordinate system corresponding to the current frame image according to the screen coordinates corresponding to the movement trajectory corresponding to the interactive operation instruction in the current frame image and the depth information; An image rendering module is used to synchronously update the world coordinate system coordinates of each node in the current frame image based on the target coordinates and the world coordinate system coordinates of each node in the three-dimensional model in the previous frame image of the current frame image, and control each node to rotate according to a preset model node rotation strategy during the coordinate update process to complete the image rendering of the target rendering object; The image rendering module is specifically used for: Determine the moving direction and moving distance of the first node according to the target coordinates and the world coordinate system coordinates of the first node in the previous frame image, and move the first node in the corresponding moving direction and the corresponding moving distance to complete the coordinate update of the first node in the current frame image; For each node except the first node, the moving direction and moving distance of each node are determined based on the world coordinate system coordinates of each node and its adjacent previous node in the previous frame image, and each node is moved a corresponding moving distance in the corresponding moving direction to complete the coordinate update of each node in the current frame image.
12. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the image rendering method as described in any one of claims 1-10.
13. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to perform the image rendering method according to any one of claims 1 to 10 when executed by a computer processor.
Citation Information
Patent Citations
Three-dimensional interface display device, method and terminal
CN102523473A
Image data processing method and device, computer equipment and storage medium
CN110111235A