Virtual image rendering method and device, storage medium and electronic equipment
By determining the positional relationship of the virtual space and adjusting the shape of the target surface during virtual avatar rendering, the problem of modeling in virtual avatar rendering is solved, and a more efficient rendering effect is achieved.
Patent Information
- Application Number
- CN202411314164.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-06-03
AI Technical Summary
In the prior art, the mold penetration phenomenon occurs during the rendering of virtual images, and no effective solution has been proposed.
By obtaining a control signal for controlling the virtual image, the virtual image is controlled to perform matching virtual actions, and the spatial position relationship between the multiple virtual spaces associated with the virtual image is determined during the execution. When the target space position relationship between multiple virtual spaces meets the preset conditions, the rendering result of the target surface of the virtual image is determined based on the position relationship to adjust the shape of the surface to avoid passing through the mold.
It effectively avoids the phenomenon of virtual images penetrating during rendering, and improves the rendering effect and production efficiency.
Smart Images

Figure CN120088378A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer modeling, and in particular, to a method and apparatus for rendering a virtual image, a storage medium, and an electronic device. Background Art
[0002] In fields such as movies, games, animations, virtual reality, etc., in order to make the actions of virtual characters generated by a computer look more realistic and smooth, and to reduce the workload of virtual character painters and improve production efficiency, motion capture technology is usually used to determine a virtual object model that matches the real human body in the real world in a modeling software, and through the actions of the human body, obtain the actions of the virtual object model in the computer.
[0003] During the motion capture process, since there are differences between the real human body and the virtual model, it is easy to cause intersections between different parts of the virtual model when the human body and some of its actions are reflected on the virtual model. That is to say, in the related art, there will be model penetration during the rendering of the virtual image.
[0004] For the above problems, no effective solution has been proposed yet. Summary of the Invention
[0005] Embodiments of this application provide a method and apparatus for rendering a virtual image, a storage medium, and an electronic device to at least solve the technical problem of model penetration during the rendering of a virtual image in the current related art.
[0006] According to one aspect of the embodiments of this application, a method for rendering a virtual image is provided, including: obtaining a control signal for controlling the virtual image; in response to the control signal, controlling the virtual image to perform a virtual action matching the control signal; during the process of the virtual image performing the virtual action, determining the spatial position relationship between a plurality of virtual spaces associated with the virtual image, where the virtual space is a virtual space bound to a virtual part of the virtual image; when the target spatial position relationship between a first virtual space and a second virtual space among the plurality of virtual spaces satisfies a target condition, determining the rendering result of the target surface of the virtual image according to the target spatial position relationship, where the target surface is a virtual surface where a first virtual part and a second virtual part are in contact with each other, the first virtual space is bound to the first virtual part, and the second virtual space is bound to the second virtual part.
[0007] According to another aspect of the embodiments of the present application, there is also provided a rendering device for a virtual avatar, including: an acquisition unit, configured to acquire a control signal for controlling the virtual avatar; a control unit, configured to control the virtual avatar to perform a virtual action matching the control signal in response to the control signal; a first determination unit, configured to determine the spatial position relationship between a plurality of virtual spaces associated with the virtual avatar during the execution of the virtual action by the virtual avatar, where the virtual space is a virtual space bound to a virtual part of the virtual avatar; a second determination unit, configured to determine the rendering result of the target surface of the virtual avatar according to the target spatial position relationship when the target spatial position relationship between a first virtual space and a second virtual space among the plurality of virtual spaces meets the target condition, where the target surface is a virtual surface where a first virtual part and a second virtual part are in contact with each other, the first virtual space is bound to the first virtual part, and the second virtual space is bound to the second virtual part.
[0008] Optionally, the above-mentioned rendering device for a virtual avatar further includes: a third determination unit, configured to acquire the current positions of a plurality of virtual joints for driving the virtual avatar during the execution of the virtual action by the virtual avatar, where the virtual part includes a virtual joint; determine the current spatial positions of the virtual spaces respectively bound to the plurality of virtual joints according to the current positions of the plurality of virtual joints and the vertex sets respectively matched with the plurality of virtual joints, where the vertex set includes a plurality of vertex objects for indicating the image surface of the virtual avatar.
[0009] Optionally, the above-mentioned third determination unit is configured to: determine the current vertex positions of a plurality of current vertex objects according to the current position of the current virtual joint among the plurality of virtual joints and the relative position relationships between the plurality of current vertex objects and the current virtual joint respectively, where the current vertex object is a vertex object included in the current vertex set matched with the current virtual joint; determine the current spatial position of the current virtual space bound to the plurality of current virtual joints according to the coordinate intervals indicated by the current vertex positions of the plurality of current vertex objects respectively.
[0010] Optionally, the above-mentioned rendering device for a virtual avatar further includes: a fourth determination unit, configured to determine that the target spatial position relationship between the first virtual space and the second virtual space meets the target condition when the current vertex position of the first vertex object in the first vertex set associated with the first virtual space is located in the second virtual space; determine that the target spatial position relationship between the first virtual space and the second virtual space meets the target condition when the current vertex position of the second vertex object in the second vertex set associated with the second virtual space is located in the first virtual space.
[0011] Optionally, the above-mentioned fourth determination unit is configured to: when the current vertex position of the first vertex object is located in the second virtual space, update the current vertex position of the first vertex object according to the spatial surface position of the second virtual space, where the updated current vertex position of the first vertex object is located outside the second virtual space; when the current vertex position of the second vertex object is located in the first virtual space, update the current vertex position of the second vertex object according to the spatial surface position of the first virtual space, where the updated current vertex position of the second vertex object is located outside the first virtual space.
[0012] Optionally, the above-mentioned second determination unit includes: an acquisition module, configured to acquire the deformation weights of at least one reference surface associated with the target surface; a determination module, configured to respectively determine the deformation results of at least one reference surface according to the deformation weights of at least one reference surface.
[0013] Optionally, the above-mentioned determination module is configured to respectively determine the deformation results of at least one reference surface according to the deformation weight values of at least one reference surface and the numerical relationship between at least one deformation weight value; respectively determine the deformation results of at least one reference surface according to the deformation weight values of at least one reference surface and the reference deformation amount, where the reference deformation amount is a deformation amount determined according to the spatial position relationship between the first vertex position of the reference vertex associated with the target surface, the first virtual space, and the second virtual space.
[0014] Optionally, the above-mentioned second determination unit is further configured to configure deformation weights for at least one reference surface according to the image type of the virtual image; configure deformation weights for at least one reference surface according to the virtual image volume of the virtual image; configure deformation weights for at least one reference surface according to the scene type of the virtual scene where the virtual image is located.
[0015] Optionally, the above-mentioned rendering device of the virtual image further includes: a fifth determination unit, configured to acquire control constraint conditions associated with the target object, where the control signal is determined according to the object action performed by the target object; when the control constraint conditions include at least one joint activity angle range, determine the virtual activity angle range of at least one virtual joint of the virtual image according to at least one joint activity angle range.
[0016] According to another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the above-mentioned rendering method of the virtual image when running.
[0017] According to another aspect of the embodiments of the present application, there is provided a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the virtual character rendering method as described above.
[0018] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to execute the above-mentioned virtual character rendering method through the computer program.
[0019] In the embodiments of the present application, a control signal for controlling a virtual character may be obtained first; then, the virtual character is controlled to execute a virtual action matching the control signal according to the obtained control signal; and during the process of the virtual character executing the virtual action, based on the virtual spaces bound to the virtual parts of the virtual character, the spatial position relationship between multiple virtual spaces is obtained; at the same time, a target condition is preset. If multiple virtual spaces intersect at a certain moment, the position relationship between multiple virtual spaces at this time satisfies the preset condition. It can be understood that when multiple virtual spaces are in an intersecting state, there must be multiple mutually contacting surfaces between multiple virtual spaces. Then, when it is determined that the position relationship between multiple virtual spaces satisfies the preset condition, the contacting surfaces are set as target surfaces, and the target surfaces are rendered to adjust the shapes of the target surfaces, so that the target surfaces after shape adjustment do not intersect with each other, and further, multiple virtual spaces do not intersect with each other, thereby ensuring that the virtual character does not have a penetration phenomenon, and solving the technical problem that a penetration phenomenon occurs during the rendering of a virtual character in the current related technology. Description of the Drawings
[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:
[0021] Figure 1 is a schematic diagram of an application environment of an optional virtual character rendering method according to the embodiments of the present application;
[0022] Figure 2 is a flowchart of an optional virtual character rendering method according to the embodiments of the present application;
[0023] Figure 3 is a schematic diagram of an optional virtual character rendering method according to the embodiments of the present application;
[0024] Figure 4 It is a schematic diagram of another alternative virtual character rendering method according to an embodiment of the present application;
[0025] Figure 5 It is a schematic diagram of another alternative virtual character rendering method according to an embodiment of the present application;
[0026] Figure 6 It is a schematic diagram of yet another alternative virtual character rendering method according to an embodiment of the present application;
[0027] Figure 7 It is a schematic diagram of yet another alternative virtual character rendering method according to an embodiment of the present application;
[0028] Figure 8 It is a schematic diagram of yet another alternative virtual character rendering method according to an embodiment of the present application;
[0029] Figure 9 It is a schematic diagram of yet another alternative virtual character rendering method according to an embodiment of the present application;
[0030] Figure 10 It is a schematic diagram of yet another alternative virtual character rendering method according to an embodiment of the present application;
[0031] Figure 11 It is a flowchart of yet another alternative virtual character rendering method according to an embodiment of the present application;
[0032] Figure 12 It is a schematic diagram of yet another alternative virtual character rendering method according to an embodiment of the present application;
[0033] Figure 13 It is a schematic diagram of a structure of an alternative virtual character rendering device according to an embodiment of the present application;
[0034] Figure 14 It is a schematic diagram of a structure of an alternative electronic device according to an embodiment of the present application. Detailed implementation manners
[0035] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0036] It should be noted that the terms "first", "second", etc. in the description, claims and the above drawings of the present application are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily limit to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0037] According to one aspect of the embodiments of the present application, a virtual avatar rendering method is provided. Optionally, as an alternative implementation, the above virtual avatar rendering method can be but is not limited to being applied to an environment as Figure 1 shown. The reconstruction system of the object-driven model may include but is not limited to a terminal device 102, a network 104, a server 106, a database 108 and a terminal device 110. The terminal device 102 runs a virtual avatar rendering client, and the terminal device 110 runs a client for configuring rendering parameters. The above terminal device 102 and terminal device 110 each include a human-computer interaction screen, a processor and a memory. The human-computer interaction screen is used to display a virtual scene and also provide a human-computer interaction interface to receive human-computer interaction operations for controlling the virtual avatar to perform virtual actions, and the virtual avatar will complete virtual actions matching the control signals in the virtual scene. The processor is used to generate an interaction instruction in response to the above human-computer interaction operation and send the interaction instruction to the server. The memory is used to store relevant data, such as the image attribute information of the virtual avatar and the rendering parameters for rendering the virtual avatar, etc. The attribute information here may include but is not limited to information for identifying the identity and current location of the virtual avatar, etc. Among them, the terminal device 102 runs a virtual avatar rendering client for rendering the surface of the virtual avatar.
[0038] In addition, the server 106 includes a processing engine, and the processing engine is used to perform storage or reading operations on the database 108. Specifically, the processing engine reads information such as the respective spatial positions, control signals, rendering results, etc. of each virtual avatar from the database 108.
[0039] Suppose Figure 1In the terminal device 102, a client for rendering the surface of the virtual avatar runs, and in the terminal device 110, a client for configuring the rendering parameters runs. The specific process of this embodiment is as follows: Steps S102 to S108 are executed through the terminal device 110: Bind a virtual part to the virtual avatar; Establish a virtual space according to the virtual part; Add deformation weights; Calibrate and limit the virtual part;
[0040] Then, step S110 is executed in the terminal device 110, and the configuration result is sent to the server 106 through the network 104. Then, the server 106 forwards the configuration result to the terminal device 102 through the network 104;
[0041] After that, steps S112 to S118 are executed in the terminal device 102: Obtain a control signal for controlling the virtual avatar; In response to the control signal, control the virtual avatar to perform a virtual action matching the control signal; During the process of the virtual avatar performing the virtual action, determine the spatial position relationship between multiple virtual spaces associated with the virtual avatar, where the virtual space is a virtual space bound to the virtual part of the virtual avatar; When the target spatial position relationship between the first virtual space and the second virtual space among the multiple virtual spaces meets the target condition, determine the rendering result of the target surface of the virtual avatar according to the target spatial position relationship, where the target surface is a virtual surface where the first virtual part and the second virtual part are in contact with each other, the first virtual space is bound to the first virtual part, and the second virtual space is bound to the second virtual part;
[0042] Finally, step S120 is executed in the terminal device 102, and the rendering result is sent to the server 106 through the network 104 and saved in the server. When the rendering result data in the terminal device 102 is lost due to equipment failure or other reasons, the terminal device 102 can access the rendering result data saved in the server 106 to achieve local recovery of the rendering result data.
[0043] Optionally, in this embodiment, the above terminal device may be a terminal device configured with a target client, and may include, but is not limited to, at least one of the following: mobile phone (such as Android mobile phone, iOS mobile phone, etc.), laptop computer, tablet computer, handheld computer, MID (Mobile Internet Devices), PAD, desktop computer, smart TV, etc. The target client may be a video client, instant messaging client, browser client, education client, etc. The above network may include, but is not limited to: wired network, wireless network, where the wired network includes: local area network, metropolitan area network, and wide area network, and the wireless network includes: Bluetooth, WIFI, and other networks implementing wireless communication. The above server may be a single server, or a server cluster composed of multiple servers, or a cloud server. The above is only an example, and this embodiment does not make any limitation thereto.
[0044] Optionally, in this embodiment, the above virtual avatar rendering method can be but is not limited to being applied to game terminal applications (referred to as APPs) that complete established social game tasks in a virtual scene, such as virtual confrontation game applications in a Multiplayer Online Battle Arena (MOBA) application; the above social game tasks can be but are not limited to game tasks completed by the virtual characters rendered in the virtual scene by the current player through the rendering of the human-computer interaction object set and the virtual characters controlled by other players through virtual social interactions; the above object set rendering method can also be applied to terminal applications of Multiplayer Online Role-Playing Games (MMORPGs). In such games, the current player can complete social game tasks in the game from the first perspective of the virtual character in the form of role-playing. For example, when the player enters a certain scene in the game, an animation obtained by the above virtual avatar rendering method is played on the game screen. Another example is that the player can use a motion capture device. When the player walks in a certain direction in the real world, the virtual character in the game makes a corresponding virtual action of walking in that direction. Similarly, the player can use the motion capture device to make various actions in the real world, so that the virtual character in the game makes corresponding actions, and then the player can complete game tasks together with other virtual characters. Here, the social game tasks can be but are not limited to running in the application (such as a non-standalone game APP) in the form of a plugin or a small program, or running in the application (such as a standalone game APP) in the game engine. The types of the above game applications can include but are not limited to at least one of the following: Two Dimension (2D) game applications, Three Dimension (3D) game applications, Virtual Reality (VR) game applications, Augmented Reality (AR) game applications, and Mixed Reality (MR) game applications. The above is only an example, and this embodiment does not make any limitations on this.
[0045] In the above embodiments, the virtual character can be controlled to perform virtual actions according to control signals, and during the process of the virtual character performing virtual actions, the rendering result of the surface of the virtual character can be determined based on the positional relationship between different virtual spaces bound to different virtual parts. Specifically, when there are virtual surfaces where the first virtual part and the second virtual part are in contact with each other, the rendering result of the virtual surface of the virtual character is determined according to the positional relationship between the first virtual space bound to the first virtual part and the second virtual space bound to the second virtual part, ensuring that during the motion capture process, the virtual character does not experience model penetration, and solving the technical problem of model penetration occurring during the rendering of virtual characters in related technologies.
[0046] Optionally, as an alternative embodiment, as Figure 2 shown, the above method for rendering a virtual character includes:
[0047] S202, obtaining a control signal for controlling the virtual character;
[0048] S204, in response to the control signal, controlling the virtual character to perform a virtual action matching the control signal;
[0049] S206, during the process of the virtual character performing the virtual action, determining the spatial positional relationship between multiple virtual spaces associated with the virtual character, where the virtual space is a virtual space bound to a virtual part of the virtual character;
[0050] S208, when the target spatial positional relationship between a first virtual space and a second virtual space among the multiple virtual spaces meets the target condition, determining the rendering result of the target surface of the virtual character according to the target spatial positional relationship, where the target surface is a virtual surface where the first virtual part and the second virtual part are in contact with each other, the first virtual space is bound to the first virtual part, and the second virtual space is bound to the second virtual part.
[0051] In an alternative embodiment, the source of the control signal in step S202 may include but is not limited to motion capture devices, human body pose sensors, haptic feedback devices, etc.; the above control signal can be used to control at least one image action state of the virtual character, including but not limited to: the position, orientation, posture, action, facial expression, etc. of the virtual character.
[0052] Furthermore, the virtual actions in step S204 may include but are not limited to: walking, climbing, expressions, dancing, etc.
[0053] Next, since model penetration may occur to the virtual character during the motion capture process, it is necessary to execute step S206 to determine the positional relationship of each virtual space of the virtual character, and determine where the virtual character experiences model penetration based on the positional relationship of each virtual space of the virtual character.
[0054] The virtual space in the above step S206 may include but is not limited to a deformable space, a non-deformable space, a regular-shaped space, an irregular-shaped space, a curved surface-shaped space, a planar-shaped space, and a mixed planar and curved surface-shaped space.
[0055] The spatial position relationship between the above-mentioned multiple virtual spaces may include but is not limited to the spatial distance relationship between the above-mentioned multiple virtual spaces, the angular relationship between the virtual planes corresponding to the spaces, and may also be the contact state relationship between the virtual spaces. For example, in the case where the above spatial position relationship is specifically a spatial distance relationship, the above spatial position relationship may be characterized by the distance between the virtual point objects included in each of the two virtual spaces; again, in the case where the above spatial position relationship is specifically the angular relationship between the virtual planes corresponding to the spaces, the above spatial position relationship may be characterized by the angles of the virtual planes included in each of the two virtual spaces, and again, in the case where the above spatial position relationship is specifically the contact state relationship between the virtual spaces, the above spatial position relationship may be characterized by the contact area between the two virtual spaces. It should be particularly noted that the spatial position relationship does not refer to only one relationship, but may also be a combination of multiple relationships. For example, the above spatial position relationship may simultaneously refer to the spatial distance relationship between the virtual spaces and the angular relationship between the virtual planes corresponding to the spaces, and no specific limitation is made here.
[0056] Further, it should be noted that the virtual part in the above step S206 may include but is not limited to: a certain segment or multiple segments of virtual bones for controlling the virtual image, a certain virtual body part of the virtual image such as a palm, an arm, a calf, etc. Specifically, a virtual space may be established for each segment of the virtual bones of the virtual image, or a virtual space may be established for a combination of multiple segments of virtual bones (such as Figure 12 establishing a virtual space 1201 for the thigh bone 1201 and the calf bone 1203 in
[0057] Then, S208 can be executed. In the above-mentioned embodiment of the present application, the specific content indicated by the target condition in the above step S208 may correspond to the type of the above spatial position relationship. For example, in the case where the above spatial position relationship is specifically the spatial distance relationship between the virtual spaces, the above target condition may be a parameter condition that constrains the spatial distance between the two virtual spaces. Exemplarily, in the case where the above target condition is specifically "the distance between the virtual spaces is less than 0", if the two virtual spaces intersect, it can be determined that the above two virtual spaces meet the above target condition. The following will be combined with Figure 3 to specifically illustrate the above situation where the target condition is met, such as Figure 3As shown, the distance between the virtual space 321 and the adjacent virtual space 322 is 0 without contact. When there is relative movement between the virtual space 321 and the virtual space 322 in the direction towards each other, it can be determined that the virtual space 321 and the virtual space 322 will intersect. At this time, the distance between the virtual space 321 and the virtual space 322 is less than 0. At this time, it can be judged that the virtual space 321 and the virtual space 322 meet the target condition;
[0058] For another example, in the case where the above spatial position relationship is specifically the spatial angle relationship between virtual spaces, the above target condition can be a parameter condition that constrains the angle parameter between the virtual planes corresponding to the two virtual spaces. Exemplarily, when the above target condition is specifically "the angle between the virtual spaces is less than 0", if the two virtual spaces intersect, it can be determined that the above two virtual spaces meet the above target condition. The following combines Figure 3 to specifically illustrate the above situation where the target condition is met, such as Figure 3 As shown, the relative angle between the virtual space 321 and the adjacent virtual space 322 is 0 without contact. When the virtual space 322 rotates clockwise with the edge between the vertex object 302 and the vertex object 303 as the axis, it can be determined that when the rotation angle is less than 180 degrees, the virtual space 321 and the virtual space 322 will intersect. At this time, the angle between the virtual space 321 and the virtual space 322 is less than 0. At this time, it can be judged that the virtual space 321 and the virtual space 322 meet the target condition;
[0059] For another example, in the case where the above spatial position relationship is specifically the contact relationship between virtual spaces, the above target condition can be a parameter condition that constrains the spatial distance between the two virtual spaces. Exemplarily, when the above target condition is specifically "the contact area of the virtual spaces is less than 1", if the two virtual spaces intersect, it can be determined that the above two virtual spaces meet the above target condition. The following combines Figure 3 to specifically illustrate the above situation where the target condition is met, such as Figure 3 As shown, the relative angle between the virtual space 321 and the adjacent virtual space 322 is 0 without contact. When the virtual space 322 rotates clockwise with the edge between the vertex object 302 and the vertex object 303 as the axis, it can be determined that when the rotation angle is less than 180 degrees, the virtual space 321 and the virtual space 322 will intersect. And at this time, the contact area between the virtual space 321 and the virtual space 322 is actually one or more lines. At this time, the contact area between the virtual space 321 and the virtual space 322 is less than 1. At this time, it can be judged that the virtual space 321 and the virtual space 322 meet the target condition.
[0060] The above rendering results may include deformations, textures, colors, transparencies, reflection effects, etc. on the surface of the virtual avatar, which are not specifically limited herein. Further, in the above step S208, the rendering results on the surface of the virtual avatar may be determined according to the above spatial position relationship. For example, in the case where the above target condition is specifically "the distance between virtual spaces is less than 0", if two virtual spaces intersect, it may be determined that the spatial position relationship between the two virtual spaces meets the target condition. At this time, the surface of the virtual avatar is deformed so that the two intersecting virtual spaces are adjusted to a non-intersecting state, and the texture of the surface of the virtual space after the deformation adjustment is adjusted so that the surface of the adjusted virtual space can display the wrinkles on the skin surface of a human body in the real world after performing actions, and the color of the surface of the virtual space after the deformation adjustment is adjusted so that the shadow on the surface of the virtual avatar is close to the shadow on the skin surface of a human body in the real world after performing actions.
[0061] Through the above embodiments of the present application, a control signal for controlling the virtual avatar can be obtained first; then, the virtual avatar can be controlled to perform a virtual action matching the control signal according to the obtained control signal; and during the process of the virtual avatar performing the virtual action, based on the virtual spaces bound to the virtual parts of the virtual avatar, the spatial position relationship between multiple virtual spaces can be obtained; at the same time, a target condition is preset. If multiple virtual spaces intersect at a certain moment, then the position relationship between the multiple virtual spaces at this time meets the preset condition. It can be understood that when multiple virtual spaces are in an intersecting state, there must be multiple mutually contacting surfaces between the multiple virtual spaces. Therefore, when it is determined that the position relationship between the multiple virtual spaces meets the preset condition, the contacting surfaces are set as target surfaces, and the target surfaces are rendered to adjust the shapes of the target surfaces so that the target surfaces after the shape adjustment do not intersect with each other, and further the multiple virtual spaces do not intersect with each other, thus ensuring that the virtual avatar does not have a penetration phenomenon, and solving the technical problem of the penetration phenomenon occurring in the process of rendering the virtual avatar in the current related technologies.
[0062] In an alternative embodiment, before determining the spatial position relationship between multiple virtual spaces associated with the virtual avatar during the process of the virtual avatar performing the virtual action, it includes:
[0063] S1 During the process of the virtual avatar performing the virtual action, obtain the current positions of multiple virtual joints for driving the virtual avatar, where the virtual parts include virtual joints;
[0064] S2 determines the current spatial positions of the virtual spaces respectively bound to the multiple virtual joints according to the current positions of the multiple virtual joints and the vertex sets respectively matched with the multiple virtual joints, where the vertex sets include multiple vertex objects for indicating the surface of the virtual avatar.
[0065] The following combines Figure 3 to illustrate the specific process before determining the spatial position relationship between multiple virtual spaces associated with a virtual avatar during the process of the virtual avatar performing a virtual action.
[0066] As Figure 3 shown, there are virtual joints 311, 312, and 313 in the virtual part. According to the positions where the virtual joints are located, corresponding vertex sets are generated. As Figure 3 shown, the vertex set corresponding to virtual joint 311 includes: vertex objects 301, 302, 303, 304, 305, 306, 307, and 308. Furthermore, the position of virtual space 321 corresponding to virtual joint 311 is determined. Similarly, virtual joints 312 and 313 can determine the positions of corresponding virtual spaces 322 and 323 according to their respective vertex sets.
[0067] Furthermore, in the above steps S1 - S2, during the process of the virtual avatar performing a virtual action, the current positions of the multiple virtual joints used to drive the virtual avatar are obtained. The virtual part includes virtual joints. According to the current positions of the multiple virtual joints and the vertex sets respectively matched with the multiple virtual joints, the current spatial positions of the virtual spaces respectively bound to the multiple virtual joints are determined, where the vertex sets include multiple vertex objects for indicating the surface of the virtual avatar; in an optional implementation manner;
[0068] The above current positions and spatial positions are three - dimensional coordinates in the virtual environment. Through the three - dimensional coordinates of virtual joint 311, the three - dimensional coordinates of each vertex object in the vertex set of virtual joint 311 are determined. The three - dimensional space connected by the vertex objects in the vertex set and other partial vertex objects is a closed space that can contain the corresponding virtual joint and does not cross with other virtual spaces. As Figure 3 shown, the virtual space 321 formed by vertex objects 301, 302, 303, 304, 305, 306, 307, and 308 in the vertex set corresponding to virtual joint 311 in
[0069] Through the above embodiments of the present application, during the process of a virtual avatar performing a virtual action, the current positions of multiple virtual joints for driving the virtual avatar are obtained, where the virtual parts include virtual joints; according to the current positions of the multiple virtual joints respectively, and the vertex sets respectively matched with the multiple virtual joints, the current spatial positions of the virtual spaces respectively bound to the multiple virtual joints are determined, where the vertex sets include multiple vertex objects for indicating the surface of the virtual avatar, and a closed virtual space is established, so that during the motion capture process between the virtual spaces, through the above-mentioned rendering method of the virtual avatar, deformation can be performed, and further, the deformed virtual spaces do not cross each other.
[0070] In an alternative embodiment, determining the current spatial positions of the virtual spaces respectively bound to the multiple virtual joints according to the current positions of the multiple virtual joints respectively, and the vertex sets respectively matched with the multiple virtual joints, includes:
[0071] S1. According to the current position of the current virtual joint among the multiple virtual joints, and the relative position relationships between the multiple current vertex objects and the current virtual joint respectively, determine the current vertex positions of the multiple current vertex objects, where the current vertex object is the vertex object included in the current vertex set matched with the current virtual joint;
[0072] S2. According to the coordinate intervals indicated by the current vertex positions of the multiple current vertex objects respectively, determine the current spatial position of the current virtual space bound to the multiple current virtual joints.
[0073] In an alternative embodiment, according to the current position of the current virtual joint among the multiple virtual joints, and the relative position relationships between the multiple current vertex objects and the current virtual joint respectively, determine the current vertex positions of the multiple current vertex objects, where the current vertex object is the vertex object included in the current vertex set matched with the current virtual joint; the above-mentioned relative position relationships include: distance, angle, contact area, etc., and determining the vertex position of the vertex object includes determining the three-dimensional coordinates of the vertex.
[0074] Furthermore, in step S2, according to Figure 4 the maximum vertex coordinates shown, that is, the coordinates (2, 2, 2) of vertex object 421, and the minimum vertex coordinates, that is, the coordinates (0, 0, 0) of vertex object 422, the determined coordinate interval is:
[0075] Coordinate interval = [(0 - 2), (0 - 2), (0 - 2)]
[0076] Optionally, when the vertex object coordinates are in the form of (x, y, z), the coordinate interval can be determined according to the minimum x-direction coordinate value (min_x), the maximum x-direction coordinate value (max_x), the minimum y-direction coordinate value (min_y), the maximum y-direction coordinate value (max_y), the minimum z-direction coordinate value (min_z), and the maximum z-direction coordinate value (max_z) among all vertex object coordinates. The specific calculation is as follows:
[0077] Coordinate interval = [(max_x - min_x), (max_y - min_y), (max_z - min_z)]
[0078] Furthermore, the vacant space determined by the coordinate interval is determined as the virtual space;
[0079] Through the above embodiments of the present application, according to the current position of the current virtual joint among multiple virtual joints and the relative position relationship between each of the multiple current vertex objects and the current virtual joint, the current vertex positions of the multiple current vertex objects are determined; according to the coordinate interval indicated by the current vertex positions of each of the multiple current vertex objects, the current spatial position of the current virtual space bound to the multiple current virtual joints is determined, and the determination of the virtual space position is completed by determining the coordinate interval.
[0080] In an alternative embodiment, before determining the rendering result of the target surface of the virtual image according to the target spatial position relationship when the target spatial position relationship between the first virtual space and the second virtual space among multiple virtual spaces meets the target condition, it includes:
[0081] S1. When the current vertex position of the first vertex object in the first vertex set associated with the first virtual space is located in the second virtual space, it is determined that the target spatial position relationship between the first virtual space and the second virtual space meets the target condition;
[0082] S2. When the current vertex position of the second vertex object in the second vertex set associated with the second virtual space is located in the first virtual space, it is determined that the target spatial position relationship between the first virtual space and the second virtual space meets the target condition;
[0083] As an alternative embodiment, in the above steps S1 - S2, when the current vertex position of the first vertex object in the first vertex set associated with the first virtual space is located in the second virtual space, it is determined that the target spatial position relationship between the first virtual space and the second virtual space meets the target condition; when the current vertex position of the second vertex object in the second vertex set associated with the second virtual space is located in the first virtual space, it is determined that the target spatial position relationship between the first virtual space and the second virtual space meets the target condition.
[0084] It can be understood that when the motion capture actor in the real world moves, the virtual regions that did not cross at the beginning as shown in Figure 3 will cross when the corresponding position changes, as shown in Figure 5 In this case, the first vertex object 511 of the first virtual space 501 enters the second virtual space 502, and the second vertex object 512 in the second virtual space 502 enters the first virtual space 501. At this time, there is an intersection area 522, and the target spatial position relationship between the first virtual space and the second virtual space is determined to meet the target condition.
[0085] Through the above implementation manners of the present application, when the current vertex position of the first vertex object in the first vertex set associated with the first virtual space is located in the second virtual space, it is determined that the target spatial position relationship between the first virtual space and the second virtual space meets the target condition; when the current vertex position of the second vertex object in the second vertex set associated with the second virtual space is located in the first virtual space, it is determined that the target spatial position relationship between the first virtual space and the second virtual space meets the target condition, thereby realizing the determination of whether the position relationship between different virtual regions meets the target condition.
[0086] In an optional implementation manner, when the target spatial position relationship between the first virtual space and the second virtual space among multiple virtual spaces meets the target condition, determining the rendering result of the target surface of the virtual image according to the target spatial position relationship includes:
[0087] S1. When the current vertex position of the first vertex object is located in the second virtual space, update the current vertex position of the first vertex object according to the spatial surface position of the second virtual space, where the updated current vertex position of the first vertex object is outside the second virtual space;
[0088] S2. When the current vertex position of the second vertex object is located in the first virtual space, update the current vertex position of the second vertex object according to the spatial surface position of the first virtual space, where the updated current vertex position of the second vertex object is outside the first virtual space;
[0089] It can be understood that in this implementation manner, when the current vertex position of the first vertex object is located in the second virtual space, the position of the first vertex object is adjusted, and the adjusted position coordinates of the first vertex object are outside the second virtual space.
[0090] Optionally, in this embodiment, when the current vertex position of the second vertex object is located in the first virtual space, the position of the second vertex object is adjusted, and the position coordinates of the second vertex object after adjustment are located outside the first virtual space.
[0091] Through the above embodiment, during the motion capture process, when the virtual spaces have a position intersection, it is possible to adjust the positions of the vertex objects in the intersecting virtual regions, ensuring that the vertices of the adjusted virtual regions are not located inside other virtual regions, so that the adjusted virtual regions do not have a position intersection, thereby realizing the penetration adjustment of the virtual image, avoiding manual frame-by-frame repair of penetration in the later stage, and improving the production efficiency.
[0092] In an alternative embodiment, when determining the rendering result of the target surface of the virtual image according to the target spatial position relationship between the first virtual space and the second virtual space among multiple virtual spaces that satisfies the target condition, it further includes:
[0093] S1. Obtain the deformation weights of at least one reference surface associated with the target surface;
[0094] S2. According to the deformation weights of each of the at least one reference surface, respectively determine the deformation results of the at least one reference surface.
[0095] It can be understood that in the above step S1, the reference surface refers to the adjacent surface of two surfaces in contact with each other. As shown in FIG. (a) in Figure 6 , the two surfaces in contact are in a coincident state. At this time, the two surfaces in contact with each other are determined as the target surface. When the two surfaces in contact with each other are completely coincident, the two surfaces in contact with each other are actually invisible surfaces at this time. In order to make the deformation of the virtual region close to the real physical rules, only the deformation adjustment of the adjacent surface of the target surface needs to be considered. Each surface adjacent to the target surface is determined as a reference surface, and the reference surface has its own deformation weight. Different deformation weight regions represent different deformation results when the reference surface deforms.
[0096] For example, in FIG. (a) in Figure 6 , there are four adjacent surfaces to the target surface in each of the virtual spaces on the left and right sides of the target surface 601. These eight surfaces adjacent to the target surface 601 are the reference surfaces. Obtain the deformation weights of these eight reference surfaces, and then in step S2, according to the deformation weights of the reference surfaces, determine the deformation results of the reference surfaces. The deformation results include: no deformation, deformation, degree of deformation, deformed shape, etc.
[0097] Optionally, as in Figure 6In figure (b), when the two contact surfaces do not completely overlap, the contact area part of the two surfaces is determined as the target surface 611, and the non-contact areas are determined as the reference surface 621 and the reference surface 622. At the same time, the adjacent surfaces of the contact surface are also determined as reference surfaces. At this time Figure 6 in figure (b) there are ten reference surfaces. Obtain the deformation weights of these ten reference surfaces. Then, in step S2, the deformation results of the reference surfaces can be determined according to the deformation weights of the reference surfaces.
[0098] Optionally, when the surface of the virtual space is a curved surface, such as Figure 12 as shown in the virtual space 1201 which is a curved surface closed space containing the thigh bone 1202 and the calf bone 1203. At this time, when any point on the curved surface of the virtual space collides with other virtual objects, this curved surface is both the target surface and the reference surface. Obtain the deformation weight of this curved surface and the deformation weights of the reference surfaces (if any) adjacent to this virtual curved surface. Further, in step S2, the deformation results of the reference surfaces can be determined according to the deformation weights of the reference surfaces.
[0099] Optionally, if there is an intersection as shown in Figure 5 between two virtual spaces, then at this time the surface in contact with other virtual spaces is both the target surface and the reference surface, and the surfaces adjacent to the target surface are simultaneously determined as reference surfaces.
[0100] Optionally, each surface of the above virtual space can have a corresponding deformation weight. For example, Figure 6 a deformation weight is assigned to each surface of all the virtual spaces in, or multiple deformation weights can be assigned to each reference surface by means of region division. For example, Figure 7 for the virtual surface shown, the virtual surface is divided into four regions: the deformation weight region 701, the deformation weight region 702, the deformation weight region 703, and the deformation weight region 704. Deformation weights are assigned to the above four deformation weight regions respectively. It should be noted that the above weight regions can be expressed by different colors, patterns, and text descriptions. For example, a white color represents a deformation weight region with a weight value of 0, and a black color represents a deformation weight region with a weight value of 1. There is no specific limitation here. Further, different colors, patterns, or text descriptions can be used to assign weights while dividing the deformation weight regions of the virtual surface. For example, for Figure 8The virtual surface in the left virtual environment area 811 in draws three different regions by using the drawing control 821 in the right operation area 812. Specifically: First, the color of the drawing control 821 is selected. When the selected color is white, the drawing control 821 drags and draws on the virtual surface to obtain the deformation weight area 802. The color of the drawn deformation weight area 802 is white, and at the same time, this area obtains the deformation weight corresponding to white. When the selected color is gray, the drawing control 821 drags and draws on the virtual surface to obtain the deformation weight area 801. The color of the drawn deformation weight area 801 is gray, and at the same time, this area obtains the deformation weight corresponding to gray. When the selected color is black, the drawing control 821 drags and draws on the virtual surface to obtain the deformation weight area 803. The color of the drawn deformation weight area 803 is black, and at the same time, this area obtains the deformation weight corresponding to black. It should be noted that the above colors can be different colors with different parameters such as hue, brightness, contrast, saturation, etc. The corresponding relationship between different colors and different weight values can be modified and will not be specifically limited here.
[0101] Further, in step S2, according to the deformation weight corresponding to the reference surface, the deformation result of the reference surface is determined. The above deformation results include: no deformation, deformation occurs, the degree of deformation, the shape after deformation, etc.
[0102] Through the above implementation manner, the deformation weight of the deformed surface in the virtual space can be obtained, which can make the surfaces of different virtual parts of the virtual image deform close to the physical rules of the real world when performing virtual actions, thereby improving the effect shown when the virtual parts are adjusted in position.
[0103] In an alternative implementation manner, according to the deformation weights of at least one reference surface, the deformation results of at least one reference surface are respectively determined, including one of the following:
[0104] Method 1: According to the respective deformation weight values of at least one reference surface and the numerical relationship between at least one deformation weight value, the deformation results of at least one reference surface are respectively determined;
[0105] Method 2: According to the respective deformation weight values of at least one reference surface and the reference deformation amount, the deformation results of at least one reference surface are respectively determined, where the reference deformation amount is the deformation amount determined according to the spatial position relationship between the first vertex position of the reference vertex associated with the target surface, the first virtual space, and the second virtual space;
[0106] It can be understood that this embodiment provides two alternative methods for adjusting the surface deformation of the virtual area during motion capture. The first method above can determine the deformation result by the magnitude of the deformation weight values of different reference surfaces. For example, the weight value range is set to 0-1. When a surface collision occurs, the surface needs to deform. The following combines Figure 12 to specifically illustrate the first method. As Figure 12 when the legs of the virtual avatar in Figure 7 perform movements such as jumping and running, the virtual space 1201 will be in a collision state with the outside. It can be understood that based on the foregoing method of constructing the virtual space, it can be ensured that the virtual space 1201 itself does not penetrate. Further, in the first method above, the deformation weight configured for the virtual surface can be used to indicate the corresponding deformation degree when a collision occurs. Specifically, as
[0107] shown, multiple deformation weight regions are pre-configured on the virtual surface of the virtual space. Among them, the deformation weight value of the deformation weight region 703 is 0, indicating that in the current collision state, the deformation weight region 703 on the virtual surface will not deform; while the deformation weight region 702 is pre-configured with a deformation weight value of 1, indicating that in the current collision state, the deformation weight region 702 on the virtual surface will deform. Further, the above deformation weight can be used to indicate a specific deformation value. For example, when the deformation weight configured in the deformation weight region 704 is 0.5, it indicates that the corresponding deformation degree when a collision occurs is 0.5 cm.
[0108] Deformation result degree value = A * deformation weight value * reference deformation amount + B
[0109] Deformation result texture value = C * deformation result degree value + D
[0110] It should be noted that the above deformation result degree value represents whether deformation occurs, as well as the degree and direction of deformation. For example, when this value is 0, it means that the reference surface does not deform. When this value is less than 1, it means that the reference surface deforms inward to the virtual space where the reference surface is located. When this value is greater than 0, it means that the value deforms outward to the virtual space where the reference surface is located. The above reference deformation amount is the value corresponding to the position relationship value used to describe the position relationship. For example, when the spatial position relationship is specifically a spatial distance relationship, the numerical position relationship value is the distance value between virtual spaces. Different distance values correspond to different reference deformation amounts. When the spatial position relationship is specifically the angle relationship between the virtual planes corresponding to virtual spaces, the position relationship value is the angle value between the virtual planes corresponding to virtual spaces. Different angle values correspond to different reference deformation amounts. When the spatial position relationship is specifically the contact state relationship between virtual spaces, the position relationship value is the contact area value between virtual spaces. Different contact area values correspond to different reference deformation amounts. The above A, B, C, and D are constants, and each spatial position relationship has corresponding constants A, B, C, and D.
[0111] Furthermore, in Method 2, by obtaining the deformation weight value and the reference deformation amount, the deformation degree value of the reference surface can be determined, and based on the deformation degree value, the values of other deformation result parameters including the deformation texture value can be determined. It should be noted that the operation model listed in this embodiment is only an operation model for explaining how the deformation result is specifically determined. The deformation result of the present application can also be obtained by other operation models, which are not specifically limited herein.
[0112] Optionally, the above position relationship value may include the shortest distance from the reference vertex to another virtual space it enters, the shortest distance from the intersection position of two intersecting virtual spaces, etc., which are not limited herein. For example, when the reference distance value is the shortest distance from the reference vertex to another virtual space it enters, the shortest distance value from the reference vertex to another virtual space it enters is obtained, and the reference deformation amount corresponding to it is determined according to the shortest distance value. Further, the reference surface determines the deformation result based on its own deformation weight value and the above reference deformation amount, realizing the virtual surface deformation that conforms to the muscle deformation rules of a real human body during movement when adjusting the positions of two intersecting virtual spaces during motion capture.
[0113] In an alternative embodiment, before determining the rendering result of the target surface of the virtual image according to the target spatial position relationship when the target spatial position relationship between the first virtual space and the second virtual space among multiple virtual spaces meets the target condition, at least one of the following is further included:
[0114] Method 1: Configure deformation weights for at least one reference surface according to the image type of the virtual character;
[0115] Method 2: Configure deformation weights for at least one reference surface according to the virtual character volume of the virtual character;
[0116] Method 3: Configure deformation weights for at least one reference surface according to the scene type of the virtual scene where the virtual character is located.
[0117] It can be understood that the above-mentioned image types of virtual characters include gender setting, occupation setting, age setting, etc. For example, taking gender setting as an example, the muscle deformations of people of different genders are often different during exercise. Generally speaking, the degree of muscle deformation of men is lower than that of women. Therefore, when designing virtual characters, it is necessary to configure lower deformation weights for virtual characters set as male, and higher deformation weights for virtual characters set as female.
[0118] In the above first method, assume that the virtual character to be rendered in the virtual scene is an elderly woman. When the virtual character is designed to have loose skin, a higher deformation weight is configured for the virtual character. The configuration method can be to increase the initial deformation weight of the virtual surface as a whole by a certain value or a certain proportion, or it can be like Figure 8 In [reference], multiple regions with different deformation weights are drawn for the virtual surface of the virtual character by using the drawing control 821. There is no specific limitation here. Furthermore, when the virtual surface of the virtual character collides, a higher degree of deformation is generated, making the rendering result more in line with the real-world rules.
[0119] It can be understood that the above-mentioned virtual character volume of the virtual character includes the overall volume of the virtual character and the volumes of each virtual space. For example, the muscle deformation of a person with a bloated figure is higher than that of a person with a thin figure. Therefore, when designing virtual characters, it is necessary to configure higher deformation weights for virtual characters set as bloated, and lower deformation weights for virtual characters set as thin. In the actual motion capture process, due to business requirements, the designed virtual characters are not always proportionally bloated or thin. Therefore, it is necessary to further adjust the deformation weights in combination with the volumes of the specific virtual spaces of each part of the virtual character.
[0120] The following describes the operation of configuring deformation weights for the above Method 2. Assume that the virtual character to be rendered in the virtual scene is a person with a fat figure. In this case, the deformation weight of the virtual surface of the virtual character is increased. The way to increase the weight can be to increase the initial deformation weight of the virtual surface as a whole by a certain value or a certain proportion, or it can be like Figure 8By using the drawing control 821 to draw multiple regions with different deformation weights on the virtual surface of the virtual image, specific limitations are not imposed here. Furthermore, when the virtual surface of the virtual image collides, a higher degree of deformation is generated, making the rendering result more in line with the real-world rules.
[0121] It can be understood that the above-mentioned scenario types include weightlifting, boxing, running, daily walking, doing housework, eating, working, etc. The muscle deformations of the human body are different in different scenarios. For example, the degree of deformation on the surface of the arm in the weightlifting scenario is greater than that in the eating scenario. Therefore, it is necessary to adjust the deformation weights of the virtual image according to the different scenarios in which the virtual image is located. Higher deformation weights are assigned to virtual images that require high-intensity exercises such as weightlifting and boxing, and lower deformation weights are configured for virtual images in low-intensity exercise scenarios such as eating and working.
[0122] In the above third method, the deformation of the virtual image surface can be made more in line with the real-world rules by adjusting the deformation weights. For example, in the case where the virtual image to be rendered is in a boxing match, violent movements and hitting and other virtual actions will cause a higher degree of deformation on the virtual image surface. Therefore, in this scenario, the deformation weight of the virtual surface of the virtual image is increased. The way to increase the weight can be to increase the overall initial deformation weight of the virtual surface by a certain value or a certain proportion, or it can be as Figure 8 By using the drawing control 821 to draw multiple regions with different deformation weights on the virtual surface of the virtual image, specific limitations are not imposed here. For example, the virtual space of the legs of the virtual image is drawn as Figure 7 a virtual space with multiple deformation weight regions as shown, where the deformation weight value of the deformation weight region 703 is 0, indicating the virtual surface. In the current collision state, the deformation weight region 703 in the virtual surface will not deform; while the deformation weight region 702 is pre-configured with a deformation weight value of 1, indicating that in the current collision state of the virtual surface, the corresponding deformation degree of the deformation weight region 702 in its virtual surface during collision is 1 cm.
[0123] Through the above-mentioned embodiments of the present application, deformation weights are configured for at least one reference surface according to the image type of the virtual image; deformation weights are configured for at least one reference surface according to the virtual image volume of the virtual image; and deformation weights are configured for at least one reference surface according to the scenario type of the virtual scenario in which the virtual image is located, configuring deformation weights for the virtual image that are more in line with the physical rules of the real world, making the deformation of the virtual image more real and natural.
[0124] In an alternative embodiment, before obtaining the control signal for controlling the virtual image, it further includes:
[0125] S1. Obtain the control constraint conditions associated with the target object, where the control signal is determined according to the object action performed by the target object;
[0126] S2. When the control constraint conditions include at least one joint activity angle range, determine the virtual activity angle range of at least one virtual joint of the virtual image according to the at least one joint activity angle range.
[0127] The above control constraint conditions include the position of the motion capture actor in the static state and the joint activity angle range of the motion capture actor;
[0128] Furthermore, in step S2, configure the joint activity angle of the virtual image according to the joint activity angle of the motion capture actor. For example, Figure 9 in figure (a) as shown, the actor activity angle 901 is A_x° - A_y°, and further, determine Figure 9 in figure (b) as shown, the joint activity angle 902 of the virtual image is B_x° - B_y°;
[0129] It can be understood that the joint activity angle of the above virtual image is not necessarily equal to the joint activity angle of the actor, and the joint activity angle of the virtual image can be adjusted based on the joint activity angle of the actor.
[0130] Optionally, in steps S1 - S2, determine the initial position of the virtual joints of the virtual image through the position of the actor in the static state, so that the joint positions of the virtual image correspond to the position of the actor in the static state. For example, Figure 10 as shown, Figure 10 the initial joint position of the virtual image in figure (b) corresponds to Figure 10 the position of the actor in the static state in figure (a), and there is no model intersection in each virtual space of the virtual image in the initial state.
[0131] Through the above embodiments of the present application, obtain the control constraint conditions associated with the target object, where the control signal is determined according to the object action performed by the target object; when the control constraint conditions include at least one joint activity angle range, determine the virtual activity angle range of at least one virtual joint of the virtual image according to the at least one joint activity angle range, so that the virtual image has a constraint system that conforms to the physical rules of the real world, ensuring that the virtual image will not perform movements that violate the physical logic of the real world.
[0132] The following Figure 11 is used to illustrate the rendering process of a complete virtual image.
[0133] First, the virtual model for motion capture can be configured through steps S1101 to S1107, and then the rendering operation can be performed through step S1109. The specific operation steps are as follows:
[0134] S1101, bind bones to the virtual character; as shown in figure (b) of Figure 9 , configure bones for the virtual avatar when the virtual character is in the initial state;
[0135] S1103, create a closed area for the model according to the bones; it should be noted that the above-mentioned closed area refers to the virtual space shown in Figure 3 . When the virtual space is initially set up, there is no intersection between them. The above-mentioned closed area can be a space composed of planes, a space composed of curved surfaces, or a space composed of both curved surfaces and planes, and there is no limitation here.
[0136] Optionally, creating a closed area according to the bones can be creating a closed area for each bone separately, creating a closed area for a certain body part formed by multiple bones, or creating a closed area for multiple bones in any area of the body. For example, Figure 12 as shown, create a closed area for the thigh bone 1202 and the calf bone 1203.
[0137] Optionally, for the range of the closed area, it is determined by the vertex coordinates in the vertex set of the virtual space. For example, in the case where the vertex object coordinates are in the form of (x, y, z), the range of the closed area can be determined according to the minimum x-direction coordinate value (min_x), the maximum x-direction coordinate value (max_x), the minimum y-direction coordinate value (min_y), the maximum y-direction coordinate value (max_y), the minimum z-direction coordinate value (min_z), and the maximum z-direction coordinate value (max_z) among all vertex object coordinates. The specific calculation is:
[0138] Closed area range = [(max_x - min_x), (max_y - min_y), (max_z - min_z)]
[0139] S1105, set the model deformation weight; it should be noted that setting the model weight here can be setting a separate weight for each adjacent surface of the target surface in Figure 6 , or setting weights by dividing different regions in one surface as shown in Figure 7 . The way of dividing regions can be as shown in Figure 8As shown in [reference], by using different colors to draw regions of the virtual surface, when a certain region in the virtual surface is drawn white, that region has the deformation weight corresponding to white. At the same time, the setting of the weight also needs to consider the type of the virtual image, such as male, female, boxer, old person, etc., and also needs to consider the volume of the virtual image, such as obese, thin, etc., and also needs to consider the scene of the virtual image, such as intense exercise scene, daily walking scene, etc. No specific limitations are made here.
[0140] Furthermore, when a collision occurs on the surface of the virtual character, the corresponding deformation can be generated on the surface of the virtual character according to the configured weight, thereby generating a rendering result that conforms to the real logic.
[0141] S1107, calibrate and limit the bones; it should be noted that the above calibration refers to making the state of the bones bound to the virtual character correspond to the bones of the actor in the static form shown in Figure (b) of [reference]; the above limitation refers to making the bones bound to the virtual character have the Figure 10 constraint conditions of the joint movement angles shown in Figure (b) of [reference]. Figure 10 in Figure (a) of [reference]. Figure 9
[0142] S1109, animation test; it should be noted that by the action capture actor performing actions, corresponding changes are generated in the virtual image, and whether the self - collision of the virtual image meets the expectations is verified according to the animation performance of the action changes of the virtual image. Here, the expectations include meeting the preset deformation effects or approaching the real physical deformation rules, etc. No limitations are made here. Furthermore, the deformation of the virtual image can be further adjusted by changing the deformation weight, so that the virtual surface after further deformation weight adjustment generates the deformation that meets the expectations.
[0143] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0144] According to another aspect of the embodiments of this application, there is also provided a rendering device for a virtual image for implementing the above - mentioned virtual image rendering method. As Figure 13 shown, the device includes:
[0145] An acquisition unit 1302, configured to acquire a control signal for controlling the virtual image;
[0146] A control unit 1304, configured to control the virtual character to perform a virtual action matching the control signal in response to the control signal;
[0147] A first determination unit 1306, configured to determine the spatial position relationship between a plurality of virtual spaces associated with the virtual character during the execution of the virtual action by the virtual character, wherein the virtual space is a virtual space bound to a virtual part of the virtual character;
[0148] A second determination unit 1308, configured to determine the rendering result of the target surface of the virtual character according to the target spatial position relationship when the target spatial position relationship between a first virtual space and a second virtual space among the plurality of virtual spaces meets the target condition, wherein the target surface is a virtual surface where a first virtual part and a second virtual part are in contact with each other, the first virtual space is bound to the first virtual part, and the second virtual space is bound to the second virtual part.
[0149] Optionally, the rendering device of the virtual character further includes: an acquisition unit, configured to acquire a control signal for controlling the virtual character; a control unit, configured to control the virtual character to perform a virtual action matching the control signal in response to the control signal; a first determination unit, configured to determine the spatial position relationship between a plurality of virtual spaces associated with the virtual character during the execution of the virtual action by the virtual character, wherein the virtual space is a virtual space bound to a virtual part of the virtual character; a second determination unit, configured to determine the rendering result of the target surface of the virtual character according to the target spatial position relationship when the target spatial position relationship between a first virtual space and a second virtual space among the plurality of virtual spaces meets the target condition, wherein the target surface is a virtual surface where a first virtual part and a second virtual part are in contact with each other, the first virtual space is bound to the first virtual part, and the second virtual space is bound to the second virtual part.
[0150] Optionally, the rendering device of the virtual character further includes: a third determination unit, configured to acquire the current positions of a plurality of virtual joints for driving the virtual character during the execution of the virtual action by the virtual character, wherein the virtual part includes a virtual joint; and determine the current spatial positions of the virtual spaces respectively bound to the plurality of virtual joints according to the current positions of the plurality of virtual joints and the vertex sets respectively matched with the plurality of virtual joints, wherein the vertex sets include a plurality of vertex objects for indicating the surface of the virtual character.
[0151] Optionally, the above-mentioned third determination unit is configured to determine the current vertex positions of multiple current vertex objects according to the current position of the current virtual joint among multiple virtual joints and the relative position relationships between the multiple current vertex objects and the current virtual joint, where the current vertex object is a vertex object included in the current vertex set that matches the current virtual joint; and determine the current spatial position of the current virtual space bound to the multiple current virtual joints according to the coordinate intervals indicated by the current vertex positions of the multiple current vertex objects respectively.
[0152] Optionally, the above-mentioned rendering device for the virtual avatar further includes: a fourth determination unit, configured to determine that the target spatial position relationship between the first virtual space and the second virtual space meets the target condition when the current vertex position of the first vertex object in the first vertex set associated with the first virtual space is located in the second virtual space; and determine that the target spatial position relationship between the first virtual space and the second virtual space meets the target condition when the current vertex position of the second vertex object in the second vertex set associated with the second virtual space is located in the first virtual space.
[0153] Optionally, the above-mentioned fourth determination unit is further configured to: when the current vertex position of the first vertex object is located in the second virtual space, update the current vertex position of the first vertex object according to the spatial surface position of the second virtual space, where the updated current vertex position of the first vertex object is outside the second virtual space; and when the current vertex position of the second vertex object is located in the first virtual space, update the current vertex position of the second vertex object according to the spatial surface position of the first virtual space, where the updated current vertex position of the second vertex object is outside the first virtual space.
[0154] Optionally, the above-mentioned second determination unit 1308 includes: an acquisition module, configured to acquire the deformation weights of at least one reference surface associated with the target surface; and a determination module, configured to determine the deformation results of the at least one reference surface respectively according to the deformation weights of the at least one reference surface.
[0155] Optionally, the above-mentioned determination module is configured to determine the deformation results of the at least one reference surface respectively according to the deformation weight values of the at least one reference surface and the numerical relationships between the at least one deformation weight values; and determine the deformation results of the at least one reference surface respectively according to the deformation weight values of the at least one reference surface and the reference deformation amount, where the reference deformation amount is a deformation amount determined according to the spatial position relationship between the first vertex position of the reference vertex associated with the target surface, the first virtual space, and the second virtual space.
[0156] Optionally, the above-mentioned second determination unit 1308 is further configured to configure deformation weights for at least one reference surface according to the image type of the virtual image; configure deformation weights for at least one reference surface according to the virtual image volume of the virtual image; configure deformation weights for at least one reference surface according to the scene type of the virtual scene where the virtual image is located.
[0157] Optionally, the above-mentioned rendering device of the virtual image further includes: a fifth determination unit, configured to obtain control constraint conditions associated with a target object, where the control signal is determined according to an object action performed by the target object; when the control constraint conditions include at least one joint movement angle range, determine the virtual movement angle range of at least one virtual joint of the virtual image according to the at least one joint movement angle range.
[0158] According to another aspect of the embodiments of the present application, there is also provided an electronic device for implementing the above-mentioned virtual image rendering method, and the electronic device may be Figure 1 the terminal device or server shown. In this embodiment, the electronic device is taken as a mobile phone or a computer as an example. As Figure 14 shown, the electronic device includes a memory 1402 and a processor 1404. A computer program is stored in the memory 1402, and the processor 1404 is configured to execute the steps in any one of the above-mentioned method embodiments through the computer program.
[0159] Optionally, in this embodiment, the above-mentioned electronic device may be at least one network device among multiple network devices in a computer network.
[0160] Optionally, in this embodiment, the above-mentioned processor may be configured to execute the following steps through a computer program:
[0161] S1, obtain a control signal for controlling the virtual image;
[0162] S2, in response to the control signal, control the virtual image to perform a virtual action matching the control signal;
[0163] S3, during the process of the virtual image performing the virtual action, determine the spatial position relationship between multiple virtual spaces associated with the virtual image, where the virtual space is a virtual space bound to a virtual part of the virtual image;
[0164] S4, when the target spatial position relationship between the first virtual space and the second virtual space among the multiple virtual spaces meets the target condition, determine the rendering result of the target surface of the virtual image according to the target spatial position relationship, where the target surface is a virtual surface where the first virtual part and the second virtual part are in contact with each other, the first virtual space is bound to the first virtual part, and the second virtual space is bound to the second virtual part.
[0165] Optionally, those of ordinary skill in the art can understand that Figure 13 the structure shown is only illustrative, and the electronic device can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a personal digital assistant, and terminal devices such as Mobile Internet Devices (MID), PAD, etc. Figure 13 It does not limit the structure of the above-mentioned electronic device. For example, the electronic device may further include more or fewer components (such as a network interface, etc.) than those shown Figure 13 in it, or have a different configuration from that Figure 13 shown.
[0166] Among them, the memory 1402 can be used to store software programs and modules, such as the program instructions / modules corresponding to the display method and device of the media resource playback page in the embodiments of the present application. The processor 1404 executes various functional applications and data processing by running the software programs and modules stored in the memory 1402, that is, implements the above-mentioned virtual image rendering method. The memory 1402 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 1402 may further include a memory remotely disposed relative to the processor 1404, and these remote memories can be connected to the terminal through a network. Examples of the above-mentioned network include but are not limited to the Internet, an enterprise internal network, a local area network, a mobile communication network, and combinations thereof. Among them, the memory 1402 can specifically but not limitedly be used to store information such as page elements and page styles. As an example, as Figure 14 shown, the above-mentioned memory 1402 may include but is not limited to the acquisition unit 1302, the control unit 1304, the first determination unit 1306, and the second determination unit 1308 in the above-mentioned virtual image rendering device. In addition, it may also include but is not limited to other module units in the above-mentioned virtual image rendering device, which will not be elaborated in this example.
[0167] Optionally, the above-mentioned transmission device 1406 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one instance, the transmission device 1406 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and a router through a network cable so as to communicate with the Internet or a local area network. In one instance, the transmission device 1406 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0168] In addition, the above-mentioned electronic device further includes: a display 1408 for displaying the above-mentioned target page; and a connection bus 1410 for connecting each module component in the above-mentioned electronic device.
[0169] In other embodiments, the above-mentioned terminal device or server may be a node in a distributed system. Among them, the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes in a form of network communication. Among them, the nodes may form a point-to-point network, and any form of computing device, such as an electronic device like a server or a terminal, can become a node in the blockchain system by joining the point-to-point network.
[0170] According to one aspect of the present application, there is provided a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above various optional implementation manners;
[0171] Optionally, in this embodiment, the above-mentioned computer-readable storage medium may be set to store a computer program for executing the following steps:
[0172] S1, obtain a control signal for controlling the virtual image;
[0173] S2, in response to the control signal, control the virtual image to execute a virtual action matching the control signal;
[0174] S3, during the process of the virtual image executing the virtual action, determine the spatial position relationship between multiple virtual spaces associated with the virtual image, where the virtual space is a virtual space bound to a virtual part of the virtual image;
[0175] S4, when the target spatial position relationship between the first virtual space and the second virtual space among the multiple virtual spaces meets the target condition, determine the rendering result of the target surface of the virtual image according to the target spatial position relationship, where the target surface is a virtual surface where the first virtual part and the second virtual part are in contact with each other, the first virtual space is bound to the first virtual part, and the second virtual space is bound to the second virtual part.
[0176] Optionally, in the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other relevant parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit that includes the function of that module or unit.
[0177] Optionally, in this embodiment, those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware of the terminal device through a program, and this program can be stored in a computer-readable storage medium. The storage medium can include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, an optical disk, etc.
[0178] If the integrated unit in the above embodiments is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing one or more computer devices (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0179] In the above embodiments of the present application, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0180] In the several embodiments provided by the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces, and the indirect coupling or communication connection of units or modules can be in an electrical or other form.
[0181] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or may be distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0182] In addition, each functional unit in various embodiments of the present application may be integrated into a processing unit, may exist separately as individual physical units, or two or more units may be integrated into one unit. The above integrated units may be implemented in the form of hardware or in the form of software functional units.
[0183] The above are only the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A method for rendering a virtual image, characterized in that: include: Acquiring a control signal for controlling the virtual image; In response to the control signal, controlling the virtual image to perform a virtual action matching the control signal; During the process of the virtual image performing the virtual action, determining the spatial position relationship between a plurality of virtual spaces associated with the virtual image, wherein the virtual space is a virtual space bound to a virtual part of the virtual image; When the target spatial position relationship between the first virtual space and the second virtual space in the multiple virtual spaces meets the target condition, the rendering result of the target surface of the virtual image is determined according to the target spatial position relationship, wherein the target surface is a virtual surface where the first virtual part and the second virtual part are in contact with each other, the first virtual space is bound to the first virtual part, and the second virtual space is bound to the second virtual part.
2. The method according to claim 1, characterized in that The method further comprises: before determining the spatial position relationship between a plurality of virtual spaces associated with the virtual image during the process of the virtual image performing the virtual action, During the process of the virtual image performing the virtual action, obtaining current positions of a plurality of virtual joints used to drive the virtual image, wherein the virtual parts include the virtual joints; According to the current positions of each of the multiple virtual joints and the vertex sets respectively matching the multiple virtual joints, the current spatial positions of the virtual spaces respectively bound to the multiple virtual joints are determined, wherein the vertex sets include multiple vertex objects for indicating the image surface of the virtual image.
3. The method according to claim 2, characterized in that The determining, according to the current positions of the respective virtual joints and the vertex sets respectively matched with the plurality of virtual joints, the current spatial positions of the virtual spaces respectively bound to the plurality of virtual joints comprises: Determining the current vertex positions of the multiple current vertex objects according to the current position of the current virtual joint among the multiple virtual joints and the relative positional relationship between each of the multiple current vertex objects and the current virtual joint, wherein the current vertex object is the vertex object included in the current vertex set matching the current virtual joint; The current space position of the current virtual space bound to the multiple current virtual joints is determined according to the coordinate interval indicated by the current vertex position of each of the multiple current vertex objects.
4. The method according to claim 2, characterized in that: Before determining the rendering result of the target surface of the virtual image according to the target spatial position relationship when the target spatial position relationship between the first virtual space and the second virtual space in the plurality of virtual spaces meets the target condition, the method includes: determining that a target space position relationship between the first virtual space and the second virtual space satisfies the target condition when a current vertex position of a first vertex object in a first vertex set associated with the first virtual space is located in the second virtual space; When the current vertex position of the second vertex object in the second vertex set associated with the second virtual space is located in the first virtual space, it is determined that the target space position relationship between the first virtual space and the second virtual space satisfies the target condition.
5. The method according to claim 4, characterized in that The step of determining a rendering result of a target surface of the virtual image according to the target spatial position relationship between the first virtual space and the second virtual space in the plurality of virtual spaces when the target spatial position relationship satisfies a target condition comprises: In a case where the current vertex position of the first vertex object is located in the second virtual space, updating the current vertex position of the first vertex object according to the spatial surface position of the second virtual space, wherein the updated current vertex position of the first vertex object is located outside the second virtual space; When the current vertex position of the second vertex object is located in the first virtual space, the current vertex position of the second vertex object is updated according to the spatial surface position of the first virtual space, wherein the updated current vertex position of the second vertex object is located outside the first virtual space.
6. The method according to claim 1, characterized in that When the target spatial position relationship between the first virtual space and the second virtual space in the plurality of virtual spaces satisfies the target condition, determining the rendering result of the target surface of the virtual image according to the target spatial position relationship, further comprising: Acquire a deformation weight of at least one reference surface associated with the target surface; A deformation result of at least one of the reference surfaces is determined according to the deformation weight of each of the at least one reference surfaces.
7. The method according to claim 6, characterized in that Determining the deformation result of at least one of the reference surfaces according to the deformation weight of at least one of the reference surfaces comprises one of the following: Determining a deformation result of at least one of the reference surfaces according to a deformation weight value of each of the at least one reference surfaces and a numerical relationship between at least one of the deformation weight values; According to the deformation weight value of each of at least one of the reference surfaces and the reference deformation amount, the deformation result of at least one of the reference surfaces is determined respectively, wherein the reference deformation amount is a deformation amount determined according to the first vertex position of the reference vertex associated with the target surface and the spatial position relationship between the first virtual space and the second virtual space.
8. The method according to claim 6, characterized in that Before determining the rendering result of the target surface of the virtual image according to the target spatial position relationship when the target spatial position relationship between the first virtual space and the second virtual space in the plurality of virtual spaces meets the target condition, the method further includes at least one of the following: According to the image type of the avatar, configuring a deformation weight for at least one of the reference surfaces; configuring a deformation weight for at least one of the reference surfaces according to an avatar volume of the avatar; According to the scene type of the virtual scene where the virtual image is located, a deformation weight is configured for at least one of the reference surfaces.
9. The method according to any one of claims 1 to 8, characterized in that Before obtaining the control signal for controlling the virtual image, the method further includes: Acquiring a control constraint condition associated with a target object, wherein the control signal is determined according to an object action performed by the target object; In the case where the control constraint condition includes at least one joint activity angle range, the virtual activity angle range of at least one virtual joint of the virtual image is determined based on the at least one joint activity angle range.
10. A virtual image rendering device, characterized in that: include: An acquisition unit, used to acquire a control signal for controlling the virtual image; a control unit, for controlling the virtual image to perform a virtual action matching the control signal in response to the control signal; A first determining unit is used to determine the spatial position relationship between a plurality of virtual spaces associated with the virtual image during the process of the virtual image performing the virtual action, wherein the virtual space is a virtual space bound to a virtual part of the virtual image; The second determining unit determines the rendering result of the target surface of the virtual image according to the target spatial position relationship between the first virtual space and the second virtual space in the multiple virtual spaces, when the target spatial position relationship between the first virtual space and the second virtual space meets the target condition, wherein the target surface is a virtual surface where the first virtual part and the second virtual part are in contact with each other, the first virtual space is bound to the first virtual part, and the second virtual space is bound to the second virtual part.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program is executed by a processor to perform the method described in any one of claims 1 to 9.
12. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
13. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 9 through the computer program.