Virtual Scenario Display Method, Device, Computer Equipment and Storage Medium
By adjusting the display position of two-dimensional virtual objects in the virtual scene when the field angle of the virtual camera changes, the problem of missing hierarchy caused by the unchanged size of virtual items in the virtual scene is solved, and a better display effect of the virtual scene is achieved.
Patent Information
- Application Number
- CN202011233140.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-06
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2040-11-06
AI Technical Summary
Virtual items in virtual scenes in existing electronic games are displayed at the same size, resulting in the virtual scene lacking a sense of hierarchy and poor display effect.
When the field angle of the virtual camera changes, the new display position of the two-dimensional virtual object in the virtual scene image is obtained based on the display position of the two-dimensional virtual object in the virtual scene image, and the new virtual scene image is displayed after the field angle changes to ensure that the display position of the two-dimensional virtual object is accurate.
After the field of view angle changes, the display position of the two-dimensional virtual objects in the virtual scene image is accurate, which improves the display effect of the virtual scene, so that it not only presents a three-dimensional effect, but also maintains the correct display position of the two-dimensional virtual objects.
Smart Images

Figure CN113384880B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and particularly to a virtual scene display method, apparatus, computer device, and storage medium. Background Art
[0002] With the development of computer technology, the types of electronic games are becoming more and more diverse. In some electronic games, a virtual orthogonal camera is used to capture a virtual scene, and the captured virtual scene image is displayed. However, in this virtual scene image, virtual objects in the virtual scene are all displayed in their original sizes. For example, in a virtual scene image including multiple identical virtual chairs, no matter where the virtual chairs are located in the virtual scene image, the multiple virtual chairs are all displayed in the same size, resulting in a lack of layering in the virtual scene image and a poor display effect. Summary of the Invention
[0003] The embodiments of the present application provide a virtual scene display method, apparatus, computer device, and storage medium, which can improve the display effect of the virtual scene. The technical solutions are as follows:
[0004] On the one hand, a virtual scene display method is provided. The method includes:
[0005] Display a first virtual scene image, where the first virtual scene image includes two-dimensional virtual objects in the virtual scene, and the first virtual scene image is obtained by a virtual camera capturing the virtual scene, and the image captured by the virtual camera shows the effect of objects being larger when closer and smaller when farther away;
[0006] In response to a change in the field of view angle of the virtual camera, based on the first display position of the two-dimensional virtual object in the first virtual scene image, obtain the second display position of the two-dimensional virtual object;
[0007] Display a second virtual scene image, and the two-dimensional virtual object is displayed at the second display position in the second virtual scene image.
[0008] On the other hand, a virtual scene display apparatus is provided. The apparatus includes:
[0009] An image display module, configured to display a first virtual scene image, where the first virtual scene image includes two-dimensional virtual objects in the virtual scene, and the first virtual scene image is obtained by a virtual camera capturing the virtual scene, and the image captured by the virtual camera shows the effect of objects being larger when closer and smaller when farther away;
[0010] A first position acquisition module, configured to, in response to a change in the field of view angle of the virtual camera, acquire a second display position of the two-dimensional virtual object based on a first display position of the two-dimensional virtual object in the first virtual scene image;
[0011] The image display module is further configured to display a second virtual scene image, and display the two-dimensional virtual object at the second display position in the second virtual scene image.
[0012] In a possible implementation manner, the first position acquisition module includes:
[0013] A first matrix determination unit, configured to, in response to the field of view angle of the virtual camera changing from a first field of view angle to a second field of view angle, determine a field of view angle transformation matrix corresponding to the two-dimensional virtual object based on the first field of view angle and the second field of view angle, where the field of view angle transformation matrix is used to indicate the change situation of the field of view angle of the virtual camera;
[0014] A first position acquisition unit, configured to acquire a second display position of the two-dimensional virtual object based on the first display position and the field of view angle transformation matrix.
[0015] In another possible implementation manner, the first matrix determination unit is configured to fuse a projection matrix of the first field of view angle and a projection matrix of the second field of view angle to obtain the field of view angle transformation matrix.
[0016] In another possible implementation manner, the first position acquisition unit is configured to, based on the first field of view angle, determine a target coordinate of a reference point of the two-dimensional virtual object in a first coordinate system, where the first coordinate system is a coordinate system of the virtual camera at the first field of view angle; acquire a first offset matrix of the two-dimensional virtual object in the first coordinate system, where the first offset matrix includes offsets of multiple points of the two-dimensional virtual object from the reference point in the first coordinate system, and the multiple points form the two-dimensional virtual object; and determine the second display position based on the target coordinate, the first offset matrix, and the perspective transformation matrix.
[0017] In another possible implementation manner, the first position acquisition unit is configured to acquire a second offset matrix of the two-dimensional virtual object in a second coordinate system, where the second coordinate system is a coordinate system of the two-dimensional virtual object, and the second offset matrix includes offsets of multiple points of the two-dimensional virtual object from the reference point in the second coordinate system; and perform coordinate transformation on the second offset matrix to obtain the first offset matrix.
[0018] In another possible implementation manner, the first position acquisition unit is configured to acquire the reference coordinates of the reference point of the two-dimensional virtual object in a second coordinate system, where the second coordinate system is the coordinate system of the two-dimensional virtual object; perform coordinate system transformation on the reference coordinates to obtain the target coordinates.
[0019] In another possible implementation manner, the apparatus further includes:
[0020] A change amount determination module, configured to determine the position change amount between the second display position and the first display position;
[0021] A position adjustment module, configured to adjust the position of the two-dimensional virtual object in the virtual scene according to the position change amount;
[0022] A scene rendering module, configured to render the virtual scene captured by the virtual camera after the field of view angle changes to obtain the second virtual scene image.
[0023] In another possible implementation manner, the two-dimensional virtual item held by the two-dimensional virtual object; the apparatus further includes:
[0024] A second position acquisition module, configured to acquire the third display position of the two-dimensional virtual item based on the relative display position of the two-dimensional virtual item and the two-dimensional virtual object in the first virtual scene image;
[0025] An item display module, configured to display the two-dimensional virtual item at the third display position in the second virtual scene image.
[0026] In another possible implementation manner, the second position acquisition module includes:
[0027] A second matrix determination unit, configured to, in response to the field of view angle of the virtual camera changing from a first field of view angle to a second field of view angle, determine a field of view angle transformation matrix corresponding to the two-dimensional virtual object based on the first field of view angle and the second field of view angle, where the field of view angle transformation matrix is used to indicate the situation of the change in the field of view angle of the virtual camera;
[0028] A second position acquisition unit, configured to acquire the third display position of the two-dimensional virtual item based on the relative display position and the field of view angle transformation matrix.
[0029] In another possible implementation, the second position acquisition unit is configured to acquire a target offset between a reference point of the two-dimensional virtual object and a reference point of the two-dimensional virtual item in a first coordinate system, where the first coordinate system is the coordinate system of the virtual camera at the first field of view angle; acquire a third offset matrix of the two-dimensional virtual item in the first coordinate system, where the third offset matrix includes offsets between multiple points of the two-dimensional virtual item and the reference point of the two-dimensional virtual object in the first coordinate system, and the multiple points form the two-dimensional virtual item; and determine the third display position based on the target offset, the third offset matrix, and the perspective transformation matrix.
[0030] In another possible implementation, the second position acquisition unit is configured to acquire a reference offset between a reference point of the two-dimensional virtual object and a reference point of the two-dimensional virtual item in a third coordinate system, where the third coordinate system is the coordinate system of the two-dimensional virtual item; and perform coordinate transformation on the reference offset to obtain the target offset.
[0031] In another possible implementation, the second position acquisition unit is configured to acquire a fourth offset matrix of the two-dimensional virtual item in a third coordinate system, where the third coordinate system is the coordinate system of the two-dimensional virtual item, and the fourth offset matrix includes offsets between multiple points of the two-dimensional virtual item and the reference point of the two-dimensional virtual object in the third coordinate system; and perform coordinate transformation on the fourth offset matrix to obtain the third offset matrix.
[0032] On the other hand, a computer device is provided, which includes a processor and a memory. At least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the operations performed in the virtual scene display method as described in the above aspects.
[0033] On the other hand, a computer-readable storage medium is provided, in which at least one computer program is stored, and the at least one computer program is loaded and executed by a processor to implement the operations performed in the virtual scene display method as described in the above aspects.
[0034] In still another aspect, a computer program product or a computer program is provided. The computer program product or the computer program includes computer program code, and the computer program code is stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device implements the operations performed in the virtual scene display method as described in the above aspects.
[0035] The beneficial effects brought by the technical solutions provided in the embodiments of the present application at least include:
[0036] The method, device, computer device, and storage medium provided in the embodiments of the present application correct the display position of the two-dimensional virtual object in the virtual scene image when the field of view angle of the virtual camera changes on the premise of ensuring the effect that the virtual scene image presents objects that are larger when closer and smaller when farther away. As a result, in the virtual scene image obtained after the change of the field of view angle, the two-dimensional virtual object is displayed according to the corrected display position, and the virtual scene image not only presents a three-dimensional effect but also ensures the accurate display position of the two-dimensional virtual object, thereby improving the display effect of the virtual scene. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0038] Figure 1 It is a schematic structural diagram of an implementation environment provided by an embodiment of the present application;
[0039] Figure 2 It is a flowchart of a virtual scene display method provided by an embodiment of the present application;
[0040] Figure 3 It is a flowchart of a virtual scene display method provided by an embodiment of the present application;
[0041] Figure 4 It is a schematic diagram of a virtual scene image provided by an embodiment of the present application;
[0042] Figure 5 It is a schematic diagram of a virtual scene image provided by an embodiment of the present application;
[0043] Figure 6 It is a schematic diagram of a virtual scene image provided by an embodiment of the present application;
[0044] Figure 7 It is a schematic diagram of a virtual scene image provided by an embodiment of the present application;
[0045] Figure 8 It is a schematic diagram of a virtual scene image provided by an embodiment of the present application;
[0046] Figure 9 It is a schematic diagram of a virtual scene image in a three-dimensional scene provided by an embodiment of the present application;
[0047] Figure 10It is a schematic structural diagram of a virtual scene display device provided by an embodiment of the present application;
[0048] Figure 11 It is a schematic structural diagram of a virtual scene display device provided by an embodiment of the present application;
[0049] Figure 12 It is a schematic structural diagram of a terminal provided by an embodiment of the present application;
[0050] Figure 13 It is a schematic structural diagram of a server provided by an embodiment of the present application. Detailed implementation manners
[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.
[0052] The terms "first", "second", "third", "fourth", etc. used in the present application may be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the present application, the first offset matrix may be referred to as the second offset matrix, and similarly, the second offset matrix may be referred to as the first offset matrix.
[0053] The terms "at least one", "multiple", "each", "any one" used in the present application, at least one includes one, two, or more than two, multiple includes two or more than two, and each refers to each of the corresponding multiple, and any one refers to any one of the multiple. For example, multiple points include 3 points, and each refers to each of these 3 points, and any one refers to any one of these 3 points, which is the first point, or, is the second point, or, is the third point.
[0054] The virtual scene display method provided by the embodiments of the present application can be used in a computer device. Optionally, the computer device is a terminal or a server. Optionally, the server is an independent physical server, or, is a server cluster or a distributed system composed of multiple physical servers, or, is a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto.
[0055] Figure 1It is a schematic structural diagram of an implementation environment provided by an embodiment of the present application. As Figure 1 shown, the system includes a terminal 101 and a server 102. The terminal 101 and the server 102 can be directly or indirectly connected through wired or wireless communication means, and the present application does not limit this here.
[0056] The server 102 provides virtual scene images for the terminal 101. The terminal 101 can display the virtual scene images provided by the server 102, and the terminal 101 can control the virtual scene. The server 102 is used to provide background support for the terminal 101 and can perform background processing according to the control of the virtual scene by the terminal 101.
[0057] Optionally, a game application is installed on the terminal 101, and the server 102 provides services for the game application. Through the game application, the terminal 101 and the server 102 can interact. The server 102 provides services for the terminal 101 so that the terminal 101 can display virtual scene images and can operate on the virtual scene images, such as controlling virtual objects to attack or move.
[0058] The method provided by the embodiment of the present application can be used in multiple scenarios.
[0059] For example, in a horizontal game scene:
[0060] A horizontal game application runs on a computer device. Through the horizontal game application running on the computer device, a two-dimensional virtual object in the virtual scene can be controlled to move left and right. When adjusting the field of view angle of the virtual camera in the horizontal game, the method provided by the embodiment of the present application is adopted to display the virtual scene image of the horizontal game, so that in the case where the virtual scene image presents the effect of near-big and far-small, and the two-dimensional virtual object is accurately displayed in the virtual scene image, both the three-dimensional effect presented by the virtual scene image is ensured, and the display position of the two-dimensional virtual object in the virtual scene image is accurate, thereby improving the display effect of the virtual scene.
[0061] Figure 2 It is a flowchart of a virtual scene display method provided by an embodiment of the present application, which is applied to a computer device. As Figure 2 shown, the method includes:
[0062] 201. The computer device displays a first virtual scene image.
[0063] Among them, the first virtual scene image includes two-dimensional virtual objects in the virtual scene. The first virtual scene image is obtained by a virtual camera shooting the virtual scene, and the image captured by the virtual camera shows the effect of objects being larger when closer and smaller when farther away. For example, in the virtual scene image, there are multiple identical two-dimensional virtual items. The two-dimensional virtual item closer to the virtual camera is displayed with a larger size, and the two-dimensional virtual item farther from the virtual camera is displayed with a smaller size.
[0064] 202. The computer device, in response to a change in the field of view angle of the virtual camera, obtains the second display position of the two-dimensional virtual object based on the first display position of the two-dimensional virtual object in the first virtual scene image.
[0065] Among them, the field of view angle of the virtual camera is used to indicate the range that the virtual camera can capture. The larger the field of view angle, the larger the captured range, and the smaller the field of view angle, the smaller the captured range. The first display position is used to indicate the position of the two-dimensional virtual object in the first virtual scene image, and the second display position is used to indicate the display position of the two-dimensional virtual object in the second virtual scene image captured after the change in the field of view angle of the virtual camera.
[0066] Since the image captured by the virtual camera shows the effect of objects being larger when closer and smaller when farther away, when using this virtual camera to shoot the virtual scene, if the field of view angle of the virtual camera changes, it will cause the position of the two-dimensional virtual object in the virtual scene image to change, resulting in the display position of the two-dimensional virtual object in the virtual scene image being different from the position of the two-dimensional virtual object in the virtual scene. Therefore, when the field of view angle of the virtual camera changes, it is necessary to re-determine the second display position of the two-dimensional virtual object to ensure that the display position of the two-dimensional virtual object in the virtual scene image obtained after the change in the field of view angle is accurate.
[0067] 203. The computer device displays the second virtual scene image, and the two-dimensional virtual object is displayed at the second display position in the second virtual scene image.
[0068] In the embodiments of the present application, the position in the virtual scene corresponding to the first display position of the two-dimensional virtual object is the same as the position in the virtual scene corresponding to the second display position of the two-dimensional virtual object. By displaying the two-dimensional virtual object at the second display position in the second virtual scene image, the display position in the second virtual scene image corresponds to the position of the two-dimensional virtual object in the virtual scene, ensuring the accuracy of the display position of the two-dimensional virtual object.
[0069] The method provided by the embodiment of the present application corrects the display position of the two-dimensional virtual object in the virtual scene image when the field of view angle of the virtual camera changes, on the premise of ensuring that the virtual scene image presents the effect of objects being larger when closer and smaller when farther away. As a result, in the virtual scene image obtained after the change of the field of view angle, the two-dimensional virtual object is displayed according to the corrected display position, so that the virtual scene image presents a three-dimensional effect and can ensure the accurate display position of the two-dimensional virtual object, thereby improving the display effect of the virtual scene.
[0070] Figure 3 is a flowchart of a virtual scene display method provided by the embodiment of the present application, which is applied to a computer device, such as Figure 3 shown, the method includes:
[0071] 301. The computer device displays a first virtual scene image, and the first virtual scene image includes a two-dimensional virtual object in the virtual scene.
[0072] In the embodiment of the present application, the virtual camera is used to capture the virtual scene, so that the obtained virtual scene image presents a perspective effect, that is, the effect of objects being larger when closer and smaller when farther away, and the two-dimensional virtual object in the virtual scene image is corrected, and the two-dimensional virtual object itself does not produce a perspective effect. For example, the two-dimensional virtual object in the virtual scene image is displayed according to the scaling ratio of the position where it is located, so that the virtual scene image presents a perspective effect of objects being larger when closer and smaller when farther away, but the scaling ratios of different parts of the two-dimensional virtual object itself are equal, that is, the two-dimensional virtual object itself does not produce a perspective effect.
[0073] Optionally, the virtual camera is a virtual perspective camera. After the virtual perspective camera captures the virtual scene, the obtained virtual scene image presents a perspective effect, that is, the virtual scene image presents the effect of objects being larger when closer and smaller when farther away. In the embodiment of the present application, in the first virtual scene image, except for the two-dimensional virtual object, other parts of the virtual scene present the effect of objects being larger when closer and smaller when farther away, and the two-dimensional virtual object does not present a perspective effect.
[0074] The two-dimensional virtual object presents a two-dimensional display effect in the virtual scene image. Optionally, the two-dimensional virtual object is a virtual character, a virtual animal, etc. In a possible implementation manner, the two-dimensional virtual object corresponds to a three-dimensional virtual object in the virtual scene. Based on the virtual camera capturing the virtual scene, the captured virtual scene is rendered to obtain the first virtual scene image, so that the two-dimensional virtual object is presented in the first virtual scene image.
[0075] 302. The computer device responds to the change of the field of view angle of the virtual camera from the first field of view angle to the second field of view angle, and determines the field of view angle transformation matrix corresponding to the two-dimensional virtual object based on the first field of view angle and the second field of view angle.
[0076] Wherein, the first field of view angle is the field of view angle before the change of the virtual camera, and the second field of view angle is the field of view angle after the change of the virtual camera. The field of view angle transformation matrix is used to indicate the change of the field of view angle of the virtual camera. Through the first field of view angle and the second field of view angle, a field of view angle transformation matrix indicating the change of the field of view angle of the virtual camera is determined, so as to subsequently determine the display position of the two-dimensional virtual object according to the field of view angle transformation matrix.
[0077] In a possible implementation manner, step 302 includes: fusing the projection matrix of the first field of view angle and the projection matrix of the second field of view angle to obtain a field of view angle transformation matrix. Wherein, the projection matrix is used to indicate the matrix of the virtual scene captured by the virtual camera projected onto the virtual scene image, and the projection matrices corresponding to different fields of view angles are different, that is, the projection matrix of the first field of view angle is different from the projection matrix of the second field of view angle.
[0078] Optionally, the process of obtaining the field of view angle transformation matrix includes: determining the inverse matrix of the projection matrix of the first field of view angle, and determining the product between the projection matrix of the second field of view angle and the inverse matrix as the field of view angle transformation matrix.
[0079] Optionally, the projection matrix M of the first field of view angle x , the projection matrix M of the second field of view angle y and the field of view angle transformation matrix T view , satisfy the following relationship:
[0080]
[0081] Wherein, represents the inverse matrix of the projection matrix M of the first field of view angle x ; x represents the first field of view angle; y represents the second field of view angle.
[0082] 303. The computer device determines the target coordinates of the reference point of the two-dimensional virtual object in the first coordinate system based on the first field of view angle.
[0083] Wherein, the first coordinate system is the coordinate system of the virtual camera at the first field of view angle. The reference point of the two-dimensional virtual object is any point of the two-dimensional virtual object. Optionally, the reference point of the two-dimensional virtual object is the origin in the second coordinate system of the two-dimensional virtual object.
[0084] Through the reference point of the two-dimensional virtual object and the first coordinate system of the virtual camera at the first field of view angle, the target coordinates of the reference point of the two-dimensional virtual object in the first coordinate system can be determined, so as to subsequently determine the display position of the two-dimensional virtual object after the change of the field of view angle of the virtual camera according to the target coordinates.
[0085] In a possible implementation, step 303 includes: obtaining the reference coordinates of the reference point of the two-dimensional virtual object in the second coordinate system, and performing coordinate system transformation on the reference coordinates to obtain the target coordinates.
[0086] Wherein, the second coordinate system is the coordinate system of the two-dimensional virtual object. The reference point of the two-dimensional virtual object has different coordinate values in different coordinate systems. The coordinate of the reference point in the second coordinate system is called the reference coordinate, and the coordinate of the reference point in the first coordinate system is called the target coordinate.
[0087] Optionally, the origin in the second coordinate system is the reference point of the two-dimensional virtual object. Then, perform coordinate system transformation on the coordinates of the origin in the second coordinate system to obtain the target coordinates of the origin in the first coordinate system.
[0088] Optionally, the coordinates of the origin in the second coordinate system and the target coordinates O of the origin in the first coordinate system view satisfy the following relationship:
[0089]
[0090] Wherein, T0 represents the transformation matrix from the second coordinate system of the two-dimensional virtual object to the first coordinate system of the virtual camera. For example, if the coordinates of the origin in the second coordinate system are (0, 0, 0), then the coordinate Wherein, 1 is an indication identifier for indicating that the first three elements in are coordinates.
[0091] 304. The computer device obtains the first offset matrix of the two-dimensional virtual object in the first coordinate system.
[0092] Wherein, the first offset matrix includes the offsets of multiple points of the two-dimensional virtual object from the reference point in the first coordinate system. In the embodiments of the present application, the two-dimensional virtual object is composed of multiple points. The offset between each point and the reference point represents the relative position between each point and the reference point. By determining the offsets between multiple points of the two-dimensional virtual object and the reference point of the two-dimensional virtual object, the relative positions between multiple points of the two-dimensional virtual object and the reference point are determined, that is, the relative position between the two-dimensional virtual object and the reference point is determined.
[0093] In a possible implementation, step 304 includes: obtaining the second offset matrix of the two-dimensional virtual object in the second coordinate system, and performing coordinate system transformation on the second offset matrix to obtain the first offset matrix.
[0094] Among them, the second coordinate system is the coordinate system of the two-dimensional virtual object, and the second offset matrix includes the offsets of multiple points of the two-dimensional virtual object and the reference point in the second coordinate system. For example, if the reference point of the two-dimensional virtual object is the origin of the second coordinate system, then in the second coordinate system, the offsets between multiple points of the two-dimensional virtual object and the origin constitute the second offset matrix to represent the relative position of the two-dimensional virtual object and the origin.
[0095] By determining the second offset matrix in the second coordinate system and converting the second offset matrix in the second coordinate system to the first coordinate system, the first offset matrix is obtained.
[0096] 305. The computer device determines the second display position based on the target coordinate, the first offset matrix, and the perspective transformation matrix.
[0097] Among them, the second display position is used to represent the display position of the two-dimensional virtual object in the virtual scene image after the field of view angle of the virtual camera changes.
[0098] After determining that the field of view angle of the virtual camera changes from the first field of view angle to the second field of view angle, since the target coordinate is the coordinate of the reference point of the two-dimensional virtual object in the first coordinate system, the first offset matrix can represent the relative positions of multiple points of the two-dimensional virtual object and the reference point in the first coordinate system, and the perspective transformation matrix indicates the change of the field of view angle of the virtual camera. Then, through the target coordinate, the first offset matrix, and the perspective transformation matrix, the second display position of the two-dimensional virtual object can be determined after the field of view angle of the virtual camera changes to the second field of view angle, so that the two-dimensional virtual object can be displayed at the second display position in the second virtual scene image subsequently.
[0099] In a possible implementation manner, the target coordinate O view , the first offset matrix V view , the field of view angle transformation matrix T view , and the second display position P" view satisfy the following relationship:
[0100]
[0101] Among them, x is used to represent the first field of view angle; y is used to represent the second field of view angle.
[0102] Optionally, if the reference point of the two-dimensional virtual object is the origin of the second coordinate system of the two-dimensional virtual object, then the first offset matrix V view satisfies the following relationship:
[0103] V view = (P local ·xyz, 0)·T0;
[0104] Among them, P localrepresents the origin of the two-dimensional virtual object in the second coordinate system; x, y, and z respectively represent the coordinate values of each point of the two-dimensional virtual object on the x-axis, y-axis, and z-axis in the second coordinate system; P local ·xyz represents the offset of each point of the two-dimensional virtual object from the origin of the second coordinate system in the second coordinate system; 0 is an indication identifier for indicating P local ·xyz is a vector; T0 represents the transformation matrix from the second coordinate system of the two-dimensional virtual object to the first coordinate system of the virtual camera.
[0105] It should be noted that in the embodiments of the present application, the target coordinates and the first offset matrix of the two-dimensional virtual object are used to determine the second display position of the two-dimensional virtual object for description. In another embodiment, steps 303-305 do not need to be executed, and other methods can be adopted to obtain the second display position of the two-dimensional virtual object based on the first display position and the field of view transformation matrix.
[0106] It should be noted that in the embodiments of the present application, the field of view transformation matrix corresponding to the virtual object is used to determine the second display position of the two-dimensional virtual object for description. In another embodiment, steps 302-305 do not need to be executed. In response to a change in the field of view of the virtual camera, other methods can be adopted to obtain the second display position of the two-dimensional virtual object based on the first display position of the two-dimensional virtual object in the first virtual scene image.
[0107] 306. The computer device displays the second virtual scene image, and a two-dimensional virtual object is displayed at the second display position in the second virtual scene image.
[0108] Among them, the second virtual scene image includes the virtual scene that the virtual camera can capture after the field of view changes and the two-dimensional virtual object located in the virtual scene, and the two-dimensional virtual object is displayed at the second display position to ensure that the display position of the two-dimensional virtual object is correct and corresponds to the position of the two-dimensional virtual object in the virtual scene. In the embodiments of the present application, if only the field of view of the virtual camera changes and the position of the virtual object in the virtual scene does not change, the display position of the two-dimensional virtual object in the virtual scene image may change, but the second display position of the two-dimensional virtual object is the same as the position corresponding to the first display position of the two-dimensional virtual object in the virtual scene.
[0109] In a possible implementation manner, before step 306, the method further includes: determining the position change amount between the second display position and the first display position, adjusting the position of the two-dimensional virtual object in the virtual scene according to the position change amount, and rendering the virtual scene captured by the virtual camera after the field of view changes to obtain the second virtual scene image.
[0110] Through the first display position and the second display position of the two-dimensional virtual object, the position change of the two-dimensional virtual object after the field of view angle of the virtual camera changes can be determined, and the display position of the two-dimensional virtual object is adjusted according to the position change to ensure that the display position of the two-dimensional virtual object in the displayed second virtual scene image is accurate.
[0111] In one possible implementation, step 306 includes: determining a fourth display position of the two-dimensional virtual object in the clipping coordinate system based on the second display position, and rendering the virtual scene captured by the virtual camera at the second field of view angle based on the fourth display position to obtain the second virtual scene image, so that the two-dimensional virtual object is displayed at the third display position in the second virtual scene image.
[0112] Optionally, the second display position P″′ view , the projection matrix M of the first field of view x and the fourth display position P of the two-dimensional virtual object in the clipping coordinate system clip , satisfying the following relationship:
[0113] P clip =P" view ·M x ;
[0114] Optionally, determine a fourth position P of the two-dimensional virtual object in the clipping coordinate system clip The process includes: according to the projection matrix M of the first field of view x , the projection matrix M of the second field of view y , the target coordinates O of the two-dimensional virtual object in the first coordinate system view , determine the third coordinate O′ of the two-dimensional virtual object in the first coordinate system view After the virtual camera's field of view changes, the third coordinate O' view The position converted to the clipping coordinate system corresponds to the display position of the two-dimensional virtual object in the virtual scene image after the field of view angle changes. x , the projection matrix M of the second field of view y , target coordinates O view , the third coordinate O′ view , satisfying the following relationship:
[0115] O view ·M x =O′ view ·M y ;
[0116]
[0117] Wherein, x is used to represent the first viewing angle; y is used to represent the second viewing angle; The projection matrix M representing the second field of view angle y The inverse matrix of
[0118] Then the second display position P″′ view The projection matrix M of the first field of view angle x And the fourth display position P of the two-dimensional virtual object in the clipping coordinate system clip Satisfy the following relationship:
[0119] P clip = P″ view ·M x ;
[0120]
[0121] Where x represents the first field of view angle; y represents the second field of view angle; M x Represents the projection matrix of the first field of view angle; O view Represents the target coordinate; M y Represents the projection matrix of the second field of view angle; Represents the inverse matrix of the projection matrix M of the first field of view angle; V x Represents the first offset matrix. view Represents the first offset matrix.
[0122] It should be noted that the embodiments of the present application are only described by determining the position of the two-dimensional virtual object after the field of view angle of the virtual camera changes. In response to the virtual scene including two-dimensional virtual items, determining the position in the virtual scene image is similar to the process of determining the two-dimensional virtual object, which will not be elaborated here.
[0123] In addition, the above embodiments are only described by determining the position of the two-dimensional virtual object after the field of view angle of the virtual camera changes. In another embodiment, if the virtual object in the virtual scene holds a two-dimensional virtual item, then after step 302, the method further includes the following steps 307-310:
[0124] 307. The computer device obtains the target offset of the reference point of the two-dimensional virtual object and the reference point of the two-dimensional virtual item in the first coordinate system.
[0125] In the embodiments of the present application, since the two-dimensional virtual object holds the two-dimensional virtual item, therefore, in order to ensure that the positions of the two-dimensional virtual item and the two-dimensional virtual object are accurately displayed after the field of view angle of the virtual camera changes, therefore, the relative display position between the two-dimensional virtual item and the two-dimensional virtual object is used to determine the display position of the two-dimensional virtual item to ensure the accurate display position of the two-dimensional virtual item in the virtual scene image with the change of the field of view angle of the virtual camera.
[0126] Among them, the reference point of the two-dimensional virtual item is any point of the two-dimensional virtual item. Optionally, the reference point of the two-dimensional virtual item is the origin of the third coordinate system of the two-dimensional virtual item. The target offset is used to represent the offset vector between the reference point of the two-dimensional virtual object and the reference point of the two-dimensional virtual item in the first coordinate system. Optionally, the target offset is represented by a vector.
[0127] In a possible implementation, step 307 includes: obtaining the reference offset between the reference point of the two-dimensional virtual object and the reference point of the two-dimensional virtual item in the third coordinate system, and performing coordinate system transformation on the reference offset to obtain the target offset.
[0128] Among them, the third coordinate system is the coordinate system of the two-dimensional virtual item. The reference offset is used to indicate the offset between the reference point of the two-dimensional virtual object and the reference point of the two-dimensional virtual item in the third coordinate system. Optionally, the reference offset is represented in the form of a vector. After determining the reference offset in the third coordinate system, the target offset is obtained by converting the reference offset in the third coordinate system to the first coordinate system.
[0129] Optionally, determine the first coordinate of the reference point of the two-dimensional virtual object in the third coordinate system and the second coordinate of the reference point of the two-dimensional virtual object in the third coordinate system, and determine the reference offset by taking the difference between the first coordinate and the second coordinate.
[0130] 308. The computer device obtains the third offset matrix of the two-dimensional virtual item in the first coordinate system.
[0131] Among them, the third offset matrix includes the offsets between multiple points of the two-dimensional virtual item and the reference point of the two-dimensional virtual object in the first coordinate system. In the embodiments of the present application, the two-dimensional virtual item is composed of multiple points. The offset between each point and the reference point represents the relative position between each point and the reference point. By determining the offsets between multiple points of the two-dimensional virtual item and the reference point of the two-dimensional virtual item, the relative positions between multiple points of the two-dimensional virtual item and the reference point can be determined, and thus the relative position between the two-dimensional virtual item and the reference point can be determined.
[0132] In a possible implementation, step 308 includes: obtaining the fourth offset matrix of the two-dimensional virtual item in the third coordinate system, and performing coordinate system transformation on the fourth offset matrix to obtain the third offset matrix.
[0133] Among them, the third coordinate system is the coordinate system of the two-dimensional virtual item, and the fourth offset matrix includes the offsets of multiple points of the two-dimensional virtual item and the reference point of the two-dimensional virtual object in the third coordinate system. For example, if the reference point of the two-dimensional virtual item is the origin of the third coordinate system, then in the third coordinate system, the offsets between multiple points of the two-dimensional virtual item and the origin constitute the third offset matrix to represent the relative position of the two-dimensional virtual item and the origin.
[0134] In the third coordinate system, by determining the offset between each point of the two-dimensional virtual item and the reference point of the two-dimensional virtual item, the fourth offset matrix can be obtained. By transforming the fourth offset matrix, the fourth offset matrix is transformed to the first coordinate system to obtain the third offset matrix.
[0135] Optionally, obtain the fifth offset matrix of the two-dimensional virtual item in the third coordinate system, obtain the reference offset between the reference point of the two-dimensional virtual object and the reference point of the two-dimensional virtual item in the third coordinate system, and determine the fourth offset matrix based on the fifth offset matrix and the reference offset. Among them, the fifth offset matrix includes the offsets of multiple points of the two-dimensional virtual item and the reference point of the two-dimensional virtual item in the third coordinate system.
[0136] Optionally, determine the difference between the fifth offset matrix and the reference offset as the fourth offset matrix.
[0137] 309. The computer device determines the third display position based on the target offset, the third offset matrix, and the perspective transformation matrix.
[0138] Among them, the third display position is used to represent the display position of the two-dimensional virtual item in the virtual scene image after the field of view angle of the virtual camera changes.
[0139] After determining the target offset, the third offset matrix, and the perspective transformation matrix of the two-dimensional virtual item, the position of the two-dimensional virtual item in the virtual scene image and the third display position can be determined after the field of view angle of the virtual camera changes.
[0140] After determining that the field of view angle of the virtual camera changes from the first field of view angle to the second field of view angle, since the target offset is the offset vector between the reference point of the two-dimensional virtual object and the reference point of the two-dimensional virtual item in the first coordinate system, the third offset matrix can represent the relative position of multiple points of the two-dimensional virtual item and the reference point of the two-dimensional virtual object in the first coordinate system, and the perspective transformation matrix indicates the change of the field of view angle of the virtual camera. Then, through the target offset, the third offset matrix, and the perspective transformation matrix, the third display position of the two-dimensional virtual item can be determined after the field of view angle of the virtual camera changes to the second field of view angle, so that the two-dimensional virtual item can be displayed at the third display position of the second virtual scene image subsequently.
[0141] In a possible implementation, the target offset Q view , the third offset matrix the field of view transformation matrix T view and the third display position P″′ view , satisfy the following relationship:
[0142]
[0143] where x is used to represent the first field of view angle; y is used to represent the second field of view angle.
[0144] It should be noted that in the embodiments of this application, the third display position of the two-dimensional virtual item is determined based on the target offset and the third offset matrix of the two-dimensional virtual item. In another embodiment, steps 307-309 do not need to be executed, and other methods can be adopted to obtain the third display position of the two-dimensional virtual item based on the relative display position and the field of view transformation matrix.
[0145] It should be noted that in the embodiments of this application, the third display position of the two-dimensional virtual item is determined based on the field of view transformation matrix corresponding to the virtual object. In another embodiment, steps 302, 307-309 do not need to be executed, and other methods can be adopted to obtain the third display position of the two-dimensional virtual item based on the relative display position between the two-dimensional virtual item and the two-dimensional virtual object in the first virtual scene image.
[0146] 310. The computer device displays the two-dimensional virtual item at the third display position in the second virtual scene image.
[0147] After determining the third display position of the two-dimensional virtual item in the second virtual scene image, the two-dimensional virtual item is displayed at the third display position to ensure that the position of the two-dimensional virtual item is accurately displayed after the field of view angle of the virtual camera changes.
[0148] It should be noted that the embodiments of this application only describe the two-dimensional virtual item held by the two-dimensional virtual object. In another embodiment, if the two-dimensional virtual item includes two-dimensional sub-virtual items, the display position of the two-dimensional sub-virtual item is determined by determining the relationship between the two-dimensional sub-virtual item and the two-dimensional virtual object to which it belongs, and then the two-dimensional sub-virtual item is displayed in the second scene image.
[0149] The method provided by the embodiments of this application can make the displayed virtual scene reflect a three-dimensional virtual effect, and the two-dimensional virtual object does not deform, thus ensuring the display effect of the virtual scene.
[0150] In the embodiments of the present application, the virtual scene includes three-dimensional virtual objects. The virtual scene is rendered by a three-dimensional virtual camera, so that the virtual scene presents a three-dimensional display effect, and the three-dimensional virtual objects are rendered to obtain two-dimensional virtual objects corresponding to the three-dimensional virtual objects, so that the display effect of the two-dimensional virtual objects presented in the virtual scene image is the same as that rendered by an orthographic camera, and the display position of the two-dimensional virtual objects is corrected to ensure that the display position of the two-dimensional virtual objects in the virtual scene image is the same as the position of the three-dimensional virtual objects in the three-dimensional virtual scene.
[0151] The method provided by the embodiments of the present application corrects the display position of the two-dimensional virtual objects in the virtual scene image when the field of view angle of the virtual camera changes, on the premise of ensuring that the virtual scene image presents the effect of near-big and far-small. So that in the virtual scene image obtained after the change of the field of view angle, the two-dimensional virtual objects are displayed according to the corrected display position, and the virtual scene image not only presents a three-dimensional effect, but also ensures the accurate display position of the two-dimensional virtual objects, thereby improving the display effect of the virtual scene.
[0152] Moreover, when the two-dimensional virtual object holds a virtual item, the display position of the two-dimensional virtual object in the virtual scene image obtained after the change of the field of view angle is determined by the relative display position of the two-dimensional virtual item and the two-dimensional virtual object in the first virtual scene image, ensuring the fitting of the display positions of the two-dimensional virtual object and the two-dimensional virtual item in the virtual scene image, and improving the display effect of the virtual scene.
[0153] Based on the method provided in the above embodiments, after the field of view angle of the virtual camera changes, for example, the first field of view angle of the virtual camera is 5 degrees and the second field of view angle is 90 degrees. If directly based on the first field of view angle and the second field of view angle of the virtual camera to determine any position P view The position P' of P in the coordinate system of the second field of view angle view , then the position P view , the position P' view Satisfy the following relationship:
[0154]
[0155] Among them, P view Is used to represent the position in the coordinate system before the change of the field of view angle of the virtual camera, P' view Is used to represent the position in the coordinate system after the change of the field of view angle of the virtual camera, and M5 is used to represent the projection matrix with a changed field of view angle of 5, Is used to represent the inverse matrix of the projection matrix with a changed field of view angle of 90.
[0156] Through the above relationship, the position Pv iewThe position P' in the coordinate system converted to the second field of view angle view After that, according to the position P' view Display the virtual scene image of the two-dimensional virtual object, such as Figure 4 As shown, in the case where the image captured by the virtual camera presents the effect of objects being larger when closer and smaller when farther away, if the field of view angle of the virtual camera changes, the display position of the virtual object in the virtual scene image will shift, resulting in inaccurate display position of the two-dimensional virtual object in the virtual scene image. Therefore, in order to ensure the accurate display position of the two-dimensional virtual object in the virtual scene image, based on the method provided in the above embodiment, determine the display position of the two-dimensional virtual object after the change of the field of view angle of the virtual camera, so that the two-dimensional virtual object in the virtual scene image is displayed according to the determined display position, as Figure 5 Shown to ensure the accurate display position of the two-dimensional virtual object.
[0157] Based on the virtual scene display method provided in the above embodiment, the computer device includes a CPU (Central Processing Unit, central processor), a Constant Buffer (constant buffer), and a vertex shader.
[0158] The CPU obtains the first field of view angle and the second field of view angle before and after the change of the virtual camera, and determines the field of view angle transformation matrix T view According to the values of the parameters in, and send the vector To the Constant Buffer for use by the vertex shader.
[0159] In the embodiment of the present application, both the two-dimensional virtual object and the two-dimensional virtual item have corresponding vertex shaders. After the field of view angle of the virtual camera changes, for the vertex shader of the two-dimensional virtual object, obtain the vector from the Constant Buffer, and determine the field of view angle transformation matrix T view , and execute the above steps 303-305 to determine the second display position of the two-dimensional virtual object. For the vertex shader of the two-dimensional virtual item, obtain the vector from the Constant Buffer, and determine the field of view angle transformation matrix T view , and execute the above steps 307-309 to determine the third display position of the two-dimensional virtual item.
[0160] In addition, when determining the third display position of the two-dimensional virtual item, the CPU calls the GetParentRelativeLocation function to determine the parent object to which the two-dimensional virtual item belongs. In response to the parent object being a virtual object, the coordinates of the two-dimensional virtual object relative to the two-dimensional virtual item are determined, thereby determining the target offset of the two-dimensional virtual item relative to the two-dimensional virtual object, so as to subsequently determine the third display position of the two-dimensional virtual item through the vertex shader of the two-dimensional virtual item.
[0161] In addition, based on the method provided in the above embodiment, if there are two-dimensional virtual items in the virtual scene and the two-dimensional virtual items are not held by the two-dimensional virtual object, when determining the display position of the two-dimensional virtual item, it is similar to the method for determining the display position of the two-dimensional virtual object described above; if there are two-dimensional virtual items in the virtual scene and the two-dimensional virtual object holds the two-dimensional virtual item, when determining the display position of the two-dimensional virtual item, the display position of the two-dimensional virtual item held by the two-dimensional virtual object is determined according to the above method. Since the two-dimensional virtual object in the virtual scene may pick up the virtual item in the virtual scene, or the two-dimensional virtual object may discard the two-dimensional virtual item it holds, in order to avoid the jump of the displayed virtual scene image at the moment when the two-dimensional virtual object picks up or discards the two-dimensional virtual item, therefore, a dimension is added to the target offset, and the value of this dimension is used to represent a switch value. The CPU gradually sets the switch value of the target offset. For example, the switch values include 2 and 3. 2 indicates that the coordinate value is the coordinate value under the two-dimensional virtual item, and 3 indicates the value of the reference point of the two-dimensional virtual object in the coordinate system of the two-dimensional virtual item. Then, by setting the switch value to 2.1, 2.3, 2.5, 2.7, 2.9, the two-dimensional virtual object displayed in the virtual scene image does not jump when picking up or discarding the two-dimensional virtual item, thus ensuring the display effect of the virtual scene.
[0162] In addition, based on the method provided in the embodiments of the present application, the target coordinates of the two-dimensional virtual object and the coordinates of the reference point of the two-dimensional virtual item are both set to fixed values in the coordinate system of the virtual camera, so that the virtual scene image can present an orthogonal display effect and display the virtual scene in the manner of a landscape scene.
[0163] In addition, the method provided in the embodiments of the present application can be applied to both landscape games and top-down view IO games, and can improve the display effect of the virtual scene.
[0164] Such as Figure 6As shown, based on the method provided in the above embodiments, the virtual objects displayed in the virtual scene image all present the effect of being larger in the distance and smaller up close, that is, the virtual scene image presents a perspective effect. After the field of view angle of the virtual camera changes, the cube 601 in the virtual scene image will be deformed, that is, the cube 601 presents a perspective effect. Through the method provided in the embodiments of the present application, the display position of the cube 602 in the virtual scene image after the field of view angle of the virtual camera changes is determined, and the cube 602 is displayed in the virtual scene image according to the determined display position, that is, the cube 602 is not deformed, and the perspective effect of the cube is corrected, so that the display position of the cube 602 is accurate.
[0165] Figure 7 and Figure 8 are all schematic diagrams of the virtual scene image. As Figure 7 shown, the two-dimensional virtual object 701 and the two-dimensional virtual object 702 have the same distance from the virtual camera. Then, compared with the two-dimensional virtual object 701 and the two-dimensional virtual object 702, the two-dimensional virtual object 701 and the two-dimensional virtual object 702 do not deform themselves, that is, neither the two-dimensional virtual object 701 nor the two-dimensional virtual object 702 produces a perspective effect. As Figure 8 shown, the sizes of the two-dimensional virtual objects at different positions in the virtual scene image may be different. That is, the two-dimensional virtual object 801 is close to the virtual camera, and the two-dimensional virtual object 802 is far from the virtual camera. Then, in the second virtual scene image, the two-dimensional virtual object 801 has a large display size, and the two-dimensional virtual object 802 has a small display size. Moreover, based on the method provided in the embodiments of the present application, the virtual camera can freely move the lens. For example, the position of the virtual camera changes, or the virtual camera rotates the shooting angle, so that different scene images can be presented in the virtual scene image, and the virtual scene can show a three-dimensional display effect. As Figure 8 shown, the virtual scene image presents the back of the two-dimensional virtual object, and ensures that the virtual scene image presents the effect of being larger in the near and smaller in the distance, and the two-dimensional virtual object itself does not produce a perspective effect.
[0166] Based on the method provided in the embodiments of the present application, the free switching between the landscape rendering mode and the three-dimensional rendering mode can be realized. Figure 9 is a virtual scene image in a three-dimensional scene. As Figure 9 shown, the virtual object 701 and the virtual object 702 belong to the same virtual object. By performing lens movement processing on the virtual object, the virtual object 702 rotates relative to the virtual object 701 by an angle, so that the virtual object itself can present a three-dimensional effect display. Through the method provided in the embodiments of the present application, both the display effect of landscape rendering and the three-dimensional rendering mode can be realized, and flexible switching between multiple rendering schemes can be performed, ensuring the flexibility of virtual scene display.
[0167] Figure 10 is a schematic structural diagram of a virtual scene display device provided by an embodiment of the present application. As Figure 10 shown, the device includes:
[0168] An image display module 1001, configured to display a first virtual scene image, where the first virtual scene image includes two-dimensional virtual objects in the virtual scene, and the first virtual scene image is obtained by a virtual camera photographing the virtual scene, and the image photographed by the virtual camera presents the effect of objects being larger when closer and smaller when farther away;
[0169] A first position acquisition module 1002, configured to, in response to a change in the field of view angle of the virtual camera, acquire a second display position of the two-dimensional virtual object based on a first display position of the two-dimensional virtual object in the first virtual scene image;
[0170] The image display module 1001 is further configured to display a second virtual scene image, and the two-dimensional virtual object is displayed at the second display position in the second virtual scene image.
[0171] In a possible implementation manner, as Figure 11 shown, the first position acquisition module 1002 includes:
[0172] A first matrix determination unit 1021, configured to, in response to the field of view angle of the virtual camera changing from a first field of view angle to a second field of view angle, determine a field of view angle transformation matrix corresponding to the two-dimensional virtual object based on the first field of view angle and the second field of view angle, where the field of view angle transformation matrix is used to indicate the change in the field of view angle of the virtual camera;
[0173] A first position acquisition unit 1022, configured to acquire a second display position of the two-dimensional virtual object based on the first display position and the field of view angle transformation matrix.
[0174] In another possible implementation manner, the first matrix determination unit 1021 is configured to fuse the projection matrix of the first field of view angle and the projection matrix of the second field of view angle to obtain a field of view angle transformation matrix.
[0175] In another possible implementation manner, the first position acquisition unit 1022 is configured to determine a target coordinate of a reference point of the two-dimensional virtual object in a first coordinate system based on the first field of view angle, where the first coordinate system is the coordinate system of the virtual camera at the first field of view angle; acquire a first offset matrix of the two-dimensional virtual object in the first coordinate system, where the first offset matrix includes the offsets of multiple points of the two-dimensional virtual object from the reference point in the first coordinate system, and the multiple points form the two-dimensional virtual object; and determine the second display position based on the target coordinate, the first offset matrix, and the perspective transformation matrix.
[0176] In another possible implementation manner, the first position acquisition unit 1022 is configured to acquire a second offset matrix of the two-dimensional virtual object in a second coordinate system, where the second coordinate system is the coordinate system of the two-dimensional virtual object, and the second offset matrix includes the offsets of multiple points of the two-dimensional virtual object and a reference point in the second coordinate system; perform coordinate system transformation on the second offset matrix to obtain a first offset matrix.
[0177] In another possible implementation manner, the first position acquisition unit 1022 is configured to acquire a reference coordinate of a reference point of the two-dimensional virtual object in a second coordinate system, where the second coordinate system is the coordinate system of the two-dimensional virtual object; perform coordinate system transformation on the reference coordinate to obtain a target coordinate.
[0178] In another possible implementation manner, as Figure 11 shown, the apparatus further includes:
[0179] A change amount determination module 1003, configured to determine a position change amount between a second display position and a first display position;
[0180] A position adjustment module 1004, configured to adjust the position of the two-dimensional virtual object in the virtual scene according to the position change amount;
[0181] A scene rendering module 1005, configured to render the virtual scene captured by the virtual camera after the field of view angle changes to obtain a second virtual scene image.
[0182] In another possible implementation manner, a two-dimensional virtual item held by the two-dimensional virtual object; as Figure 11 shown, the apparatus further includes:
[0183] A second position acquisition module 1006, configured to acquire a third display position of the two-dimensional virtual item based on the relative display position of the two-dimensional virtual item and the two-dimensional virtual object in the first virtual scene image;
[0184] An item display module 1007, configured to display the two-dimensional virtual item at the third display position in the second virtual scene image.
[0185] In another possible implementation manner, as Figure 11 shown, the second position acquisition module 1006 includes:
[0186] A second matrix determination unit 1061, configured to, in response to the field of view angle of the virtual camera changing from a first field of view angle to a second field of view angle, determine a field of view angle transformation matrix corresponding to the two-dimensional virtual object based on the first field of view angle and the second field of view angle, where the field of view angle transformation matrix is used to indicate the situation of the change in the field of view angle of the virtual camera;
[0187] A second position acquisition unit 1062, configured to acquire a third display position of the two-dimensional virtual item based on a relative display position and a field of view angle transformation matrix.
[0188] In another possible implementation, the second position acquisition unit 1062 is configured to acquire a target offset between a reference point of the two-dimensional virtual object and a reference point of the two-dimensional virtual item in a first coordinate system, where the first coordinate system is a coordinate system of the virtual camera at a first field of view angle; acquire a third offset matrix of the two-dimensional virtual item in the first coordinate system, where the third offset matrix includes offsets between multiple points of the two-dimensional virtual item and the reference point of the two-dimensional virtual object in the first coordinate system, and the multiple points form the two-dimensional virtual item; and determine the third display position based on the target offset, the third offset matrix, and a perspective transformation matrix.
[0189] In another possible implementation, the second position acquisition unit 1062 is configured to acquire a reference offset between a reference point of the two-dimensional virtual object and a reference point of the two-dimensional virtual item in a third coordinate system, where the third coordinate system is a coordinate system of the two-dimensional virtual item; and perform a coordinate system transformation on the reference offset to obtain a target offset.
[0190] In another possible implementation, the second position acquisition unit 1062 is configured to acquire a fourth offset matrix of the two-dimensional virtual item in a third coordinate system, where the third coordinate system is a coordinate system of the two-dimensional virtual item, and the fourth offset matrix includes offsets between multiple points of the two-dimensional virtual item and the reference point of the two-dimensional virtual object in the third coordinate system; and perform a coordinate system transformation on the fourth offset matrix to obtain a third offset matrix.
[0191] It should be noted that: for the virtual scene display device provided in the above embodiments, only the above division of each functional module is used for illustration. In practical applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the virtual scene display device provided in the above embodiments and the embodiments of the virtual scene display method belong to the same concept. For the specific implementation process, please refer to the method embodiments, which will not be elaborated here.
[0192] An embodiment of the present application further provides a computer device, which includes a processor and a memory. At least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the operations performed in the virtual scene display method in the above embodiments.
[0193] Optionally, the computer device is provided as a terminal. Figure 12The structural block diagram of the terminal 1200 provided by an exemplary embodiment of the present application is shown. The terminal 1200 may be a portable mobile terminal, such as: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer or a desktop computer. The terminal 1200 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, etc.
[0194] The terminal 1200 includes: a processor 1201 and a memory 1202.
[0195] The processor 1201 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1201 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), PLA (Programmable Logic Array). The processor 1201 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1201 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1201 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.
[0196] The memory 1202 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 1202 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices, flash storage devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1202 is used to store at least one computer program, and the at least one computer program is used to be executed by the processor 1201 to implement the virtual scene display method provided in the method embodiments of the present application.
[0197] In some embodiments, the terminal 1200 may further optionally include: a peripheral device interface 1203 and at least one peripheral device. The processor 1201, the memory 1202, and the peripheral device interface 1203 may be connected by a bus or signal lines. Each peripheral device may be connected to the peripheral device interface 1203 through a bus, signal lines, or a circuit board. Specifically, the peripheral device includes at least one of: a radio frequency circuit 1204, a display screen 1205, a camera assembly 1206, an audio circuit 1207, and a power supply 1209.
[0198] The peripheral device interface 1203 can be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 1201 and the memory 1202. In some embodiments, the processor 1201, the memory 1202, and the peripheral device interface 1203 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1201, the memory 1202, and the peripheral device interface 1203 can be implemented on a separate chip or circuit board, and this embodiment does not limit this.
[0199] The radio frequency circuit 1204 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1204 communicates with a communication network and other communication devices through electromagnetic signals. The radio frequency circuit 1204 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 1204 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so on. The radio frequency circuit 1204 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, each generation of mobile communication networks (2G, 3G, 4G, and 5G), a wireless local area network, and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 1204 may further include a circuit related to NFC (Near Field Communication), and this application does not limit this.
[0200] The display screen 1205 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1205 is a touch display screen, the display screen 1205 also has the ability to collect touch signals on or above the surface of the display screen 1205. The touch signals can be input as control signals to the processor 1201 for processing. At this time, the display screen 1205 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, there may be one display screen 1205, which is provided on the front panel of the terminal 1200; in other embodiments, there may be at least two display screens 1205, which are respectively provided on different surfaces of the terminal 1200 or in a foldable design; in other embodiments, the display screen 1205 may be a flexible display screen, which is provided on the curved surface or the folding surface of the terminal 1200. Even further, the display screen 1205 can also be set to an irregular non-rectangular shape, that is, an irregular-shaped screen. The display screen 1205 can be prepared using materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0201] The camera module 1206 is used to capture images or videos. Optionally, the camera module 1206 includes a front camera and a rear camera. The front camera is provided on the front panel of the terminal, and the rear camera is provided on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth camera, a wide-angle camera, and a telephoto camera respectively, to achieve functions such as the combination of the main camera and the depth camera to achieve the background blurring function, the combination of the main camera and the wide-angle camera to achieve panoramic shooting and VR (Virtual Reality) shooting functions, or other combined shooting functions. In some embodiments, the camera module 1206 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to the combination of a warm light flash and a cold light flash, which can be used for light compensation under different color temperatures.
[0202] The audio circuit 1207 may include a microphone and a speaker. The microphone is used to collect sound waves of the user and the environment, and convert the sound waves into electrical signals for input to the processor 1201 for processing, or input to the radio frequency circuit 1204 to achieve voice communication. For the purpose of stereo collection or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 1200. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert the electrical signal from the processor 1201 or the radio frequency circuit 1204 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for uses such as ranging. In some embodiments, the audio circuit 1207 may also include a headphone jack.
[0203] The power supply 1209 is used to supply power to each component in the terminal 1200. The power supply 1209 may be alternating current, direct current, a disposable battery or a rechargeable battery. When the power supply 1209 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0204] In some embodiments, the terminal 1200 further includes one or more sensors 1210. The one or more sensors 1210 include but are not limited to: an acceleration sensor 1211, a gyroscope sensor 1212, a pressure sensor 1213, an optical sensor 1215, and a proximity sensor 1216.
[0205] The acceleration sensor 1211 can detect the magnitudes of accelerations on the three coordinate axes of the coordinate system established with the terminal 1200. For example, the acceleration sensor 1211 can be used to detect the components of the gravitational acceleration on the three coordinate axes. The processor 1201 can control the display screen 1205 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 1211. The acceleration sensor 1211 can also be used for collecting game or user's motion data.
[0206] The gyroscope sensor 1212 can detect the body direction and rotation angle of the terminal 1200. The gyroscope sensor 1212 can cooperate with the acceleration sensor 1211 to collect the 3D actions of the user on the terminal 1200. Based on the data collected by the gyroscope sensor 1212, the processor 1201 can achieve the following functions: motion sensing (such as changing the UI according to the user's tilting operation), image stabilization during shooting, game control, and inertial navigation.
[0207] The pressure sensor 1213 can be disposed on the side frame of the terminal 1200 and / or the lower layer of the display screen 1205. When the pressure sensor 1213 is disposed on the side frame of the terminal 1200, it can detect the holding signal of the user on the terminal 1200, and the processor 1201 can perform left / right hand recognition or quick operation according to the holding signal collected by the pressure sensor 1213. When the pressure sensor 1213 is disposed on the lower layer of the display screen 1205, the processor 1201 can control the operable controls on the UI interface according to the pressure operation of the user on the display screen 1205. The operable controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0208] The optical sensor 1215 is used to collect the ambient light intensity. In one embodiment, the processor 1201 can control the display brightness of the display screen 1205 according to the ambient light intensity collected by the optical sensor 1215. Specifically, when the ambient light intensity is high, the display brightness of the display screen 1205 is increased; when the ambient light intensity is low, the display brightness of the display screen 1205 is decreased. In another embodiment, the processor 1201 can also dynamically adjust the shooting parameters of the camera module 1206 according to the ambient light intensity collected by the optical sensor 1215.
[0209] The proximity sensor 1216, also known as the distance sensor, is disposed on the front panel of the terminal 1200. The proximity sensor 1216 is used to collect the distance between the user and the front of the terminal 1200. In one embodiment, when the proximity sensor 1216 detects that the distance between the user and the front of the terminal 1200 is gradually decreasing, the processor 1201 controls the display screen 1205 to switch from the lit state to the off state; when the proximity sensor 1216 detects that the distance between the user and the front of the terminal 1200 is gradually increasing, the processor 1201 controls the display screen 1205 to switch from the off state to the lit state.
[0210] Those skilled in the art can understand that Figure 12 the structure shown in does not limit the terminal 1200, and may include more or fewer components than shown in the figure, or combine some components, or adopt different component arrangements.
[0211] Optionally, the computer device is provided as a server. Figure 13It is a schematic structural diagram of a server provided by an embodiment of the present application. The server 1300 may vary greatly due to different configurations or performances, and may include one or more Central Processing Units (CPUs) 1301 and one or more memories 1302. Among them, at least one computer program is stored in the memory 1302, and the at least one computer program is loaded and executed by the processor 1301 to implement the methods provided by the above-mentioned various method embodiments. Of course, the server may also have components such as wired or wireless network interfaces, keyboards, and input / output interfaces for input / output. The server may also include other components for implementing the functions of the device, which will not be elaborated here.
[0212] An embodiment of the present application also provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is loaded and executed by a processor to implement the operations performed in the virtual scene display method of the above embodiment.
[0213] An embodiment of the present application also provides a computer program product or a computer program. The computer program product or the computer program includes computer program code, and the computer program code is stored in a computer-readable storage medium. The processor of the computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device implements the operations performed in the virtual scene display method of the above embodiment.
[0214] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by a program instructing relevant hardware. The program can be stored in a computer-readable storage medium, and the above-mentioned storage medium can be a read-only memory, a disk, an optical disc, etc.
[0215] The above are only optional embodiments of the embodiments of the present application, and are not intended to limit the embodiments of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the embodiments of the present application shall be included in the protection scope of the present application.
Claims
1. A virtual scene display method, characterized in that, The method includes: Displaying a first virtual scene image, where the first virtual scene image includes two-dimensional virtual objects in the virtual scene, the first virtual scene image is obtained by a virtual camera photographing the virtual scene, and the image photographed by the virtual camera presents the effect of objects being larger when closer and smaller when farther away; In response to the field of view angle of the virtual camera changing from a first field of view angle to a second field of view angle, determining a field of view angle transformation matrix corresponding to the two-dimensional virtual object based on the first field of view angle and the second field of view angle, where the field of view angle transformation matrix is used to indicate the situation of the change in the field of view angle of the virtual camera; Based on the first display position of the two-dimensional virtual object in the first virtual scene image and the field of view angle transformation matrix, obtaining a second display position of the two-dimensional virtual object; Displaying a second virtual scene image, where the two-dimensional virtual object is displayed at the second display position in the second virtual scene image.
2. The method according to claim 1, characterized in that, The determining the field of view angle transformation matrix corresponding to the two-dimensional virtual object based on the first field of view angle and the second field of view angle includes: Fusing the projection matrix of the first field of view angle and the projection matrix of the second field of view angle to obtain the field of view angle transformation matrix.
3. The method according to claim 1, wherein The obtaining the second display position of the two-dimensional virtual object based on the first display position of the two-dimensional virtual object in the first virtual scene image and the field of view angle transformation matrix includes: Based on the first field of view angle, determining the target coordinates of the reference point of the two-dimensional virtual object in a first coordinate system, where the first coordinate system is the coordinate system of the virtual camera at the first field of view angle; Obtaining a first offset matrix of the two-dimensional virtual object in the first coordinate system, where the first offset matrix includes the offsets of multiple points of the two-dimensional virtual object from the reference point in the first coordinate system, and the multiple points form the two-dimensional virtual object; Based on the target coordinates, the first offset matrix, and the field of view angle transformation matrix, determining the second display position.
4. The method according to claim 3, characterized in that, The obtaining the first offset matrix of the two-dimensional virtual object in the first coordinate system includes: Obtaining a second offset matrix of the two-dimensional virtual object in a second coordinate system, where the second coordinate system is the coordinate system of the two-dimensional virtual object, and the second offset matrix includes the offsets of multiple points of the two-dimensional virtual object from the reference point in the second coordinate system; Performing a coordinate system transformation on the second offset matrix to obtain the first offset matrix.
5. The method according to claim 3, characterized in that, The determining the target coordinates of the reference point of the two-dimensional virtual object in the first coordinate system based on the first field of view angle includes: Obtaining the reference coordinates of the reference point of the two-dimensional virtual object in a second coordinate system, where the second coordinate system is the coordinate system of the two-dimensional virtual object; Performing a coordinate system transformation on the reference coordinates to obtain the target coordinates.
6. The method according to claim 1, wherein Before the displaying the second virtual scene image, the method further includes: Determining the amount of position change between the second display position and the first display position; Adjusting the position of the two-dimensional virtual object in the virtual scene according to the amount of position change. Render the virtual scene captured by the virtual camera after the field of view angle changes to obtain the second virtual scene image.
7. The method according to claim 1, wherein The two-dimensional virtual item held by the two-dimensional virtual object; the method further includes: Based on the relative display positions of the two-dimensional virtual item and the two-dimensional virtual object in the first virtual scene image, obtain the third display position of the two-dimensional virtual item; Display the two-dimensional virtual item at the third display position in the second virtual scene image.
8. The method according to claim 7, wherein The obtaining the third display position of the two-dimensional virtual item based on the relative display positions of the two-dimensional virtual item and the two-dimensional virtual object in the first virtual scene image includes: In response to the field of view angle of the virtual camera changing from a first field of view angle to a second field of view angle, based on the first field of view angle and the second field of view angle, determine a field of view angle transformation matrix corresponding to the two-dimensional virtual object, where the field of view angle transformation matrix is used to indicate the situation of the change in the field of view angle of the virtual camera; Based on the relative display position and the field of view angle transformation matrix, obtain the third display position of the two-dimensional virtual item.
9. The method according to claim 8, characterized in that, The obtaining the third display position of the two-dimensional virtual item based on the relative display position and the field of view angle transformation matrix includes: Obtain the target offset between the reference point of the two-dimensional virtual object and the reference point of the two-dimensional virtual item in a first coordinate system, where the first coordinate system is the coordinate system of the virtual camera at the first field of view angle; Obtain a third offset matrix of the two-dimensional virtual item in the first coordinate system, where the third offset matrix includes the offsets between multiple points of the two-dimensional virtual item and the reference point of the two-dimensional virtual object in the first coordinate system, and the multiple points form the two-dimensional virtual item; Based on the target offset, the third offset matrix, and the field of view angle transformation matrix, determine the third display position.
10. The method according to claim 9, characterized in that, The obtaining the target offset between the reference point of the two-dimensional virtual object and the reference point of the two-dimensional virtual item in the first coordinate system includes: Obtain the reference offset between the reference point of the two-dimensional virtual object and the reference point of the two-dimensional virtual item in a third coordinate system, where the third coordinate system is the coordinate system of the two-dimensional virtual item; Perform coordinate transformation on the reference offset to obtain the target offset.
11. The method according to claim 9, characterized in that, The obtaining the third offset matrix of the two-dimensional virtual item in the first coordinate system includes: Obtain a fourth offset matrix of the two-dimensional virtual item in a third coordinate system, where the third coordinate system is the coordinate system of the two-dimensional virtual item, and the fourth offset matrix includes the offsets between multiple points of the two-dimensional virtual item and the reference point of the two-dimensional virtual object in the third coordinate system; Perform coordinate transformation on the fourth offset matrix to obtain the third offset matrix.
12. A virtual scene display device, characterized in that, The device includes: An image display module for displaying a first virtual scene image, where the first virtual scene image includes a two-dimensional virtual object in a virtual scene, the first virtual scene image is obtained by a virtual camera photographing the virtual scene, and the image photographed by the virtual camera presents the effect of objects being larger when closer and smaller when farther away; The first position acquisition module includes a first matrix determination unit and a first position acquisition unit; The first matrix determination unit is configured to, in response to the field of view angle of the virtual camera changing from a first field of view angle to a second field of view angle, determine a field of view angle transformation matrix corresponding to the two-dimensional virtual object based on the first field of view angle and the second field of view angle, where the field of view angle transformation matrix is used to indicate the change in the field of view angle of the virtual camera; The first position acquisition unit is configured to obtain a second display position of the two-dimensional virtual object based on a first display position of the two-dimensional virtual object in the first virtual scene image and the field of view angle transformation matrix; The image display module is further configured to display a second virtual scene image, and the two-dimensional virtual object is displayed at the second display position in the second virtual scene image.
13. The device according to claim 12, characterized in that, The first matrix determination unit is configured to fuse a projection matrix of the first field of view angle and a projection matrix of the second field of view angle to obtain the field of view angle transformation matrix.
14. The device according to claim 12, wherein The first position acquisition unit is configured to, based on the first field of view angle, determine a target coordinate of a reference point of the two-dimensional virtual object in a first coordinate system, where the first coordinate system is a coordinate system of the virtual camera at the first field of view angle; obtain a first offset matrix of the two-dimensional virtual object in the first coordinate system, where the first offset matrix includes offsets of multiple points of the two-dimensional virtual object from the reference point in the first coordinate system, and the multiple points form the two-dimensional virtual object; and determine the second display position based on the target coordinate, the first offset matrix, and the field of view angle transformation matrix.
15. The device according to claim 14, characterized in that, The first position acquisition unit is configured to obtain a second offset matrix of the two-dimensional virtual object in a second coordinate system, where the second coordinate system is a coordinate system of the two-dimensional virtual object, and the second offset matrix includes offsets of multiple points of the two-dimensional virtual object from the reference point in the second coordinate system; and perform coordinate transformation on the second offset matrix to obtain the first offset matrix.
16. The device according to claim 14, characterized in that, The first position acquisition unit is configured to obtain a reference coordinate of a reference point of the two-dimensional virtual object in a second coordinate system, where the second coordinate system is a coordinate system of the two-dimensional virtual object; and perform coordinate transformation on the reference coordinate to obtain the target coordinate.
17. The device according to claim 12, characterized in that, The apparatus further includes: a change amount determination module configured to determine a position change amount between the second display position and the first display position; a position adjustment module configured to adjust the position of the two-dimensional virtual object in the virtual scene according to the position change amount; a scene rendering module configured to render the virtual scene captured by the virtual camera after the field of view angle changes to obtain the second virtual scene image.
18. The device according to claim 12, characterized in that, a two-dimensional virtual item held by the two-dimensional virtual object; the apparatus further includes: a second position acquisition module configured to obtain a third display position of the two-dimensional virtual item based on a relative display position of the two-dimensional virtual item and the two-dimensional virtual object in the first virtual scene image. An item display module, configured to display the two-dimensional virtual item at the third display position in the second virtual scene image.
19. The device according to claim 18, wherein, The second position acquisition module includes: A second matrix determination unit, configured to, in response to a change of the field of view angle of the virtual camera from a first field of view angle to a second field of view angle, determine a field of view angle transformation matrix corresponding to the two-dimensional virtual object based on the first field of view angle and the second field of view angle, where the field of view angle transformation matrix is used to indicate the change of the field of view angle of the virtual camera; A second position acquisition unit, configured to acquire the third display position of the two-dimensional virtual item based on the relative display position and the field of view angle transformation matrix.
20. The device according to claim 19, wherein The second position acquisition unit is configured to acquire a target offset between a reference point of the two-dimensional virtual object and a reference point of the two-dimensional virtual item in a first coordinate system, where the first coordinate system is the coordinate system of the virtual camera at the first field of view angle; acquire a third offset matrix of the two-dimensional virtual item in the first coordinate system, where the third offset matrix includes offsets between multiple points of the two-dimensional virtual item and the reference point of the two-dimensional virtual object in the first coordinate system, and the multiple points form the two-dimensional virtual item; and determine the third display position based on the target offset, the third offset matrix, and the field of view angle transformation matrix.
21. The device according to claim 20, wherein, The second position acquisition unit is configured to acquire a reference offset between a reference point of the two-dimensional virtual object and a reference point of the two-dimensional virtual item in a third coordinate system, where the third coordinate system is the coordinate system of the two-dimensional virtual item; and perform coordinate transformation on the reference offset to obtain the target offset.
22. The device according to claim 20, characterized in that, The second position acquisition unit is configured to acquire a fourth offset matrix of the two-dimensional virtual item in the third coordinate system, where the third coordinate system is the coordinate system of the two-dimensional virtual item, and the fourth offset matrix includes offsets between multiple points of the two-dimensional virtual item and the reference point of the two-dimensional virtual object in the third coordinate system; and perform coordinate transformation on the fourth offset matrix to obtain the third offset matrix.
23. A computer device, characterized in that, The computer device includes a processor and a memory, where at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the operations performed in the virtual scene display method according to any one of claims 1 to 11.
24. A computer-readable storage medium, characterized in that, At least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor to implement the operations performed in the virtual scene display method according to any one of claims 1 to 11.
25. A computer program product, characterized in that, The computer program product includes computer program code, where the computer program code is stored in a computer-readable storage medium; a processor of a computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device implements the operations performed in the virtual scene display method according to any one of claims 1 to 11.