Motion control method and device for virtual object
By generating rotation control vectors and controlling the rotation of virtual objects based on the user's facial rotation state, the problem of poor virtual object motion control experience in existing technologies is solved, and the accuracy and sensitivity of control are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2022-04-19
- Publication Date
- 2026-04-17
AI Technical Summary
The motion control experience of virtual objects in existing technologies is poor, mainly due to the insensitivity and inaccuracy of control caused by translational motion.
By generating rotation control vectors, the virtual object is controlled to rotate based on the user's facial rotation in three-dimensional space. The relationship between the facial rotation angle and the rotation axis is combined to improve the control experience.
It achieves a better control experience, especially with a better display effect at a top-down angle, improving the accuracy and sensitivity of users' motion control of virtual objects.
Smart Images

Figure CN114699770B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of motion control technology, and in particular to a method and device for motion control of a virtual object. Background Technology
[0002] In the field of motion control technology, virtual objects can move continuously on a display interface, and this movement can be controlled by the user. Users can control the virtual objects using a keyboard, mouse, or even facial recognition.
[0003] In existing technology, during the process of a user controlling the movement of a virtual object, the movement process of the virtual object can be displayed on the display interface. (See reference...) Figure 1 As shown, the virtual object is located at position L1 on the display interface at time t1. After moving, it successively reaches position L2 at time t2, position L3 at time t3, position L4 at time t4, and position L5 at time t5. This forms a movement path from L1 to L5. Of course, the display interface only shows the current position of the virtual object at any given time.
[0004] However, the control experience of existing technologies is poor. Summary of the Invention
[0005] This disclosure provides a method and device for controlling the motion of a virtual object, which can control the rotation of the virtual object to improve the control experience.
[0006] In a first aspect, embodiments of this disclosure provide a motion control method for a virtual object, comprising:
[0007] Based on the rotation state of the user's face in real three-dimensional space, a rotation control vector is generated. The rotation state includes the facial rotation angle corresponding to the rotation of the face around at least one rotation axis in the three-dimensional space. The component of the rotation control vector in at least one dimension is associated with the facial rotation angle corresponding to the rotation axis.
[0008] The movement of the virtual object is controlled by the rotation control vector, and the movement includes rotational movement.
[0009] Secondly, embodiments of this disclosure provide a motion control device for a virtual object, comprising:
[0010] A control vector generation module is used to generate a rotation control vector based on the rotation state of the user's face in real three-dimensional space. The rotation state includes the facial rotation angle corresponding to the rotation of the face around at least one rotation axis in the three-dimensional space. The component of the rotation control vector in at least one dimension is associated with the facial rotation angle corresponding to the rotation axis.
[0011] A motion control module is used to control the motion of a virtual object through the rotation control vector, the motion including rotational motion.
[0012] Thirdly, embodiments of this disclosure provide an electronic device, including: at least one processor and a memory;
[0013] The memory stores computer-executed instructions;
[0014] The at least one processor executes computer execution instructions stored in the memory, causing the electronic device to perform the method as described in the first aspect.
[0015] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, cause a computing device to implement the method described in the first aspect.
[0016] Fifthly, embodiments of this disclosure provide a computer program for implementing the method as described in the first aspect.
[0017] This disclosure provides a method and device for motion control of a virtual object. The method includes: generating a rotation control vector based on the rotation state of a user's face in a real three-dimensional space, wherein the rotation state includes: the face rotating around at least one rotation axis in the three-dimensional space by a corresponding facial rotation angle, and the component of the rotation control vector in at least one dimension is associated with the facial rotation angle corresponding to the rotation axis; and controlling the motion of the virtual object through the rotation control vector, wherein the motion includes rotational motion. This disclosure allows the user to control the rotational motion of a virtual object based on the user's facial rotation state, thereby improving the motion control experience of the virtual object. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram of the motion process of a virtual object provided by existing technology;
[0020] Figure 2 This is a flowchart illustrating the steps of a motion control method for a virtual object provided in an embodiment of this disclosure;
[0021] Figure 3This is a schematic diagram of a facial rotation angle provided in an embodiment of the present disclosure;
[0022] Figure 4 This is a structural block diagram of a motion control device for a virtual object provided in an embodiment of this disclosure;
[0023] Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of this disclosure;
[0024] Figure 6 This is a structural block diagram of another electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0026] As described in the background section, the control experience of existing technologies is poor. To address this problem, the inventors analyzed the existing technology and found that one reason for the poor control experience is that virtual objects in existing technologies typically undergo translational motion.
[0027] To address the aforementioned technical problems, this embodiment of the disclosure proposes to improve the control experience by allowing virtual objects to rotate.
[0028] The technical solutions of the present disclosure and how the technical solutions of the present disclosure solve the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present disclosure will now be described with reference to the accompanying drawings.
[0029] Figure 2 This is a flowchart illustrating the steps of a motion control method for a virtual object provided in this embodiment. The virtual object can be any object displayed on the screen of an electronic device. The virtual object varies in different application scenarios. One application scenario of this embodiment is a game scenario, where a game interface can be displayed on the screen, and the virtual object can be understood as a game character that can move within the game interface. This movement can be controlled by the player. It should be noted that the application scenarios of this embodiment are not limited to the aforementioned game scenario, and therefore the virtual object is not limited to the aforementioned game character.
[0030] Reference Figure 2 As shown, the motion control method for this virtual object includes:
[0031] S101: Generate a rotation control vector based on the user's face rotation state in real three-dimensional space. The rotation state includes the face rotation angle corresponding to the face rotation around at least one rotation axis in three-dimensional space. The component of the rotation control vector in at least one dimension is associated with the face rotation angle corresponding to the rotation axis.
[0032] The facial rotation angle can be a vector representing direction and amplitude. In practical applications, multiple rotation axes located in real three-dimensional space can be set, so a facial rotation angle is a rotation angle relative to one rotation axis. The rotation axes can be set arbitrarily, but to represent rotations in various directions with as few rotation axes as possible, three mutually perpendicular rotation axes can be set.
[0033] Figure 3 This is a schematic diagram of a facial rotation angle provided in an embodiment of this disclosure. (Refer to...) Figure 3 As shown, the three coordinate axes—x-axis, y-axis, and z-axis—can each serve as a rotation axis. Therefore, the rotation state of the face can include: the facial rotation angle Pitch corresponding to the face rotating around the x-axis, the facial rotation angle Yaw corresponding to the face rotating around the y-axis, and the facial rotation angle Roll corresponding to the face rotating around the z-axis.
[0034] The above Pitch can also be understood as the rotation angle of the face in the YOZ plane formed by the y-axis and z-axis. The above Yaw can also be understood as the rotation angle of the face in the XOZ plane formed by the x-axis and z-axis. The above Roll can also be understood as the rotation angle of the face in the YOZ plane formed by the x-axis and y-axis.
[0035] The aforementioned rotation control vector can be a three-dimensional vector, and the relationship between its components in each dimension and the facial rotation angle can be flexibly set. For example, at least one facial rotation angle can be used as a component of the rotation control vector in at least one dimension, or the facial rotation angle can be used as a component after undergoing linear or nonlinear transformation.
[0036] It should be noted that when a facial rotation angle is used as one component of the rotation control vector, the user can rotate the face around the corresponding rotation axis to achieve motion control of the virtual object. When multiple facial rotation angles are used as multiple components of the rotation control vector, motion control of the virtual object can be achieved by rotating the face around multiple rotation axes, which helps to increase the diversity of rotational movements and thus enhances the game's fun.
[0037] Optionally, mapping the facial rotation angle to the components of the rotation control vector can be achieved through the following steps: First, obtain the facial rotation angles corresponding to the first rotation axis and the second rotation axis, where the first rotation axis is located in the horizontal plane and parallel to the screen, and the second rotation axis is located in the vertical direction; then, determine the components of the rotation control vector in the third dimension based on the facial rotation angle corresponding to the first rotation axis; then, determine the facial rotation angle corresponding to the second rotation axis as the components of the rotation control vector in the first dimension; finally, set the components of the rotation control vector in the second dimension to 0.
[0038] Wherein, the first axis of rotation can be Figure 3 The x-axis in the equation, the second axis of rotation can be... Figure 3 The y-axis in the diagram.
[0039] Firstly, referring to Figure 3 As shown, embodiments of this disclosure can map the Pitch to the component of a rotation control vector in the third dimension, allowing the user to control the rotation angle of a virtual object in the third dimension of its three-dimensional space and the translational movement of the virtual object in the third dimension of its three-dimensional space by flipping the Pitch up and down. This third dimension can be a vertical dimension.
[0040] Secondly, referring to Figure 3 As shown, embodiments of this disclosure can map the yaw to the component of the rotation control vector in the first dimension, allowing the user to control the rotation angle of the virtual object in the first dimension of its three-dimensional space and the translational motion of the virtual object in the first dimension of its three-dimensional space by flipping the face left and right by the yaw. This first dimension can be a horizontal dimension.
[0041] Thirdly, in this embodiment, the component of the rotation control vector in the second dimension is set to 0, so that the virtual object does not rotate or translate in the second dimension of its three-dimensional space. This second dimension may be a dimension perpendicular to the screen.
[0042] It is understandable that, from a top-down perspective, the movement of the virtual object in the plane formed by the first and third dimensions has a better display effect, while the movement in the second dimension does not have a better display effect from a top-down perspective. Therefore, in this embodiment of the present disclosure, the rotation control vector in the second dimension is set to 0 by the above method to minimize the computational complexity.
[0043] In the first example of this embodiment, considering that the virtual object and the user are mirror images, the component of the rotation control vector in the third dimension is determined to be the opposite of the facial rotation angle corresponding to the first rotation axis. When the user flips their face upward, the virtual object can be guaranteed to translate upward; similarly, when the user flips their face downward, the virtual object can be guaranteed to translate downward. This ensures consistency in movement between the user and the virtual object, helping to improve the accuracy of the user's control over the virtual object.
[0044] In a second example of the embodiments of this disclosure, in order to adjust the control sensitivity in the third dimension, the component of the rotation control vector in the third dimension can be determined according to the first preset coefficient and the opposite number of the facial rotation angle corresponding to the first rotation axis. The first preset coefficient is used to adjust the control sensitivity in the third dimension.
[0045] The component of the rotation control vector in the third dimension can be the product of the first preset coefficient and the opposite of the above.
[0046] Understandably, when the first preset coefficient is greater than 1, users can control the movement of the virtual object by making small vertical facial movements, which helps improve control sensitivity in the third dimension. When the first preset coefficient is less than 1, users can control the movement of the virtual object by making larger vertical facial movements, which reduces sensitivity and helps prevent user misoperation.
[0047] In a third example of the embodiments of this disclosure, in order to flexibly adapt to people's habit of flipping their faces up and down, the angle pitch of the up and down flipping can be modified. Specifically, the sum of the facial rotation angle corresponding to the first rotation axis and the second preset coefficient is first determined as the correction angle, and then the product of the opposite of the correction angle and the first preset coefficient is determined as the component of the rotation control vector in the third dimension.
[0048] The second preset coefficient can be set flexibly, and can be greater than 0 or less than 0.
[0049] When the second preset coefficient is greater than 0, refer to Figure 3 The coordinate system shown allows for downward adjustment of the vertical flip angle. Therefore, if users are accustomed to flipping upwards, the vertical flip angle can be appropriately adjusted downwards to allow for motion control of the virtual object along various rotation axes. Similarly, if users are accustomed to flipping upwards, the vertical flip angle can be appropriately adjusted downwards to control the virtual object's downward translational movement when the user flips upwards by a small amount. In scenarios where users are accustomed to flipping their faces upwards, this can help improve the motion diversity of the virtual object.
[0050] When the second preset coefficient is less than 0, refer to Figure 3 The coordinate system shown allows for upward adjustment of the vertical flip angle. Therefore, if users are accustomed to flipping downwards, the vertical flip angle can be appropriately adjusted upwards to control the virtual object's upward translational movement when the user flips downwards by a small amount. In scenarios where users are accustomed to flipping their faces downwards, this can help improve the movement diversity of the virtual object.
[0051] S102: Control the movement of the virtual object through a rotation control vector, which includes rotational motion.
[0052] Compared to translational motion, the rotational motion of this embodiment can provide users with a better control experience. Compared to translational motion, this rotational motion has a better display effect from a top-down view, thereby improving the control experience from a top-down view.
[0053] In one example of an embodiment of this disclosure, a virtual object can be controlled to rotate in the direction pointed to by a rotation control vector. The rotation control vector can be a three-dimensional vector, whereby the components in each dimension are used to indicate the rotation direction and rotation angle on a corresponding rotation axis.
[0054] In another example of this embodiment, the virtual object can be controlled to rotate using the first rotation parameter corresponding to the rotation control vector. Specifically, this may include the following steps S1021 to S1024:
[0055] S1021, the rotation control vector is converted into a first rotation parameter. The first rotation parameter is used to represent the rotation strategy by a preset number of first sub-parameters. The preset number is greater than the dimension of the rotation control vector.
[0056] It can be seen that, compared to the rotation control vector, the first rotation parameter can represent the rotation strategy with more first sub-parameters, which helps to improve the accuracy of the rotation strategy.
[0057] The first rotation parameter can be a quaternion corresponding to the rotation control vector, and each three-dimensional vector corresponds to a unique quaternion.
[0058] S1022, Obtain the second rotation parameter of the virtual object. The second rotation parameter is used to represent the current orientation of the virtual object through a preset number of second sub-parameters.
[0059] Corresponding to the first rotation parameter, the second rotation parameter can also use more second sub-parameters to represent the current orientation, thereby helping to improve the accuracy of the current orientation.
[0060] The second rotation parameter can be a quaternion, and its acquisition process can include: first, obtaining the three-dimensional vector corresponding to the current orientation of the virtual object as the orientation vector of the virtual object, and then converting the orientation vector into a quaternion to obtain the second rotation parameter.
[0061] S1023, determine the first angle between the first rotation parameter and the second rotation parameter.
[0062] The first angle can also be understood as the angle between the rotation control vector and the orientation vector of the virtual object. When the first rotation parameter and the second rotation parameter are quaternions, the first angle is the angle between the two quaternions.
[0063] S1024, control the virtual object to rotate by the first angle.
[0064] Optionally, when both the first rotation parameter and the second rotation parameter are quaternions, S1024 may specifically include: first determining the minimum value between the first angle and the maximum character rotation angle between two adjacent frames as the second angle; then performing interpolation operations on the first rotation parameter and the second rotation parameter using the second angle to obtain the corresponding third quaternion; and finally controlling the virtual object to rotate using the third quaternion.
[0065] The maximum character rotation angle can be the product of a preset rotation angle and the time interval between two adjacent frames. The preset rotation angle can be set according to the actual application scenario.
[0066] As can be seen, when the first angle is greater than the maximum character rotation angle, the third quaternion corresponds to the maximum character rotation angle, thus realizing the rotation of the virtual object based on the maximum character rotation angle. When the first angle is less than the maximum character rotation angle, the third quaternion corresponds to the first angle, thus realizing the rotation of the virtual object based on the first angle. In other words, the maximum degree of rotation of the virtual object in this embodiment is the maximum character rotation angle, which avoids excessive rotation of the virtual object, resulting in discontinuous visuals.
[0067] Furthermore, the embodiments disclosed herein can achieve rotational motion using quaternions, which helps to avoid the problem of universal joint deadlock.
[0068] Optionally, the aforementioned motion may further include translational motion. In this embodiment, the virtual object can also be controlled to perform translational motion via the aforementioned rotation control vector. Therefore, the motion of the virtual object in this embodiment is a superposition of rotational and translational motions, allowing the user to see the rotational and translational motions of the virtual object from a top-down perspective, thus further enhancing the gaming experience of the virtual object from a top-down perspective.
[0069] Specifically, when performing the above translational motion, the motion vector of the virtual object is first determined based on the aforementioned rotation control vector and the current motion speed of the virtual object. Then, the position of the virtual object after the translational motion is determined by the motion vector, so that the virtual object can be displayed at that position.
[0070] Among them, the rotation control vector, the current motion speed, and the motion vector are all three-dimensional vectors. The motion vector can be the cross product between the rotation control vector and the current motion speed, or it can be called the outer product.
[0071] After obtaining the motion vector, the current position of the virtual object can be added to the motion vector to obtain the position after translation. This position is a location in a three-dimensional coordinate system.
[0072] It should be noted that the translational motion in this embodiment is controlled by the rotation of the face. The mapping relationship between the facial rotation angle and the rotation control vector can affect the correspondence between facial rotation and translational motion. The translational motion can be flexibly adjusted by setting this mapping relationship.
[0073] Optionally, before controlling the virtual object to perform the aforementioned movement, it can be determined whether the magnitude of the rotation control vector is greater than or equal to a preset threshold. If the magnitude of the rotation control vector is greater than or equal to the preset threshold, the virtual object is controlled to perform the aforementioned movement through the rotation control vector. If the magnitude of the rotation control vector is less than the preset threshold, the virtual object is controlled to maintain its current position and current state; that is, the virtual object is controlled not to perform the aforementioned movement.
[0074] As can be seen, this embodiment of the present disclosure can determine that the facial rotation is a user's control command to the virtual object when the rotation is large, thereby controlling the movement of the virtual object. Conversely, when the facial rotation is small, it is determined to be a user error, and the virtual object is kept still. This avoids user errors and improves the accuracy of motion control of the virtual object.
[0075] Optionally, after obtaining the rotation control vector, the rotation control vector can be normalized, and the virtual object's motion can be controlled using the normalized rotation control vector. This reduces the computational complexity when controlling the virtual object's motion using the rotation control vector.
[0076] The normalization process, also known as the unitization process, includes the following steps: First, determine the magnitude of the rotation control vector; then, calculate the ratio of the rotation control vector to the magnitude to obtain the normalized rotation control vector.
[0077] It should be noted that the above normalization process can also be combined with the above modulus judgment. Specifically, if the modulus of the rotation control vector is greater than or equal to a preset threshold, the rotation control vector is first normalized, and the virtual object's movement is controlled by the normalized rotation control vector. If the modulus of the rotation control vector is less than the preset threshold, the virtual object is controlled to maintain its current position and current state; that is, the virtual object is controlled not to move at all.
[0078] Corresponding to the motion control method of the virtual object in the above embodiment, Figure 4 This is a structural block diagram of a motion control device for a virtual object provided in an embodiment of this disclosure. For ease of explanation, only the parts relevant to the embodiments of this disclosure are shown. (Refer to...) Figure 4 The motion control device 200 for the aforementioned virtual object includes a control vector generation module 201 and a motion control module 202.
[0079] The control vector generation module 201 is used to generate a rotation control vector based on the rotation state of the user's face in real three-dimensional space. The rotation state includes the facial rotation angle corresponding to the rotation of the face around at least one rotation axis in the three-dimensional space. The component of the rotation control vector in at least one dimension is associated with the facial rotation angle corresponding to the rotation axis.
[0080] The motion control module 202 is used to control the motion of a virtual object through the rotation control vector, the motion including rotational motion.
[0081] Optionally, the motion control module 202 is further configured to:
[0082] The rotation control vector is converted into a first rotation parameter, which is used to represent the rotation strategy by a preset number of first sub-parameters, the preset number being greater than the dimension of the rotation control vector.
[0083] Obtain the second rotation parameter of the virtual object, which is used to represent the current orientation of the virtual object through the preset number of second sub-parameters.
[0084] Determine the first angle between the first rotation parameter and the second rotation parameter.
[0085] The virtual object is controlled to rotate by the first angle.
[0086] Optionally, both the first rotation parameter and the second rotation parameter are quaternions.
[0087] Optionally, the motion control module 202 is further configured to:
[0088] The minimum value between the first angle and the maximum character rotation angle between two adjacent frames is determined as the second angle.
[0089] By performing interpolation operations on the first quaternion and the second quaternion from the second perspective, the corresponding third quaternion is obtained.
[0090] The virtual object is rotated by controlling the third quaternion.
[0091] Optionally, the motion control module 202 is further configured to:
[0092] If the magnitude of the rotation control vector is greater than or equal to a preset threshold, then the movement of the virtual object is controlled by the rotation control vector.
[0093] Optionally, the motion control module 202 is further configured to:
[0094] The rotation control vector is normalized, and the virtual object's motion is controlled by the normalized rotation control vector.
[0095] Optionally, the control vector generation module 201 is further configured to:
[0096] Obtain the facial rotation angles corresponding to the first rotation axis and the second rotation axis respectively. The first rotation axis is located in the horizontal plane and parallel to the screen, and the second rotation axis is located in the vertical direction.
[0097] The component of the rotation control vector in the third dimension is determined based on the facial rotation angle corresponding to the first rotation axis, and the third dimension is in the vertical direction.
[0098] The facial rotation angle corresponding to the second rotation axis is determined as the component of the rotation control vector in the first dimension, which is in the horizontal direction.
[0099] Set the component of the rotation control vector in the second dimension to 0.
[0100] Optionally, the control vector generation module 201 is further configured to:
[0101] The component of the rotation control vector in the third dimension is determined based on the inverse of the facial rotation angle corresponding to the first rotation axis.
[0102] Optionally, the control vector generation module 201 is further configured to:
[0103] The component of the rotation control vector in the third dimension is determined by the opposite of the first preset coefficient and the facial rotation angle corresponding to the first rotation axis. The first preset coefficient is used to adjust the control sensitivity in the third dimension.
[0104] Optionally, the control vector generation module 201 is further configured to:
[0105] The sum of the facial rotation angle corresponding to the first rotation axis and the second preset coefficient is determined as the correction angle.
[0106] The product of the opposite of the correction angle and the first preset coefficient is determined as the component of the rotation control vector in the third dimension.
[0107] Optionally, the motion further includes translational motion, and the motion control module 202 is further configured to:
[0108] The motion vector of the virtual object is determined based on the rotation control vector and the current motion speed of the virtual object.
[0109] The position of the virtual object after the translational motion is determined by the motion vector.
[0110] The motion control device for the virtual object provided in this embodiment can be used to perform the above-mentioned... Figure 2 The technical solutions of the method embodiments shown are similar in implementation principle and technical effect, and will not be described again here.
[0111] Figure 5 This is a structural block diagram of an electronic device 600 provided in an embodiment of the present disclosure. The electronic device 600 includes a memory 602 and at least one processor 601.
[0112] Among them, memory 602 stores computer-executed instructions.
[0113] At least one processor 601 executes computer execution instructions stored in memory 602, causing electronic device 601 to perform the aforementioned functions. Figure 2 The method in the middle.
[0114] In addition, the electronic device may also include a receiver 603 and a transmitter 604, wherein the receiver 603 is used to receive information from other devices or equipment and forward it to the processor 601, and the transmitter 604 is used to send information to other devices or equipment.
[0115] Further, refer to Figure 6The diagram illustrates a structural schematic of an electronic device 900 suitable for implementing embodiments of the present disclosure. This electronic device 900 can be a terminal device. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0116] like Figure 6 As shown, the electronic device 900 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device 900. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0117] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 An electronic device 900 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0118] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the methods of embodiments of this disclosure.
[0119] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0120] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0121] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
[0122] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can 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 can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0123] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0124] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0125] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0126] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0127] In a first example of the first aspect, embodiments of this disclosure provide a motion control method for a virtual object, comprising:
[0128] Based on the user's face rotation state in real three-dimensional space, a rotation control vector is generated. The rotation state includes the facial rotation angle corresponding to the face rotating around at least one rotation axis in the three-dimensional space. The component of the rotation control vector in at least one dimension is associated with the facial rotation angle corresponding to the rotation axis.
[0129] The movement of the virtual object is controlled by the rotation control vector, and the movement includes rotational movement.
[0130] Based on the first example of the first aspect, in the second example of the first aspect, controlling the motion of the virtual object through the rotation control vector includes:
[0131] The rotation control vector is converted into a first rotation parameter, which is used to represent the rotation strategy by a preset number of first sub-parameters, the preset number being greater than the dimension of the rotation control vector.
[0132] Obtain the second rotation parameter of the virtual object, which is used to represent the current orientation of the virtual object through the preset number of second sub-parameters.
[0133] Determine the first angle between the first rotation parameter and the second rotation parameter.
[0134] The virtual object is controlled to rotate by the first angle.
[0135] Based on the second example of the first aspect, in the third example of the first aspect, both the first rotation parameter and the second rotation parameter are quaternions.
[0136] Based on the third example of the first aspect, in the fourth example of the first aspect, controlling the virtual object to rotate via the first angle includes:
[0137] The minimum value between the first angle and the maximum character rotation angle between two adjacent frames is determined as the second angle.
[0138] By performing interpolation operations on the first quaternion and the second quaternion from the second perspective, the corresponding third quaternion is obtained.
[0139] The virtual object is rotated by controlling the third quaternion.
[0140] Based on the first to fourth examples of the first aspect, in the fifth example of the first aspect, controlling the movement of the virtual object through the rotation control vector includes:
[0141] If the magnitude of the rotation control vector is greater than or equal to a preset threshold, then the movement of the virtual object is controlled by the rotation control vector.
[0142] Based on the fifth example of the first aspect, in the sixth example of the first aspect, controlling the motion of the virtual object through the rotation control vector includes:
[0143] The rotation control vector is normalized, and the virtual object's motion is controlled by the normalized rotation control vector.
[0144] Based on the first to fourth examples of the first aspect, in the seventh example of the first aspect, generating a rotation control vector based on the user's face rotation state in real three-dimensional space includes:
[0145] Obtain the facial rotation angles corresponding to the first rotation axis and the second rotation axis respectively. The first rotation axis is located in the horizontal plane and parallel to the screen, and the second rotation axis is located in the vertical direction.
[0146] The component of the rotation control vector in the third dimension is determined based on the facial rotation angle corresponding to the first rotation axis, and the third dimension is in the vertical direction.
[0147] The facial rotation angle corresponding to the second rotation axis is determined as the component of the rotation control vector in the first dimension, which is in the horizontal direction.
[0148] Set the component of the rotation control vector in the second dimension to 0.
[0149] Based on the seventh example of the first aspect, in the eighth example of the first aspect, determining the component of the rotation control vector in the third dimension according to the facial rotation angle corresponding to the first rotation axis includes:
[0150] The component of the rotation control vector in the third dimension is determined based on the inverse of the facial rotation angle corresponding to the first rotation axis.
[0151] Based on the eighth example of the first aspect, in the ninth example of the first aspect, determining the component of the rotation control vector in the third dimension according to the inverse of the facial rotation angle corresponding to the first rotation axis includes:
[0152] The component of the rotation control vector in the third dimension is determined by the opposite of the first preset coefficient and the facial rotation angle corresponding to the first rotation axis. The first preset coefficient is used to adjust the control sensitivity in the third dimension.
[0153] Based on the ninth example of the first aspect, in the tenth example of the first aspect, determining the component of the rotation control vector in the third dimension by using the inverse of the first preset coefficient and the facial rotation angle corresponding to the first rotation axis includes:
[0154] The sum of the facial rotation angle corresponding to the first rotation axis and the second preset coefficient is determined as the correction angle.
[0155] The product of the opposite of the correction angle and the first preset coefficient is determined as the component of the rotation control vector in the third dimension.
[0156] Based on the first to fourth examples of the first aspect, in the eleventh example of the first aspect, the motion further includes translational motion, and the control of the virtual object's motion via the rotation control vector includes:
[0157] The motion vector of the virtual object is determined based on the rotation control vector and the current motion speed of the virtual object.
[0158] The position of the virtual object after the translational motion is determined by the motion vector.
[0159] In the first example of the second aspect, a motion control device for a virtual object is provided, comprising:
[0160] A control vector generation module is used to generate a rotation control vector based on the rotation state of the user's face in real three-dimensional space. The rotation state includes the facial rotation angle corresponding to the rotation of the face around at least one rotation axis in the three-dimensional space. The component of the rotation control vector in at least one dimension is associated with the facial rotation angle corresponding to the rotation axis.
[0161] A motion control module is used to control the motion of a virtual object through the rotation control vector, the motion including rotational motion.
[0162] Based on the first example of the second aspect, in the second example of the second aspect, the motion control module is further configured to:
[0163] The rotation control vector is converted into a first rotation parameter, which is used to represent the rotation strategy by a preset number of first sub-parameters, the preset number being greater than the dimension of the rotation control vector.
[0164] Obtain the second rotation parameter of the virtual object, which is used to represent the current orientation of the virtual object through the preset number of second sub-parameters.
[0165] Determine the first angle between the first rotation parameter and the second rotation parameter.
[0166] The virtual object is controlled to rotate by the first angle.
[0167] Based on the second example of the second aspect, in the third example of the second aspect, both the first rotation parameter and the second rotation parameter are quaternions.
[0168] Based on the third example of the second aspect, in the fourth example of the second aspect, the motion control module is further configured to:
[0169] The minimum value between the first angle and the maximum character rotation angle between two adjacent frames is determined as the second angle.
[0170] By performing interpolation operations on the first quaternion and the second quaternion from the second perspective, the corresponding third quaternion is obtained.
[0171] The virtual object is rotated by controlling the third quaternion.
[0172] Based on the first to fourth examples of the second aspect, in the fifth example of the second aspect, the motion control module is further configured to:
[0173] If the magnitude of the rotation control vector is greater than or equal to a preset threshold, then the movement of the virtual object is controlled by the rotation control vector.
[0174] Based on the fifth example of the second aspect, in the sixth example of the second aspect, the motion control module is further configured to:
[0175] The rotation control vector is normalized, and the virtual object's motion is controlled by the normalized rotation control vector.
[0176] Based on the first to fourth examples of the second aspect, in the seventh example of the second aspect, the control vector generation module is further configured to:
[0177] Obtain the facial rotation angles corresponding to the first rotation axis and the second rotation axis respectively. The first rotation axis is a rotation axis located in the horizontal plane and parallel to the screen, the second rotation axis is a vertical rotation axis, and the third dimension is in the vertical direction.
[0178] The facial rotation angle corresponding to the second rotation axis is determined as the component of the rotation control vector in the first dimension, which is in the horizontal direction.
[0179] The facial rotation angle corresponding to the second rotation axis is determined as the component of the rotation control vector in the first dimension.
[0180] Set the component of the rotation control vector in the second dimension to 0.
[0181] Based on the seventh example of the second aspect, in the eighth example of the second aspect, the control vector generation module is further configured to:
[0182] The component of the rotation control vector in the third dimension is determined based on the inverse of the facial rotation angle corresponding to the first rotation axis.
[0183] Based on the eighth example of the second aspect, in the ninth example of the second aspect, the control vector generation module is further configured to:
[0184] The component of the rotation control vector in the third dimension is determined by the opposite of the first preset coefficient and the facial rotation angle corresponding to the first rotation axis. The first preset coefficient is used to adjust the control sensitivity in the third dimension.
[0185] Based on the ninth example of the second aspect, in the tenth example of the second aspect, the control vector generation module is further configured to:
[0186] The sum of the facial rotation angle corresponding to the first rotation axis and the second preset coefficient is determined as the correction angle.
[0187] The product of the opposite of the correction angle and the first preset coefficient is determined as the component of the rotation control vector in the third dimension.
[0188] Based on the first to fourth examples of the second aspect, in the eleventh example of the second aspect, the motion further includes translational motion, and the motion control module is further configured to:
[0189] The motion vector of the virtual object is determined based on the rotation control vector and the current motion speed of the virtual object.
[0190] The position of the virtual object after the translational motion is determined by the motion vector.
[0191] Thirdly, according to one or more embodiments of the present disclosure, an electronic device is provided, including: at least one processor and a memory.
[0192] The memory stores computer-executed instructions.
[0193] The at least one processor executes computer execution instructions stored in the memory, causing the electronic device to implement the method described in any of the first aspects.
[0194] Fourthly, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, the computer-readable storage medium storing computer-executable instructions that, when executed by a processor, cause a computing device to implement the method described in any one of the first aspects.
[0195] Fifthly, according to one or more embodiments of the present disclosure, a computer program is provided for implementing the method described in any of the first aspects.
[0196] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0197] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0198] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method of motion control of a virtual object, characterized by, The method includes: Based on the rotation state of the user's face in real three-dimensional space, a rotation control vector is generated. The rotation state includes the facial rotation angle corresponding to the rotation of the face around at least one rotation axis in the three-dimensional space. The component of the rotation control vector in at least one dimension is associated with the facial rotation angle corresponding to the rotation axis. The component of the rotation control vector in that dimension is obtained by linear or non-linear transformation of the facial rotation angle. The movement of the virtual object is controlled by the rotation control vector, and the movement includes rotational movement; Wherein, controlling the motion of the virtual object through the rotation control vector includes: The rotation control vector is converted into a first rotation parameter, which is used to represent the rotation strategy through a preset number of first sub-parameters, the preset number being greater than the dimension of the rotation control vector; Obtain the second rotation parameter of the virtual object. The second rotation parameter is used to represent the current orientation of the virtual object through the preset number of second sub-parameters. Both the first rotation parameter and the second rotation parameter are quaternions. Determine the first angle between the first rotation parameter and the second rotation parameter; The minimum value between the first angle and the maximum character rotation angle between two adjacent frames is determined as the second angle. By performing interpolation on the first rotation parameter and the second rotation parameter using the second angle, the corresponding third quaternion is obtained; The virtual object is rotated by controlling the third quaternion.
2. The method of claim 1, wherein, The step of controlling the movement of the virtual object through the rotation control vector includes: If the magnitude of the rotation control vector is greater than or equal to a preset threshold, then the movement of the virtual object is controlled by the rotation control vector.
3. The method of claim 2, wherein, The step of controlling the movement of the virtual object through the rotation control vector includes: The rotation control vector is normalized, and the motion of the virtual object is controlled by the normalized rotation control vector.
4. The method of claim 1, wherein, The step of generating a rotation control vector based on the user's facial rotation in real three-dimensional space includes: Obtain the facial rotation angles corresponding to the first rotation axis and the second rotation axis respectively. The first rotation axis is located in the horizontal plane and parallel to the screen, and the second rotation axis is located in the vertical direction. The component of the rotation control vector in the third dimension is determined based on the facial rotation angle corresponding to the first rotation axis, and the third dimension is in the vertical direction. The facial rotation angle corresponding to the second rotation axis is determined as the component of the rotation control vector in the first dimension, which is in the horizontal direction; Set the component of the rotation control vector in the second dimension to 0.
5. The method of claim 4, wherein, The step of determining the components of the rotation control vector in the third dimension based on the facial rotation angle corresponding to the first rotation axis includes: The component of the rotation control vector in the third dimension is determined based on the inverse of the facial rotation angle corresponding to the first rotation axis.
6. The method of claim 5, wherein, The step of determining the component of the rotation control vector in the third dimension based on the negative of the facial rotation angle corresponding to the first rotation axis includes: The component of the rotation control vector in the third dimension is determined by the opposite of the first preset coefficient and the facial rotation angle corresponding to the first rotation axis. The first preset coefficient is used to adjust the control sensitivity in the third dimension.
7. The method of claim 6, wherein, The step of determining the components of the rotation control vector in the third dimension by using the inverse of the first preset coefficient and the facial rotation angle corresponding to the first rotation axis includes: The sum of the facial rotation angle corresponding to the first rotation axis and the second preset coefficient is determined as the correction angle; The product of the opposite of the correction angle and the first preset coefficient is determined as the component of the rotation control vector in the third dimension.
8. The method of claim 1, wherein, The motion also includes translational motion, and controlling the motion of the virtual object through the rotation control vector includes: The motion vector of the virtual object is determined based on the rotation control vector and the current motion speed of the virtual object; The position of the virtual object after the translational motion is determined by the motion vector.
9. A motion control apparatus of a virtual object, characterized by, The device includes: A control vector generation module is used to generate a rotation control vector based on the rotation state of the user's face in real three-dimensional space. The rotation state includes the facial rotation angle corresponding to the rotation of the face around at least one rotation axis in the three-dimensional space. The component of the rotation control vector in at least one dimension is associated with the facial rotation angle corresponding to the rotation axis. The component of the rotation control vector in that dimension is obtained by linear or nonlinear transformation of the facial rotation angle. The motion control module is used to control the motion of a virtual object through the rotation control vector, the motion including rotational motion; The motion control module is also used for: The rotation control vector is converted into a first rotation parameter, which is used to represent the rotation strategy through a preset number of first sub-parameters, the preset number being greater than the dimension of the rotation control vector; Obtain the second rotation parameter of the virtual object. The second rotation parameter is used to represent the current orientation of the virtual object through the preset number of second sub-parameters. Both the first rotation parameter and the second rotation parameter are quaternions. Determine the first angle between the first rotation parameter and the second rotation parameter; The minimum value between the first angle and the maximum character rotation angle between two adjacent frames is determined as the second angle. By performing interpolation on the first rotation parameter and the second rotation parameter using the second angle, the corresponding third quaternion is obtained; The virtual object is rotated by controlling the third quaternion.
10. An electronic device, comprising: include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the electronic device to perform the method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer-executable instructions that, when executed by the processor, cause the computing device to implement the method of any one of claims 1-8.
12. A computer program, characterized in that, The computer program is for implementing the method of any one of claims 1-8.
Citation Information
Patent Citations
Method and device for controlling movement of virtual game object, processor and terminal
CN108514741A
Control method and device, glasses and storage medium
CN111580734A
Three-dimensional virtual character control device and method, storage medium and electronic equipment
CN112241203A
Carrier plane movement control method and device based on virtual engine
CN113457153A