CN-115944905-B - Method, device, apparatus and storage medium for manipulating virtual object
Abstract
According to embodiments of the present disclosure, methods, apparatuses, devices, and storage medium for manipulating virtual objects are provided. The method includes determining a first position of a first manipulation device associated with the virtual environment and a second position of a second manipulation device associated with the virtual environment, determining first orientation information based on the first position and the second position, determining a rotation matrix associated with a virtual object drawn in the virtual environment based on the first orientation information and the second orientation information of the first manipulation device, and determining a pose of the virtual object in the virtual environment based on the rotation matrix. Thus, the user can manipulate the virtual object in the virtual environment to make a desired, natural rotation.
Inventors
- JIANG ZEXIN
- ZHANG HAIYU
Assignees
- 北京字跳网络技术有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20221229
Claims (11)
- 1. A method of manipulating a virtual object, comprising: determining a first location of a first manipulation device associated with a virtual environment and a second location of a second manipulation device associated with the virtual environment; determining first orientation information based on the first position, the second position and a holding mode of a virtual object in the virtual environment; Determining a rotation matrix associated with the virtual object drawn in the virtual environment based on the first orientation information and the second orientation information of the first manipulation device, and Based on the rotation matrix, a pose of the virtual object in the virtual environment is determined, wherein an orientation of the virtual object is determined based on the first orientation information, and a self-rotation of the virtual object is determined based on the second orientation information.
- 2. The method of claim 1, wherein determining first orientation information comprises: Based on the first position and the second position, a direction vector of the first position to the second position is determined as the first orientation information.
- 3. The method of claim 2, further comprising: And determining a forward vector of the first control device as the second orientation information.
- 4. The method of claim 3, wherein determining a rotation matrix associated with a virtual object drawn in the virtual environment comprises: performing orthogonalization processing on the direction vector and the forward vector to determine an orthogonalized direction vector and an orthogonalized forward vector, and The rotation matrix is determined based on the orthogonalization direction vector and the orthogonalization forward vector.
- 5. The method of claim 4, wherein determining the rotation matrix comprises: determining a vector product based on the orthogonalization direction vector and the orthogonalization forward vector, and Column vectors of the rotation matrix are determined based on the orthogonalization direction vector, the orthogonalization forward vector, and the vector product, respectively.
- 6. The method of claim 5, wherein a relative order in the rotation matrix of a first column vector corresponding to the orthogonalization direction vector, a second column vector corresponding to the orthogonalization forward vector, and a third column vector corresponding to the vector product is determined based on a self coordinate system of the virtual object.
- 7. The method of claim 1, wherein the virtual object is drawn in the virtual environment to appear to be held by both hands.
- 8. The method of claim 1, further comprising: Receiving a preset interaction for the first manipulation device, and And triggering a virtual function associated with the virtual object in the virtual environment based on the preset interaction.
- 9. An apparatus for manipulating a virtual object, comprising: A location determination module configured to determine a first location of a first manipulation device associated with a virtual environment and a second location of a second manipulation device associated with the virtual environment; an orientation information determination module configured to determine first orientation information based on the first location, the second location, and a manner of holding a virtual object in the virtual environment; A rotation matrix determination module configured to determine a rotation matrix associated with the virtual object drawn in the virtual environment based on the first orientation information and the second orientation information of the first manipulation device, and And a pose determination module configured to determine a pose of the virtual object in the virtual environment based on the rotation matrix, wherein an orientation of the virtual object is determined based on the first orientation information, and a self-rotation of the virtual object is determined based on the second orientation information.
- 10. An electronic device, comprising: At least one processing unit, and At least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, which when executed by the at least one processing unit, cause the electronic device to perform the method of any one of claims 1-8.
- 11. A computer readable storage medium having stored thereon a computer program executable by a processor to implement the method of any of claims 1 to 8.
Description
Method, device, apparatus and storage medium for manipulating virtual object Technical Field Example embodiments of the present disclosure relate generally to the field of computers, and in particular, relate to methods, apparatuses, devices, and computer-readable storage media for manipulating virtual objects. Background Extended Reality (XR) technologies include Virtual Reality (VR), augmented Reality (Augmented Reality, AR), and Mixed Reality (MR). With the advancement of augmented reality technology, building a virtual scene is not limited to mere viewing, but rather, interaction with a virtual object, such as simulating a double-hand holding of a virtual object, is more likely to occur. Disclosure of Invention In a first aspect of the present disclosure, a method of manipulating a virtual object is provided. The method includes determining a first position of a first manipulation device associated with the virtual environment and a second position of a second manipulation device associated with the virtual environment, determining first orientation information based on the first position and the second position, determining a rotation matrix associated with a virtual object drawn in the virtual environment based on the first orientation information and the second orientation information of the first manipulation device, and determining a pose of the virtual object in the virtual environment based on the rotation matrix. In a second aspect of the present disclosure, an apparatus for manipulating a virtual object is provided. The apparatus includes a position determination module configured to determine a first position of a first manipulation device associated with a virtual environment and a second position of a second manipulation device associated with the virtual environment, an orientation information determination module configured to determine first orientation information based on the first position and the second position, a rotation matrix determination module configured to determine a rotation matrix associated with a virtual object drawn in the virtual environment based on the first orientation information and the second orientation information of the first manipulation device, and a pose determination module configured to determine a pose of the virtual object in the virtual environment based on the rotation matrix. In a third aspect of the present disclosure, an electronic device is provided. The apparatus includes at least one processing unit, and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit. The instructions, when executed by at least one processing unit, cause the apparatus to perform the method of the first aspect. In a fourth aspect of the present disclosure, a computer-readable storage medium is provided. The computer readable storage medium has stored thereon a computer program executable by a processor to implement the method of the first aspect. It should be understood that what is described in this summary is not intended to limit the critical or essential features of the embodiments of the disclosure nor to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following description. Drawings The above and other features, advantages and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. In the drawings, wherein like or similar reference numerals denote like or similar elements, in which: FIG. 1 shows a schematic diagram of a prior art virtual object rotation; FIG. 2 illustrates a schematic diagram of an example environment in which embodiments of the present disclosure may be implemented; FIG. 3 illustrates a schematic diagram of one example of determining column vectors in a rotation matrix, according to some embodiments of the present disclosure; FIG. 4 illustrates a flow chart of a process of manipulating a virtual object according to some embodiments of the present disclosure; FIG. 5 illustrates a block diagram of an apparatus for manipulating virtual objects, according to some embodiments of the present disclosure, and Fig. 6 illustrates a block diagram of an apparatus capable of implementing various embodiments of the present disclosure. Detailed Description It will be appreciated that prior to using the technical solutions disclosed in the embodiments of the present disclosure, the user should be informed and authorized of the type, usage range, usage scenario, etc. of the personal information related to the present disclosure in an appropriate manner according to the relevant legal regulations. For example, in response to receiving an active request from a user, a prompt is sent to the user to explicitly prompt the user that the operation it is requesting to perform will require personal informatio