Data processing method and device of virtual object, electronic equipment and storage medium
By calculating the anchor point position of the virtual object and setting the rotation angle, the problem that the virtual object patch cannot always face the camera is solved, and the quality of the game screen is improved.
Patent Information
- Application Number
- CN202510013176.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-06-06
AI Technical Summary
In a stereoscopic game, the virtual object cannot always face the camera during rotation or movement, resulting in rough gameplay.
By determining the characteristic information of the first vertex position of the target object, the anchor point position is calculated, and the rotation angle of the face piece is set according to the anchor point position and observation information, ensuring that the face piece always faces the camera.
Improves the quality of the game screen, so that the virtual object always faces the camera when it rotates or moves, improving the visual effect.
Smart Images

Figure CN120107421A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of game data processing, and more specifically, to a method, device, electronic device and storage medium for processing data of a virtual object. Background Art
[0002] With the rapid development of 3D games, each virtual object in a virtual scene presents a 3D effect after rendering in a 3D game, making the visual effect of the virtual scene more realistic. At present, some or all features of a virtual object may be composed of patches. When some virtual objects are arranged in a virtual scene, the virtual objects will be rotated or moved, and the patches cannot always face the camera, which makes the game screen rough. Summary of the invention
[0003] One purpose of the embodiments of the present disclosure is to provide a new technical solution for data processing of virtual objects.
[0004] According to a first aspect of the present disclosure, a method for processing data of a virtual object is provided, the method comprising:
[0005] In response to a display instruction of a target object, determining first feature information indicating a position of a first vertex of the target object;
[0006] Obtaining an anchor point position of an anchor point of the target object according to the first feature information;
[0007] The rotation angle of the facet surrounded by the first vertex of the target object is obtained according to the observation information of the target object and the anchor point position; wherein the rotation angle is used to set the moving path of the first vertex of the target object.
[0008] In a possible implementation, the method further includes:
[0009] In response to a configuration operation of a target object, configuring a first identifier for a first set color channel of a first vertex of the target object;
[0010] Inputting the third feature information of the first vertex into a preset union-find set;
[0011] Determining the anchor point position of the anchor point of the target object according to the union-find set;
[0012] Determine, according to the anchor point position, a vector difference between a first vertex of the target object and the anchor point;
[0013] Normalizing the vector difference to obtain first feature information indicating the position of the first vertex;
[0014] The first feature information is input into a second set color channel of the first vertex.
[0015] In a possible implementation, the target object is at least a part of a target model, and a first number of the target objects in the target model is greater than a set threshold, wherein the set threshold is related to a total number of objects configured in the target model.
[0016] In a possible implementation manner, determining the anchor point position of the target object according to the union-find set includes:
[0017] According to the connected components of the target object reflected in the union-check set, the geometric center of the first vertex of the target object and the center position of the geometric center are determined and used as the anchor point position of the target object.
[0018] In a possible implementation, the observation information includes a setting position of a target camera;
[0019] The step of obtaining the rotation angle of the facet surrounded by the first vertex of the target object according to the observation information of the target object and the anchor point position includes:
[0020] Obtaining a rotation angle of a patch surrounded by the first vertex of the target object according to a position difference between the set position and the anchor point position;
[0021] A moving path of the first vertex of the target object is determined according to the rotation angle and the vertex position of the first vertex of the target object.
[0022] In a possible implementation, the method further includes:
[0023] In response to the swing setting operation of the target object, acquiring a first vertex position of a second vertex of the target object; wherein the second vertex belongs to the first vertex;
[0024] Determining a swing amplitude of the second vertex at a first time node according to the first vertex position and the rotation angle;
[0025] The swing offset of the second vertex at the first time node is determined according to the swing amplitude and the rotation angle.
[0026] In a possible implementation, determining the swing amplitude of the second vertex at the first time node according to the first vertex position includes:
[0027] Determine a first position in a first set direction and a second position in a second set direction of the first vertex position; wherein the first set direction and the second set direction are on a set horizontal plane;
[0028] The first position, the second position, the first time node and the rotation angle are input into a preset swing amplitude algorithm to obtain the swing amplitude of the second vertex at the first time node.
[0029] In a possible implementation, determining the swing offset of the second vertex at the first time node according to the swing amplitude and the rotation angle includes:
[0030] The swing amplitude and the rotation angle are input into a preset offset algorithm to obtain the swing offset of the second vertex at the first time node.
[0031] According to a second aspect of the present disclosure, there is also provided a data processing device for a virtual object, comprising:
[0032] A response module, configured to determine, in response to a display instruction of a target object, first feature information indicating a position of a first vertex of the target object;
[0033] A first obtaining module, configured to obtain an anchor point position of an anchor point of the target object according to the first feature information;
[0034] The second obtaining module is used to obtain the rotation angle of the facet surrounded by the first vertex of the target object according to the observation information of the target object and the anchor point position; wherein the rotation angle is used to set the moving path of the first vertex of the target object.
[0035] According to a third aspect of the present disclosure, a computer system is also provided, the computer system includes a processor, when the processor executes a program instruction or code, the computer system implements the game scene control method in the first aspect. Exemplarily, the computer system also includes a memory, the memory is used to store the program instruction or code.
[0036] According to a fourth aspect of the present disclosure, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned virtual object data processing method when running.
[0037] According to a fifth aspect of the present disclosure, there is also provided a computer program product, comprising a game program, wherein when the game program is executed, the computer executes the steps of the above-mentioned virtual object data processing method.
[0038] According to a sixth aspect of the present disclosure, there is also provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the data processing method of the virtual object through the computer program.
[0039] A beneficial effect of the embodiments of the present disclosure is that the data processing method of the virtual object provided by the embodiments of the present disclosure can determine the first feature information representing the position of the first vertex of the target object when the target object needs to be displayed, and determine the anchor point position of the anchor point of the target object through the first feature information, and then set the rotation angle of the target object's face according to the anchor point position and the observation information, so that after the target object is rotated or moved, the face of the target object can always face the camera by adjusting the rotation angle, thereby improving the quality of the presented game screen.
[0040] Features and advantages of the embodiments of the present specification will become apparent from the following detailed description of exemplary embodiments of the present specification with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the specification and, together with the description, serve to explain the principles of the embodiments of the specification.
[0042] Figure 1 A schematic diagram of the hardware structure of an electronic device that can be used to implement the virtual object data processing method according to an embodiment of the present disclosure is shown;
[0043] Figure 2 A schematic flow chart of a method for processing data of a virtual object according to some embodiments is shown;
[0044] Figure 3 shows a schematic diagram of a virtual scene according to some embodiments;
[0045] Figure 4 A schematic diagram showing the structure of a data processing device for a virtual object according to some embodiments;
[0046] Figure 5 A schematic diagram of the hardware structure of an electronic device according to some embodiments is shown. DETAILED DESCRIPTION
[0047] Various exemplary embodiments of the present specification will now be described in detail with reference to the accompanying drawings.
[0048] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the embodiments of the present specification and its application or uses.
[0049] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0050] It should be noted that all actions of acquiring signals, information or data in the embodiments of the present disclosure are performed in compliance with the corresponding data protection laws and policies of the country where the device is located, and with the authorization given by the owner of the corresponding device.
[0051] The disclosed embodiment provides a new data processing solution for virtual objects, which allows, when a virtual object needs to be displayed, to determine the positions of each vertex representing the virtual object, and to determine the anchor point position of the virtual object's anchor point using the positions of each vertex, and then to set the rotation angle of the virtual object's face according to the anchor point position and the observation position of the virtual camera observing the virtual object, so that after the virtual object is rotated or moved, the face of the virtual object can always face the camera by adjusting the rotation angle, thereby improving the quality of the presented game screen.
[0052] Figure 1 A schematic diagram of the hardware structure of an electronic device that can be used to implement the virtual object data processing method according to an embodiment of the present disclosure is shown.
[0053] The electronic device 1000 is a device capable of running a game, and the game may be a local application installed on the electronic device, or a web game, a light application, or a small program, etc., which is not limited here. The electronic device 1000 may be a mobile phone, a tablet computer, a PC, etc., which is not limited here.
[0054] like Figure 1 As shown, the electronic device 1000 may include a processor 1101, a memory 1102, an interface device 1103, a communication device 1104, an output device 1105, an input device 1106, and the like. Figure 1 The hardware configuration shown is merely illustrative and is in no way intended to limit the present disclosure, its application, or uses.
[0055] The processor 1101 is used to execute a computer program, which can be written in an instruction set of an architecture such as x86, Arm, RISC, MIPS, SSE, etc. The memory 1102 includes, for example, ROM (read-only memory), RAM (random access memory), a non-volatile memory such as a hard disk, etc. The interface device 1103 includes, for example, a USB interface, a network cable interface, a headphone interface, etc. The communication device 1104 is capable of wired or wireless communication, for example, and the communication device 1104 may include at least one short-range communication module, for example, any module for short-range wireless communication based on short-range wireless communication protocols such as Hilink protocol, WiFi (IEEE 802.11 protocol), Mesh, Bluetooth, ZigBee, Thread, Z-Wave, NFC, UWB, LiFi, etc. The communication device 1104 may also include a remote communication module, for example, any module for WLAN, GPRS, 2G / 3G / 4G / 5G remote communication. The output device 1105 may include, for example, a liquid crystal display or a touch display, a speaker, etc. The input device 1106 may include, for example, a touch screen, a keyboard, a microphone, various sensors, etc.
[0056] In this embodiment, the memory 1102 of the electronic device 1000 is used to store a computer program, and the computer program is used to control the processor 1101 to operate so as to execute the data processing method of the virtual object according to any embodiment of the present disclosure.
[0057] Next, Figure 1 Taking the electronic device 1000 as an example of an implementation subject, various embodiments of the virtual object data processing method are described.
[0058] <First Embodiment>
[0059] Figure 2 A data processing method for a virtual object according to some embodiments is shown, and the data processing method for a virtual object may include the following steps S210 to S230:
[0060] Step S210 , in response to a display instruction of the target object, determining first feature information indicating a position of a first vertex of the target object.
[0061] In this embodiment, the display instruction of the target object can be triggered by the user's operation, for example, the user triggers the display instruction by performing a drag gesture operation on the touch screen of the electronic device, or it can be triggered when the game process reaches a set game node, for example, the game system triggers the display instruction after the user completes a game task.
[0062] In this embodiment, the target object may be a virtual object set in a virtual scene, such as a stone, a tree, or a screen, and is set in a virtual scene. The vertex on the outline of the virtual object is the first vertex, and the first feature information may indicate the position of the first vertex in the virtual scene.
[0063] Step S220: obtaining the anchor point position of the target object according to the first feature information.
[0064] In this embodiment, the target object can be composed of multiple facets, and the position of each facet can be represented by the position of the center point of each vertex of the facet. The center point of all facets on an object is the anchor point of the object, and the position of the target object anchor point in the virtual scene is the anchor point position.
[0065] Step S230, obtaining the rotation angle of the facet surrounded by the first vertex of the target object according to the observation information of the target object and the anchor point position; wherein the rotation angle is used to set the moving path of the first vertex of the target object.
[0066] In this embodiment, the observation information of the target object may include the setting position of the target camera in the virtual scene. By calculating the difference between the anchor point position and the setting position of the target camera, the rotation angle of the face surrounded by the first vertex of the target object can be obtained. By using the rotation angle, the target object rotates around its anchor point on the y-axis, and the face of the target object can also be dynamically adjusted as the camera moves or the scene requires.
[0067] In this embodiment, the relative position of the center point of the patch surrounded by the first vertices and the first vertex is set, and the relative position of the center point of the patch surrounded by the first vertices and the anchor point of the target object is also set. Then, in the virtual scene, after the target object rotates around its anchor point by a rotation angle, the position of the center point of the patch surrounded by the first vertices and the anchor point of the target object does not change. The patch surrounded by the first vertices takes the center point of the patch surrounded by the first vertices as the rotation center, and rotates the rotation angle to obtain the moving path of each first vertex, that is, the final position in the moving path of the first vertex is obtained. The final position in the moving path can represent the posture change of the patch surrounded by the first vertices, so as to achieve that the patch of the target object can always face the camera.
[0068] In some embodiments, there are a large number of virtual models in the virtual scene, and some of the virtual models need to adjust their patch poses. In order to screen out the target model that needs to adjust the patch pose from the large number of virtual models, the target object is at least a part of the target model, and a first number of the target objects in the target model is greater than a set threshold, wherein the set threshold is related to the total number of objects configured in the target model.
[0069] In this embodiment, a model in a virtual scene can be configured with multiple sub-objects. When the first number of sub-objects of a specific type in the model is greater than a set threshold, the model is the target model, and the sub-objects of the set type are the target objects. The sub-objects of the specific type are, for example, virtual trees, virtual stones, or virtual pillars. For example, if the model is a virtual mountain, the threshold is set to 10%, the number of virtual trees configured in the virtual mountain accounts for 12% of the total number of sub-objects configured in the virtual mountain, and the number of virtual trees is greater than the total number of objects configured in the virtual mountain, the virtual mountain is the target model, and the virtual trees are the target objects.
[0070] The data processing method for virtual objects according to the first embodiment of the present invention solves the problem in the prior art that when some virtual objects are arranged in a virtual scene, the virtual objects will be rotated or moved, and the facets cannot always face the camera, which makes the presented game screen rough. Based on this method, when the target object needs to be displayed, the first feature information representing the position of the first vertex of the target object is determined, and the anchor point position of the anchor point of the target object is determined through the first feature information, and then the rotation angle of the facet of the target object is set according to the anchor point position and the observation information, so that after the target object is rotated or moved, the facet of the target object can always face the camera through the adjustment of the rotation angle, so as to improve the quality of the presented game screen.
[0071] <Second Embodiment>
[0072] In this embodiment, in order to save the cost of the electronic device, the first feature information indicating the position of the first vertex of the target object may be stored in the second set color channel of the first vertex.
[0073] In these embodiments, relative to the first embodiment, before step S210, the method further includes the following steps S310 to S360:
[0074] Step S310 , in response to a configuration operation of the target object, configuring a first identifier for a first set color channel of a first vertex of the target object.
[0075] In this embodiment, the first set color channel belongs to one of the vertex color channels, and the vertex color channel may include an R channel, a G channel, and a B channel. The first set color channel among the R channel, the G channel, and the B channel of the target object may be configured with a first identifier. For example, the first set color channel is the R channel, and during the configuration of the virtual object, the first identifier is set to "0", and through the vertex shader, the R channel of the virtual object vertex is assigned a value of "0" to set the virtual object as the target object.
[0076] Step S320: input the third feature information of the first vertex into a preset union-find set.
[0077] In this embodiment, the third feature information may be the first vertex of the target object and the edge connecting the first vertex. The third feature information is input into a preset union-find set, and the first vertices on the target object can establish an association relationship, that is, establish connected components of each target object to identify all first vertices in the target object.
[0078] Step S330, determining the anchor point position of the target object's anchor point according to the union-find set.
[0079] In this embodiment, the relevant vertex set of the target object, that is, the vertex set of the first vertices, can be identified by the union-find set. Then, by calculating the average value of the vertex positions of these first vertices, the center position of the geometric center of the target object is obtained, and the geometric center is the anchor point of the target object, and the center position is the anchor point position of the anchor point of the target object.
[0080] Step S340: determining a vector difference between the first vertex of the target object and the anchor point according to the position of the anchor point.
[0081] In this embodiment, when the positions of each first vertex and anchor point are determined, the distance from the first vertex to the anchor point can be calculated, and the maximum value range of these distances and the vector difference between the first vertex and the anchor point can be determined.
[0082] Step S350: normalize the vector difference to obtain first feature information indicating the position of the first vertex.
[0083] In this embodiment, the normalization process may be: dividing the vector difference from each vertex to the anchor point by the maximum value range to obtain a normalized value of the first vertex, and using the normalized value of the first vertex as the first feature information representing the position of the first vertex.
[0084] Step S360: input the first feature information into the second set color channel of the first vertex.
[0085] In this embodiment, the normalized value of the first vertex is stored in the second set color channel of the first vertex as the first feature information of the first vertex. The second set color channel here can be the first set color channel, or it can be another color channel different from the first set color channel. In other words, by storing the first feature information in the second set color channel of the first vertex, the utilization efficiency of the storage space of the electronic device can be effectively improved.
[0086] <Third Embodiment>
[0087] In this embodiment, in order to quickly determine the anchor point position of the target object, the first vertex of the target object can be identified and managed by setting and finding, which effectively improves the efficiency of determining the anchor point position.
[0088] In these embodiments, relative to the above second embodiment, step S330 may include the following step S410:
[0089] According to the connected components of the target object reflected in the union query set, the geometric center of the first vertex of the target object and the center position of the geometric center are determined and used as the anchor point position of the target object.
[0090] In some examples, the target object is set in a three-dimensional virtual scene, and the x coordinate, y coordinate, and z coordinate of the first vertex of the target object can be determined by union-finding, and the average value of the x coordinate of the first vertex, the average value of the y coordinate of the first vertex, and the average value of the z coordinate of the first vertex are calculated. The average value of the x coordinate is used as the x coordinate of the anchor point of the target object, the average value of the y coordinate is used as the y coordinate of the anchor point of the target object, and the average value of the z coordinate is used as the z coordinate of the anchor point of the target object.
[0091] <Fourth Embodiment>
[0092] In this embodiment, in order to ensure that the facet of the target object always faces the camera to provide a better visual effect, the observation information may include the setting position of the target camera, and the rotation angle of the facet of the target object and the moving path of the first vertex are determined by the position difference between the setting position and the anchor point position.
[0093] In these embodiments, compared with the first embodiment, step S230 may include the following steps S510 and S520:
[0094] Step S510, obtaining the rotation angle of the facet surrounded by the first vertex of the target object according to the position difference between the set position and the anchor point position.
[0095] In this embodiment, the observation information of the target object may include the setting position of the target camera in the virtual scene. By calculating the difference between the anchor point position and the setting position of the target camera, the rotation angle a of the face surrounded by the first vertex of the target object can be obtained. By using the rotation angle a, while the target object rotates around its anchor point on the y-axis, the face of the target object can also be dynamically adjusted as the camera moves or the scene requires. For example, when the target object is a virtual tree, when the virtual tree rotates around its anchor point on the y-axis, the branches and leaves on the virtual tree, as the face of the virtual tree, can also be dynamically adjusted as the camera moves or the scene requires.
[0096] Step S520: determining a moving path of the first vertex of the target object according to the rotation angle and the vertex position of the first vertex of the target object.
[0097] In this embodiment, if Figure 1 As shown, the relative position of the center point of the patch P1 surrounded by the first vertices and the first vertex is set, and the relative position of the center point of the patch P1 surrounded by the first vertices and the anchor point of the target object is also set. Then, in this virtual scene, after the target object rotates an angle around its anchor point on the Y axis, the positions of the center point of the patch P1 surrounded by the first vertices and the anchor point of the target object do not change. The patch P1 surrounded by the first vertices is rotated by an angle a with the center point of the patch P1 surrounded by the first vertices as the rotation center, and the moving path of each first vertex can be obtained, that is, the final position in the moving path of the first vertex is obtained. The final position in the moving path can represent the posture change of the patch P1 surrounded by the first vertices, so as to realize that the patch of the target object can always face the camera.
[0098] <Fifth Embodiment>
[0099] In this embodiment, in order to achieve a swaying visual effect of the face on the target object to enhance the rendering power of the picture, the swing amplitude of the first vertex of the target object at different time nodes can be set, and the swing offset of the first vertex can be determined in combination with the rotation angle, so as to achieve a swaying visual effect of the face on the target object while always keeping the face on the target object facing the target camera.
[0100] In these embodiments, compared with the first embodiment, after step S230, the method further includes the following steps S610 to S630:
[0101] Step S610 , in response to a swing setting operation of the target object, obtaining a first vertex position of a second vertex of the target object; wherein the second vertex belongs to the first vertex.
[0102] In this embodiment, the second vertex may be any one of the first vertices, and the first vertex position of the second vertex is a fixed vertex position where the second vertex is located when the target object is set in a three-dimensional virtual scene.
[0103] Step S620: determining the swing amplitude of the second vertex at the first time node according to the position and rotation angle of the first vertex.
[0104] In this embodiment, the swing amplitude can reflect the fluctuation or swing of the second vertex within a given time. Through the rotation angle, the swing direction of the face where the second vertex is located can be perpendicular to the line of sight of the target camera, thereby obtaining a swing effect with better visual experience.
[0105] Step S630: determining the swing offset of the second vertex at the first time node according to the swing amplitude and the rotation angle.
[0106] In this embodiment, the offset position of the second vertex at the first time node can be obtained by swinging the offset and combining it with the known first vertex position of the second vertex, that is, the offset position of the second vertex at the first time node = swinging the offset × the first vertex position of the second vertex.
[0107] <Sixth Embodiment>
[0108] In this embodiment, in order to ensure that the swing direction of the target object's patch is always perpendicular to the line of sight of the target camera, a swing amplitude algorithm is preset. The swing amplitude algorithm can be used to obtain the swing amplitude of the second vertex at the first time node, and then the position of the patch surrounded by the second vertex at the first time node can be obtained, thereby ensuring that the swing direction of the patch at the first time node is perpendicular to the line of sight of the target camera.
[0109] In these embodiments, compared with the fifth embodiment, step S620 may include the following steps S710 and S720:
[0110] Step S710, determining a first position in a first set direction and a second position in a second set direction of a first vertex position; wherein the first set direction and the second set direction are on a set horizontal plane.
[0111] In some examples, such as Figure 3 As shown, the first set direction is, for example, the x direction, the second set direction is, for example, the z direction, the set horizontal plane is, for example, the xz plane, the first position of the first vertex in the first set direction is the x coordinate of the first vertex, and the second position of the first vertex in the second set direction is the z coordinate of the first vertex.
[0112] Step S720: input the first position, the second position, the first time node and the rotation angle into a preset swing amplitude algorithm to obtain the swing amplitude of the second vertex at the first time node.
[0113] In this embodiment, the specific expression of the swing amplitude algorithm is as follows:
[0114] A=sin[xcos(a) + zsin(a) + time] (1)
[0115] In formula (1), A is the swing amplitude, time is the first time node, x is the x coordinate of the first vertex, z is the z coordinate of the first vertex, and a is the rotation angle. The first time node here is generally a moment in the game, such as the 1st second, the 2nd second, or the 10th second. By setting the swing amplitude algorithm, the swing direction can be consistent with the normal of the sight direction of the target camera. As time increases, the swing amplitude algorithm is a sin function, and the value of the sin function can change in the range of [-1, 1], so that the swing direction is perpendicular to the sight direction of the camera.
[0116] <Seventh Embodiment>
[0117] In this embodiment, in order to obtain the swing offset of the second vertex at the first time node to determine the actual position of the second vertex during the swing process, the actual position of the second vertex during the swing process can be determined by setting an offset algorithm.
[0118] In these embodiments, compared with the fifth embodiment, step S630 may include the following step S810:
[0119] Step S810: input the swing amplitude and the rotation angle into a preset offset algorithm to obtain the swing offset of the second vertex at the first time node.
[0120] In this embodiment, the specific expression of the offset algorithm is as follows:
[0121] D1: (sin(a)×A, -cos(a)×A)(2)
[0122] In formula (2), D1 is the second vertex at the first time node, a is the rotation angle, A is the swing amplitude, sin(a)×A is the x-coordinate of the second vertex in the offset position at the first time node, and -cos(a)×A is the z-coordinate of the second vertex in the offset position at the first time node.
[0123] <Device Example>
[0124] Figure 4 FIG. 2 shows a schematic diagram of the structure of a virtual object data processing device according to an embodiment of the present disclosure. Figure 4 As shown, the data processing device 400 of the virtual object includes a response module 410 , a first obtaining module 420 and a second obtaining module 430 .
[0125] The response module 410 is used to determine the first feature information indicating the position of the first vertex of the target object in response to the display instruction of the target object;
[0126] The first obtaining module 420 is used to obtain the anchor point position of the anchor point of the target object according to the first feature information;
[0127] The second obtaining module 430 is used to obtain the rotation angle of the facet surrounded by the first vertex of the target object according to the observation information of the target object and the anchor point position; wherein the rotation angle is used to set the moving path of the first vertex of the target object.
[0128] In some embodiments, the data processing device 400 of the virtual object also includes an input module, which is used to configure a first identifier for a first set color channel of a first vertex in response to a configuration operation of the target object; input the third feature information of the first vertex into a preset union-find set; determine the anchor point position of the anchor point of the target object based on the union-find set; determine the vector difference between the first vertex of the target object and the anchor point based on the anchor point position; normalize the vector difference to obtain first feature information representing the position of the first vertex; and input the first feature information into the second set color channel of the first vertex.
[0129] In some embodiments, the input module is further used to determine the geometric center of the first vertex of the target object and the center position of the geometric center according to the connected components of the target object reflected in the union-find set, and use them as the anchor point position of the target object.
[0130] In some embodiments, the input module is also used to obtain the rotation angle of the facet surrounded by the first vertex of the target object based on the position difference between the set position and the anchor point position; and determine the moving path of the first vertex of the target object based on the rotation angle and the vertex position of the first vertex of the target object.
[0131] In some embodiments, the data processing device 400 of the virtual object also includes an offset determination module, which is used to obtain the first vertex position of the second vertex of the target object in response to the swing setting operation of the target object; wherein the second vertex belongs to the first vertex; according to the first vertex position and the rotation angle, determine the swing amplitude of the second vertex at the first time node; according to the swing amplitude and the rotation angle, determine the swing offset of the second vertex at the first time node.
[0132] In some embodiments, the offset determination module is also used to determine a first position in a first set direction and a second position in a second set direction of a first vertex position; wherein the first set direction and the second set direction are on a set horizontal plane; the first position, the second position, the first time node and the rotation angle are input into a preset swing amplitude algorithm to obtain the swing amplitude of the second vertex at the first time node.
[0133] In some embodiments, the offset determination module is further used to input the swing amplitude and the rotation angle into a preset offset algorithm to obtain the swing offset of the second vertex at the first time node.
[0134] <Equipment Embodiment>
[0135] Figure 5 FIG. 1 shows a schematic diagram of the hardware structure of an electronic device according to some other embodiments. Figure 5 As shown, the electronic device 500 includes a processor 510 and a memory 520, wherein the memory 520 is used to store a computer program, and the computer program is used to control the processor 510 to operate so as to control the electronic device 500 to execute the data processing method of the virtual object according to any embodiment of the present disclosure.
[0136] An embodiment of the present disclosure further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the computer program implements the data processing method of the virtual object according to any embodiment of the present disclosure.
[0137] The embodiments of the present disclosure also provide a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the data processing method of the virtual object according to any embodiment of the disclosure is implemented.
[0138] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and equipment embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0139] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0140] The embodiments of the present specification may be devices, methods and / or computer program products. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the embodiments of the present specification.
[0141] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0142] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0143] The computer program instructions for executing the operation of the embodiments of this specification may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or the first code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, executed as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of a computer-readable program instruction, and the electronic circuit may execute a computer-readable program instruction, thereby realizing various aspects of the embodiments of this specification.
[0144] Various aspects of the embodiments of the present specification are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (equipment) and computer program products according to the embodiments of the present specification. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0145] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0146] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0147] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of this specification. In this regard, each box in the flowchart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.
[0148] The embodiments of the present specification have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations are obvious to those of ordinary skill in the art without departing from the scope of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for processing data of a virtual object, the method comprising: In response to a display instruction of a target object, determining first feature information indicating a position of a first vertex of the target object; Obtaining an anchor point position of an anchor point of the target object according to the first feature information; The rotation angle of the facet surrounded by the first vertex of the target object is obtained according to the observation information of the target object and the anchor point position; wherein the rotation angle is used to set the moving path of the first vertex of the target object.
2. The method according to claim 1, wherein: The method further comprises: In response to a configuration operation of a target object, configuring a first identifier for a first set color channel of a first vertex of the target object; Inputting the third feature information of the first vertex into a preset union-find set; Determining the anchor point position of the anchor point of the target object according to the union-find set; Determine, according to the anchor point position, a vector difference between a first vertex of the target object and the anchor point; Normalizing the vector difference to obtain first feature information indicating the position of the first vertex; The first feature information is input into a second set color channel of the first vertex.
3. The method according to claim 1, wherein: The target object is at least a part of a target model, and a first number of the target objects in the target model is greater than a set threshold, wherein the set threshold is related to a total number of objects configured in the target model.
4. The method according to claim 2, wherein: Determining the anchor point position of the target object according to the union-find set includes: According to the connected components of the target object reflected in the union-check set, the geometric center of the first vertex of the target object and the center position of the geometric center are determined and used as the anchor point position of the target object.
5. The method according to claim 2, wherein: The observation information includes the setting position of the target camera; The step of obtaining the rotation angle of the facet surrounded by the first vertex of the target object according to the observation information of the target object and the anchor point position includes: Obtaining a rotation angle of a patch surrounded by the first vertex of the target object according to a position difference between the set position and the anchor point position; A moving path of the first vertex of the target object is determined according to the rotation angle and the vertex position of the first vertex of the target object.
6. The method according to claim 1, wherein: The method further comprises: In response to the swing setting operation of the target object, acquiring a first vertex position of a second vertex of the target object; wherein the second vertex belongs to the first vertex; Determining a swing amplitude of the second vertex at a first time node according to the first vertex position and the rotation angle; The swing offset of the second vertex at the first time node is determined according to the swing amplitude and the rotation angle.
7. The method according to claim 6, wherein: The step of determining the swing amplitude of the second vertex at the first time node according to the position of the first vertex includes: Determine a first position in a first set direction and a second position in a second set direction of the first vertex position; wherein the first set direction and the second set direction are on a set horizontal plane; The first position, the second position, the first time node and the rotation angle are input into a preset swing amplitude algorithm to obtain the swing amplitude of the second vertex at the first time node.
8. The method according to claim 6, wherein: The determining, according to the swing amplitude and the rotation angle, the swing offset of the second vertex at the first time node includes: The swing amplitude and the rotation angle are input into a preset offset algorithm to obtain the swing offset of the second vertex at the first time node.
9. A data processing device for a virtual object, wherein: include: A response module, configured to determine, in response to a display instruction of a target object, first feature information indicating a position of a first vertex of the target object; A first obtaining module, configured to obtain an anchor point position of an anchor point of the target object according to the first feature information; The second obtaining module is used to obtain the rotation angle of the facet surrounded by the first vertex of the target object according to the observation information of the target object and the anchor point position; wherein the rotation angle is used to set the moving path of the first vertex of the target object.
10. An electronic device, wherein: The method comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the method steps according to any one of claims 1 to 8 under the control of the computer program.
11. A computer-readable storage medium, the computer-readable storage medium comprising a stored computer program, wherein: When the computer program is executed, the method steps of any one of claims 1 to 8 are performed.