Virtual building display method, device and equipment and readable storage medium
By emitting light through virtual props or obtaining model data to display the virtual building in a transparent state, the problems of single display mode and complex operation of virtual buildings in the existing technology are solved, and flexible internal viewing and enhanced game fun are achieved.
Patent Information
- Application Number
- CN202410350017.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-22
- Publication Date
- 2025-09-23
AI Technical Summary
In the existing technology, the display method of virtual buildings is relatively simple, with low flexibility and high operational complexity. Players need to control virtual objects to enter the interior of the building in order to view the internal situation.
By controlling the virtual props held by the virtual object to emit light to the virtual building, the virtual building is displayed in a transparent state based on the emission duration meeting the requirements, or the model data of the virtual building is obtained through the terminal device and displayed in a transparent state.
It enables flexible viewing of the interior of virtual buildings, reduces the difficulty of operation, and increases the fun and stickiness of the game.
Smart Images

Figure CN120679157A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, apparatus, device, and readable storage medium for displaying a virtual building. Background Art
[0002] With the rapid development of computer technology, game technology is also developing continuously. Games include virtual scenes, and there are often a large number of virtual buildings in the virtual scenes.
[0003] In the related art, a virtual building in a non-transparent state is displayed on the game screen, and the player needs to control the virtual object to enter the inside of the virtual building so that the virtual object can clearly see the internal situation of the virtual building.
[0004] However, the display method of the virtual building in the above method results in a relatively simple method for the virtual object to obtain the internal situation of the virtual building, which has low flexibility and high operational complexity. Summary of the Invention
[0005] The embodiments of the present application provide a method, apparatus, device, and readable storage medium for displaying a virtual building, which can be used to solve the problem in related technologies that the method for a virtual object to obtain the internal conditions of a virtual building is relatively simple, inflexible, and complex to operate. The technical solution is as follows:
[0006] In a first aspect, an embodiment of the present application provides a method for displaying a virtual building, the method comprising:
[0007] Displaying a game screen, the game screen including a virtual object and a virtual building in a virtual environment, the virtual building being in a non-transparent state, and the virtual object being located outside the virtual building;
[0008] When the perspective function of the virtual building is triggered, controlling the virtual object to emit light toward the virtual building through the virtual prop held by the virtual object;
[0009] Based on the emission duration of the light satisfying the first duration requirement, a virtual building in a transparent state is displayed at the display position of the virtual building.
[0010] In a second aspect, an embodiment of the present application provides a method for displaying a virtual building, the method comprising:
[0011] Receiving a data acquisition request sent by a terminal device, the data acquisition request carrying an identifier of a virtual building, the data acquisition request being used to acquire model data of the virtual building, the model data of the virtual building including data of a bounding box of the virtual building and index values of cubes constituting the virtual building;
[0012] The model data of the virtual building is sent to the terminal device according to the data acquisition request, and the model data of the virtual building is used by the terminal device to generate and display the virtual building in a transparent state.
[0013] In a third aspect, an embodiment of the present application provides a device for displaying a virtual building, the device comprising:
[0014] A display module is configured to display a game screen, wherein the game screen includes virtual objects and virtual buildings located in a virtual environment, wherein the virtual buildings are in a non-transparent state, and the virtual objects are located outside the virtual buildings;
[0015] a control module, configured to control the virtual object to emit light toward the virtual building through the virtual prop held by the virtual object when the perspective function of the virtual building is triggered;
[0016] The display module is further configured to display a virtual building in a transparent state at the display position of the virtual building based on the emission duration of the light satisfying a first duration requirement.
[0017] In a possible implementation, the apparatus further includes:
[0018] An acquisition module, configured to acquire model data of the virtual building, wherein the model data of the virtual building includes data of a bounding box of the virtual building and index values of cubes constituting the virtual building;
[0019] The generating module is used to generate a virtual building in a transparent state according to the data of the bounding box of the virtual building and the index value of the cube constituting the virtual building.
[0020] In a possible implementation, the data of the bounding box of the virtual building includes the maximum value coordinates, the minimum value coordinates, and the number of row grids of the bounding box of the virtual building;
[0021] The generation module is used to generate a bounding box of the virtual building based on the maximum value coordinates and the minimum value coordinates of the bounding box of the virtual building; divide the bounding box of the virtual building according to the number of row grids to obtain multiple candidate cubes included in the bounding box of the virtual building and the index value of each candidate cube; determine the cube constituting the virtual building from the multiple candidate cubes based on the index value of the cube constituting the virtual building and the index value of each candidate cube; determine the vertex coordinates of each vertex constituting the virtual building based on the data of the bounding box of the virtual building; and generate a virtual building in a transparent state based on the vertex coordinates of each vertex constituting the virtual building.
[0022] In one possible implementation, the generation module is used to determine the vertex coordinates of the vertices of each candidate cube based on the data of the bounding box of the virtual building; deduplicate the vertices of each candidate cube based on the vertex coordinates of the vertices of each candidate cube to obtain deduplicated vertices, wherein there are no vertices with the same vertex coordinates among the deduplicated vertices; and use the deduplicated vertices as the vertices constituting the virtual building.
[0023] In one possible implementation, the generation module is used to generate the vertices constituting the virtual building based on the vertex coordinates of the vertices constituting the virtual building; obtain a first model based on the vertices constituting the virtual building, wherein any two vertices in the first model are connected; and adjust the transparency of a surface constituted by any three vertices in the first model to a target transparency to obtain a virtual building in a transparent state, wherein the transparency of the virtual building in a transparent state is the target transparency.
[0024] In a possible implementation, the generating module is further configured to adjust the color of each vertex to a target color to obtain a vertex with adjusted color;
[0025] The generating module is configured to obtain a first model based on the color-adjusted vertices, wherein the color of a line between any two vertices in the first model is the target color.
[0026] In one possible implementation, the acquisition module is used to send a data acquisition request to a server, wherein the data acquisition request carries an identifier of the virtual building, and the data acquisition request is used to obtain model data of the virtual building; and receive the model data of the virtual building returned by the server based on the data acquisition request.
[0027] In a possible implementation, a perspective control is further displayed in the game screen, and the perspective control is used to trigger the perspective function of the virtual building;
[0028] The device further comprises:
[0029] a determination module, configured to determine an object state of the virtual object in response to a triggering operation on the perspective control;
[0030] a sending module, configured to send a trigger request to a server based on the object state of the virtual object satisfying a state requirement, the trigger request including the object identifier of the virtual object and the identifier of the perspective control, the trigger request being used by the server to determine whether the virtual object can trigger the perspective function of the virtual building;
[0031] A receiving module, configured to receive a confirmation instruction returned by the server based on the trigger request;
[0032] The determining module is further configured to determine that the perspective function of the virtual building is triggered based on the confirmation instruction indicating that the virtual object can trigger the perspective function of the virtual building.
[0033] In a possible implementation, the object state of the virtual object satisfies the state requirement, including at least one of the following:
[0034] The virtual object is in a non-falling state;
[0035] The virtual object is not on the virtual vehicle;
[0036] The virtual object is in a non-climbing state;
[0037] The virtual object is in a non-rescue state;
[0038] The life value of the virtual object is greater than a life value threshold.
[0039] In a possible implementation, the receiving module is further configured to receive a denial instruction returned by the server based on the trigger request;
[0040] The display module is further configured to indicate, based on the denial instruction, that the virtual object cannot trigger the perspective function of the virtual building, and to display prompt information, wherein the prompt information is configured to indicate that the virtual object cannot trigger the perspective function of the virtual building.
[0041] In a possible implementation, the display module is further configured to cancel the display of the virtual building in the transparent state at the display position of the virtual building based on the virtual building in the transparent state meeting the display cancellation requirement, and display the virtual building in the non-transparent state at the display position of the virtual building.
[0042] In a possible implementation, the virtual building in a transparent state satisfies the display cancellation requirement, which includes any of the following:
[0043] The display duration of the virtual building in the transparent state meets the second duration requirement;
[0044] receiving a display cancellation instruction sent by the server, wherein the display cancellation instruction is used to instruct to cancel the display of the virtual building in the transparent state;
[0045] A trigger operation for a cancel control is received, where the cancel control is used to cancel display of the virtual building in the transparent state.
[0046] In a fourth aspect, an embodiment of the present application provides a device for displaying a virtual building, the device comprising:
[0047] a receiving module, configured to receive a data acquisition request sent by a terminal device, the data acquisition request carrying an identifier of a virtual building, the data acquisition request being used to acquire model data of the virtual building, the model data of the virtual building including data of a bounding box of the virtual building and index values of cubes constituting the virtual building;
[0048] The sending module is used to send the model data of the virtual building to the terminal device according to the data acquisition request, and the model data of the virtual building is used by the terminal device to generate and display the virtual building in a transparent state.
[0049] In a possible implementation, the data of the bounding box of the virtual building includes the maximum value coordinates, the minimum value coordinates and the number of row grids of the bounding box of the virtual building;
[0050] The device also includes: a generation module, which is used to create a bounding box of the virtual building; divide the bounding box of the virtual building according to the number of row grids to obtain multiple cubes included in the bounding box of the virtual building and the index value of each cube; determine the position information of each cube; obtain triangular face data of the virtual building, the triangular face data includes multiple triangular facets, each triangular facet includes three vertices; according to the coordinates of the vertices of each triangular facet and the position information of each cube, determine the cubes constituting the virtual building from the multiple cubes, and there is at least one triangular facet in any cube constituting the virtual building; generate model data of the virtual building according to the maximum coordinate value, minimum coordinate value, number of row grids and index values of the cubes constituting the virtual building of the bounding box of the virtual building.
[0051] In a fifth aspect, an embodiment of the present application provides a computer device, comprising a processor and a memory, wherein the memory stores at least one program code, and the at least one program code is loaded and executed by the processor so that the computer device implements any of the above-mentioned methods for displaying a virtual building.
[0052] In a sixth aspect, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores at least one program code, and the at least one program code is loaded and executed by a processor to enable a computer to implement any of the above-mentioned methods for displaying a virtual building.
[0053] In the seventh aspect, a computer program or computer program product is also provided, wherein the computer program or computer program product stores at least one computer instruction, and the at least one computer instruction is loaded and executed by a processor to enable the computer to implement any of the above-mentioned virtual building display methods.
[0054] The technical solutions provided by the embodiments of the present application bring at least the following beneficial effects:
[0055] The technical solution provided by the embodiment of the present application displays the virtual building in a transparent state when the perspective function of the virtual building is triggered. In this way, virtual objects located outside the virtual building can view the interior of the virtual building. Compared with the method that requires the virtual object to enter the interior of the virtual building to view the interior of the virtual building, this method makes the viewing method of the interior of the virtual building more flexible and less difficult to operate, and also makes the way for the virtual object to view the interior of the virtual building more diverse. Because the virtual object is controlled by the game object, the game object can also view the interior of the virtual building, which can help the game object to further formulate combat plans, improve the game fun of the game object, and increase the stickiness of the game to the game object. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0057] Figure 1 This is a schematic diagram of an implementation environment of a method for displaying a virtual building provided in an embodiment of the present application;
[0058] Figure 2 This is a flowchart of a method for displaying a virtual building provided in an embodiment of the present application;
[0059] Figure 3 This is a schematic diagram of a game screen display provided by an embodiment of the present application;
[0060] Figure 4 This is a schematic diagram of another game screen display provided by an embodiment of the present application;
[0061] Figure 5 1 is a schematic diagram of a process for obtaining model data of a virtual building provided in an embodiment of the present application;
[0062] Figure 6 This is a schematic diagram of a display of a virtual building in an editor provided by an embodiment of the present application;
[0063] Figure 7 This is a schematic diagram of vertices obtained when the number of rows of grids in a bounding box of a virtual building provided by an embodiment of the present application is different;
[0064] Figure 8 This is a schematic diagram of a process for generating a transparent virtual building provided by an embodiment of the present application;
[0065] Figure 9 is a schematic diagram of displaying a point cloud of a virtual building at a display position of the virtual building provided by an embodiment of the present application;
[0066] Figure 10 This is a schematic diagram of another game screen display provided by an embodiment of the present application;
[0067] Figure 11 This is a flowchart of a method for displaying a virtual building provided in an embodiment of the present application;
[0068] Figure 12 This is a flowchart of a method for displaying a virtual building provided in an embodiment of the present application;
[0069] Figure 13 This is a flowchart of a method for displaying a virtual building provided in an embodiment of the present application;
[0070] Figure 14 1 is a schematic structural diagram of a display device for a virtual building provided in an embodiment of the present application;
[0071] Figure 15 1 is a schematic structural diagram of a display device for a virtual building provided in an embodiment of the present application;
[0072] Figure 16 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application;
[0073] Figure 17 This is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0074] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0075] It should be noted that the terms "first," "second," and the like in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0076] First, the abbreviations and key terms involved in the embodiments of the present application are defined.
[0077] Virtual environment: refers to the environment provided (or displayed) when an application is running on a terminal device. This virtual environment is the environment created for virtual objects to carry out activities. A virtual environment can be a two-dimensional virtual environment, a 2.5-dimensional virtual environment, or a three-dimensional virtual environment. A virtual environment can be a simulation of the real world, a semi-simulation of the real world, or a purely fictional environment. For example, the virtual environment involved in the embodiments of this application is a three-dimensional virtual environment.
[0078] Virtual objects refer to movable objects within a virtual environment. These movable objects can be virtual characters, virtual animals, or animated characters. Players can manipulate virtual objects through external components or by tapping the touchscreen display. Each virtual object has its own unique shape and volume within the virtual environment and occupies a portion of the virtual space. For example, in a three-dimensional virtual environment, virtual objects are three-dimensional models created using animation skeletal technology.
[0079] Figure 1 This is a schematic diagram of an implementation environment of a method for displaying a virtual building provided in an embodiment of the present application. Figure 1 As shown, the implementation environment includes: a terminal device 101 and a server 102.
[0080] Among them, a game client capable of providing a virtual environment is installed and running in the terminal device 101, and the display method of the virtual building provided in the embodiment of the present application is realized through the interaction between the terminal device 101 and the server 102.
[0081] Exemplarily, a game client capable of providing a virtual environment may be a third-person shooter (TPS) game, a first-person shooter (FPS) game, a multiplayer online tactical competitive (MOBA) game, a multiplayer shooting survival game, a massively multiplayer online role-playing game (MMO), an action role-playing game (ARPG), a virtual reality (VR) client, an augmented reality (AR) client, a three-dimensional map program, a map simulation program, a social client, an interactive entertainment client, and the like.
[0082] Server 102 provides backend services for a game client installed on terminal device 101 that provides a virtual environment. In one possible implementation, server 102 performs primary computing tasks, while terminal device 101 performs secondary computing tasks. Alternatively, server 102 performs secondary computing tasks, while terminal device 101 performs primary computing tasks. Alternatively, terminal device 101 and server 102 utilize a distributed computing architecture for collaborative computing.
[0083] Optionally, the terminal device 101 may be any electronic device that can interact with a user through one or more methods such as a keyboard, a touchpad, a remote control, voice interaction, or a handwriting device. For example, the terminal device 101 may be a smartphone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a PC (Personal Computer), a mobile phone, a PDA (Personal Digital Assistant), a wearable device, a PPC (Pocket PC), a smart car computer, a smart TV, etc.
[0084] Terminal device 101 may generally refer to one of multiple terminal devices. This embodiment uses terminal device 101 as an example. Those skilled in the art will appreciate that the number of terminal devices 101 may be greater or lesser. For example, there may be only one terminal device 101, or there may be dozens, hundreds, or even more terminal devices 101. This embodiment of the application does not limit the number or type of terminal devices 101.
[0085] The server 102 is a single server, or a server cluster consisting of multiple servers, or any one of a cloud computing platform and a virtualization center, which is not limited in the embodiments of the present application. The server 102 is directly or indirectly connected to the terminal device 101 via a wired communication method or a wireless communication method. The server 102 has a data receiving function, a data processing function, and a data sending function. Of course, the server 102 can also have other functions, which are not limited in the embodiments of the present application.
[0086] Those skilled in the art should understand that the above-mentioned terminal device 101 and server 102 are merely examples, and other existing or future terminal devices or servers, if applicable to the present application, should also be included in the scope of protection of the present application and are incorporated herein by reference.
[0087] The embodiment of the present application provides a method for displaying a virtual building, which can be applied to the above Figure 1 The implementation environment shown is Figure 2 Taking the flowchart of a method for displaying a virtual building provided by the embodiment of the present application as an example, the method can be performed by Figure 1 The interaction between the terminal device 101 and the server 102 is realized. Figure 2 As shown, the method includes the following steps.
[0088] In step 201, the terminal device displays a game screen, which includes virtual objects and virtual buildings in a virtual environment. The virtual buildings are in a non-transparent state, and the virtual objects are located outside the virtual buildings.
[0089] In an exemplary embodiment of the present application, a target game capable of providing a virtual environment is installed and running on a terminal device. The target game can be any game, and the present embodiment does not limit this. The target game can refer to a game that needs to be downloaded and installed independently, or it can refer to an embedded program that relies on a host program to run. Embedded programs include but are not limited to applets. The present embodiment does not limit the type of target game. Since the target game is an embedded program, an embedded program is an application developed based on a programming language and relies on a host program to run. An embedded program does not require downloading and installation; it only needs to be dynamically loaded into the host program to run. Users can find the embedded program they need through search, scanning, etc., click to run and use it, and after closing it after use, it will not occupy the terminal device's memory, which is very convenient. The target game can be a first-person perspective game (First Person) or a third-person perspective game (Third Person) game, and the present embodiment does not limit this. The target game can be a game client based on frame synchronization. In other words, the virtual building display method provided in the embodiment of the present application can be applied to a game client based on frame synchronization.
[0090] In one possible implementation, relevant information of the target game is displayed in the display interface of the terminal device. The relevant information of the target game may be a game icon of the target game, a game name of the target game, or other information of the target game. The embodiment of the present application does not limit the relevant information of the target game.
[0091] When a game object wishes to run a target game, the game object selects the relevant information of the target game. The terminal device receives the selection of the relevant information of the target game and runs the target game. The target game homepage is displayed, and a start control is displayed on the homepage of the target game. The start control is used to start a game. In response to the triggering operation of the start control, the game screen is displayed, which includes virtual objects and virtual buildings located in a virtual environment. The virtual buildings are in a non-transparent state, and the virtual objects are located outside the virtual buildings. Because the virtual buildings are in a non-transparent state, virtual objects located outside the virtual buildings cannot see the interior of the virtual buildings.
[0092] Optionally, the game object is a user object of the terminal device, that is, the game object is an object logged in to the target game, and the relevant information of the game object selecting the target game can be the relevant information of the game object clicking on the target game. The game object can also select the relevant information of the target game in other ways, for example, the game object selects the relevant information of the target game through voice control. The embodiment of the application does not limit the method for selecting the relevant information of the target game. The triggering operation for the start control can be a click operation for the start control, or it can be other operations for the start control, and the embodiment of the application does not limit this.
[0093] like Figure 3 This is a schematic diagram of a game screen display provided by an embodiment of the present application. Figure 3 The game screen shown includes a virtual object 301 and a virtual building 302 located in a virtual environment. The virtual building 302 is in a non-transparent state, and the virtual object 301 is located outside the virtual building 302.
[0094] It should be noted that other content can also be displayed on the game screen, see Figure 3 In some embodiments, the game screen may also display Figure 3 The content displayed in the game screen shown is not limited in this embodiment of the present application.
[0095] In step 202 , in response to a trigger operation on the perspective control, the terminal device determines an object state of the virtual object.
[0096] In a possible implementation, a perspective control is also displayed on the game screen, and the perspective control is used to trigger the perspective function of the virtual building. Figure 3 303 in the figure is a perspective control.
[0097] Among them, the trigger operation for the perspective control can be a click operation on the perspective control, a double-click operation on the perspective control, a sliding operation on the perspective control, or other operations on the perspective control. The embodiments of the present application do not limit this.
[0098] In response to a trigger operation on a perspective control, a process in which a terminal device determines the object state of a virtual object includes: in response to the trigger operation on the perspective control, the terminal device generates a state acquisition request, the state acquisition request carries the object identifier of the virtual object, and the state acquisition request is used to obtain the object state of the virtual object. The terminal device sends the state acquisition request to a server. The server receives the state acquisition request sent by the terminal device, parses the state acquisition request, and obtains the object identifier of the virtual object. The server stores the object state of each object and the correspondence between the object state of each object and the object identifier of each object. The server determines the object state of the virtual object based on the object identifier of the virtual object and the correspondence between the object state of each object and the object identifier of each object. The server sends the object state of the virtual object to the terminal device, so that the terminal device determines the object state of the virtual object.
[0099] Among them, the object identifier of the virtual object can be the object name of the virtual object, or the object code of the virtual object, or other identifier that can uniquely represent the virtual object, which is not limited in the embodiment of the present application.
[0100] Optionally, the perspective control displayed on the game screen also includes an energy bar ( Figure 3 (not shown), the energy bar is used to indicate whether the virtual object can trigger the perspective function of the virtual building. For example, if the virtual object can trigger the perspective function of the virtual building, the energy bar is displayed in a first state; if the virtual object cannot trigger the perspective function of the virtual building, the energy bar is displayed in a second state. The first state and the second state are different. For example, if the energy bar is displayed in the first state, it means that the energy bar is full, and if the energy bar is displayed in the second state, it means that the energy bar is not full.
[0101] In step 203, based on the object state of the virtual object meeting the state requirements, the terminal device sends a trigger request to the server. The trigger request includes the object identifier of the virtual object and the identifier of the perspective control. The trigger request is used by the server to determine whether the virtual object can trigger the perspective function of the virtual building.
[0102] After receiving the virtual object's object status from the server, the terminal device determines whether the virtual object's object status meets the status requirements. If the virtual object's object status meets the status requirements, the terminal device generates a trigger request and sends it to the server. The trigger request includes the virtual object's object identifier and the identifier of the perspective control. The trigger request is used to determine whether the virtual object can trigger the perspective function of the virtual building.
[0103] The object state of the virtual object satisfies the state requirement, which includes at least one of the following:
[0104] The virtual object is in a non-falling state;
[0105] The virtual object is not on the virtual vehicle; optionally, the virtual vehicle refers to a vehicle capable of carrying the virtual object. For example, the virtual vehicle can be a virtual car, a virtual bicycle, or other vehicles, which are not limited in this embodiment of the present application.
[0106] The virtual object is in a non-climbing state;
[0107] A virtual object is in a non-rescue state; that is, the virtual object does not provide assistance to other virtual objects. In other words, a virtual object in a non-rescue state means that the virtual object does not rescue other virtual objects. Other virtual objects can be virtual objects belonging to the same game team as the virtual object, or virtual objects belonging to a different game team. For example, neutral virtual objects.
[0108] The life value of the virtual object is greater than a life value threshold; wherein the life value threshold is set based on experience, or adjusted according to the implementation environment, and the embodiment of the present application is not limited to this. Exemplarily, the life value threshold is 0.
[0109] In one embodiment of the present application, if a terminal device determines that the object state of a virtual object does not meet a state requirement, the terminal device displays a notification message, including the object state of the virtual object, indicating that the virtual object cannot trigger the perspective function of the virtual building. Optionally, the process of displaying the notification message includes superimposing the notification message on the game screen. The content of the notification message can be arbitrary and is not limited in this embodiment of the present application.
[0110] For example, the notification message is: Since you are currently on a virtual vehicle, you cannot trigger the perspective function of the virtual building.
[0111] In step 204, the server receives a trigger request sent by the terminal device, and determines, based on the trigger request, whether the virtual object can trigger the perspective function of the virtual building.
[0112] In one possible implementation, after receiving a trigger request from a terminal device, the server parses the trigger request to obtain an object identifier of the virtual object and an identifier of the perspective control. Based on the object identifier and the perspective control identifier, the server determines the first time the virtual object last triggered the perspective control. The server then determines the time difference between the first time and the second time. If the time difference is no less than a time threshold, the server determines that the virtual object can trigger the perspective function of the virtual building. If the time difference is less than the time threshold, the server determines that the virtual object cannot trigger the perspective function of the virtual building.
[0113] The second time is the time when the server receives the trigger request sent by the terminal device. Alternatively, the trigger request includes the second time, and the second time is the time when the perspective control is triggered. Since the trigger request is sent to the server immediately after the perspective control is triggered, the time required for communication between the terminal device and the server is negligible. Therefore, the time when the perspective control is triggered and the time when the server receives the trigger request sent by the terminal device can be considered to be the same time.
[0114] Optionally, the time threshold is set based on experience, or adjusted according to the implementation environment, which is not limited in the embodiment of the present application. Exemplarily, the time threshold is 10 minutes.
[0115] In step 205 , based on the server determining that the virtual object can trigger the perspective function of the virtual building, the server sends a confirmation instruction to the terminal device.
[0116] In one possible implementation, after the server determines whether the virtual object can trigger the perspective function of the virtual building in step 204, if the server determines that the virtual object can trigger the perspective function of the virtual building, the server sends a confirmation instruction to the terminal device, where the confirmation instruction indicates that the virtual object can trigger the perspective function of the virtual building. The confirmation instruction indicates that the perspective function of the virtual building has been triggered.
[0117] If the server determines that the virtual object cannot trigger the perspective function of the virtual building, the server sends a denial instruction to the terminal device, where the denial instruction is used to indicate that the virtual object cannot trigger the perspective function of the virtual building, and the denial instruction is used to indicate that the perspective function of the virtual building is not triggered.
[0118] In step 206, the terminal device receives the confirmation instruction sent by the server. When the perspective function of the virtual building is triggered, the terminal device controls the virtual object to emit light toward the virtual building through the virtual prop held by the terminal device.
[0119] After the terminal device receives the confirmation instruction sent by the server, based on the confirmation instruction indicating that the virtual object can trigger the perspective function of the virtual building, the terminal device determines that the perspective function of the virtual building is triggered. When the perspective function of the virtual building is triggered, the terminal device controls the virtual object to emit light to the virtual building through the virtual props held.
[0120] In which, when the virtual object holds a virtual prop, the terminal device directly controls the virtual object to emit light toward the virtual building through the virtual prop it holds. In the case that the virtual object does not hold a virtual prop, the terminal device controls the virtual object to hold the virtual prop, and emits light toward the virtual building through the virtual prop. Optionally, the virtual backpack of the virtual object includes virtual props, and controlling the virtual object to hold the virtual prop may be controlling the virtual object to take the virtual prop from the virtual backpack. A virtual prop is any prop that can emit light, for example, a virtual prop is a watch that can emit light. The virtual object holding the virtual prop may be the virtual object wearing the virtual prop on its hand. The light may be a laser or other light, which is not limited in this embodiment of the present application. Based on the light being a laser, the laser emitted by the virtual prop to the virtual building may be a conical laser or a laser of other shapes, which is not limited in this embodiment of the present application.
[0121] like Figure 4 This is another schematic diagram of the display of the game screen provided by the embodiment of the present application. Figure 4 In the game screen shown, a virtual object 401 is controlled to shoot a laser at a virtual building 403 using a virtual prop 402 held by the virtual object 401 .
[0122] In another embodiment of the present application, if the terminal device receives a denial instruction returned by the server based on the trigger request, indicating that the virtual object cannot trigger the perspective function of the virtual building based on the denial instruction, a prompt message is displayed, indicating that the virtual object cannot trigger the perspective function of the virtual building. Optionally, the process of displaying the prompt message includes: superimposing the prompt message on the game screen. Optionally, the prompt message may include the reason why the virtual object cannot trigger the perspective function of the virtual building.
[0123] For example, the prompt message is: Since the time since you last triggered the perspective function of the virtual building is relatively short, you cannot trigger the perspective function of the virtual building temporarily. Please try again later.
[0124] In step 207, the terminal device sends a data acquisition request to the server. The data acquisition request carries the identifier of the virtual building, and the data acquisition request is used to acquire the model data of the virtual building.
[0125] In one possible implementation, when the perspective function of a virtual building is triggered, the terminal device not only controls the virtual object to emit light toward the virtual building through virtual props, but also generates a transparent virtual building. Since the process of generating a transparent virtual building is to generate a transparent virtual building based on the model data of the virtual building, the terminal device must first obtain the model data of the virtual building before generating the transparent virtual building. The process of obtaining the model data of the virtual building includes: the terminal device generates a data acquisition request based on the identifier of the virtual building, and sends the data acquisition request to the server. The data acquisition request carries the identifier of the virtual building and is used to obtain the model data of the virtual building.
[0126] The model data of the virtual building includes data of the virtual building's bounding box and index values of the cube constituting the virtual building. The data of the virtual building's bounding box includes the maximum coordinates, minimum coordinates, and number of rows of the virtual building's bounding box. The identifier of the virtual building is an identifier that can uniquely represent the virtual building. For example, the identifier of the virtual building can be the location information of the virtual building in the virtual environment, or the identifier of the virtual building can be the number of the virtual building, or the identifier of the virtual building can be the name of the virtual building.
[0127] In step 208, the server receives the data acquisition request sent by the terminal device, and sends the model data of the virtual building to the terminal device according to the data acquisition request.
[0128] In one possible implementation, a server stores model data for each building in a virtual environment, as well as a correspondence between the model data for each building and its identifier. The server receives a data acquisition request from a terminal device, parses the request, obtains the identifier of the virtual building, and determines the model data for the virtual building based on the identifier of the virtual building and the correspondence between the model data for each building and its identifier. The server then sends the model data for the virtual building to the terminal device, allowing the terminal device to acquire the model data for the virtual building.
[0129] Before storing the model data for each building, the server must first obtain the model data for each building. The process for obtaining model data for each building is similar. This embodiment of the application only uses the process for obtaining model data for a virtual building as an example. For the process for obtaining model data for other buildings, refer to the process for obtaining model data for a virtual building. This embodiment of the application does not limit the method by which the server obtains model data for the virtual building.
[0130] Optionally, the server can Figure 5 The model data of the virtual building is obtained in the manner shown, such as Figure 5 As shown, the process of acquiring the model data of the virtual building includes the following steps 501 to 506.
[0131] Step 501: Create a bounding box of a virtual building.
[0132] In a possible implementation, the virtual building is imported into a Unity (a game engine) editor, and a bounding box of the virtual building is created in the Unity editor. The bounding box of the virtual building is the smallest cube that includes the virtual building.
[0133] like Figure 6 This is a schematic diagram of a display of a virtual building in an editor provided by an embodiment of the present application.
[0134] Step 502: Divide the bounding box of the virtual building according to the number of row grids to obtain multiple cubes included in the bounding box of the virtual building and the index value of each cube.
[0135] Since the virtual building's bounding box is a cube, the number of rows of the virtual building's bounding box is both the number of columns and the number of vertical grids. The process of dividing the virtual building's bounding box is also the process of voxelizing the virtual building. The larger the number of rows of the virtual building's bounding box, the smaller the edge length of the cubes (also called voxels) included in the virtual building's bounding box, the more cubes the virtual building's bounding box contains, and the more refined the voxelization process of the virtual building. The index value of any cube includes the row coordinate, column coordinate, and vertical coordinate of the cube.
[0136] Since the larger the number of rows of the bounding box of the virtual building is, the more cubes the bounding box of the virtual building includes, and each cube includes 8 vertices, the larger the number of rows of the bounding box of the virtual building is, the more vertices there are. Figure 7 This is a schematic diagram of vertices obtained when the number of row grids of the bounding box of a virtual building provided by an embodiment of the present application is different. Figure 7 The number of rows of the bounding box of the virtual building (1) is 50, and the number of rows of the bounding box of the virtual building (2) is 100. Figure 7 From (1) and (2), we can see that the number of vertices obtained when the number of rows of grids of the virtual building's bounding box is 50 is less than the number of vertices obtained when the number of rows of grids of the virtual building's bounding box is 100, and the vertices are sparse.
[0137] Optionally, the process of dividing the virtual building's bounding box by the number of rows of grids to obtain the multiple cubes included in the virtual building's bounding box and the index values of each cube includes: constructing an octree based on the number of rows of grids starting from the center of the virtual building's bounding box. Each node in the octree represents a cube included in the virtual building's bounding box. The index value of each node in the octree is the index value of the cube corresponding to the node within the virtual building's bounding box. The index value of any cube included in the virtual building's bounding box is the coordinate of the cube within the virtual building's bounding box.
[0138] The number of rows of grids is set based on experience or adjusted according to the implementation environment, and is not limited in this embodiment of the present application. The value range of the number of rows of grids is (0, 255). Therefore, the index value of each cube included in the bounding box of the virtual building is within 255.
[0139] Step 503: Determine the position information of each cube.
[0140] In one possible implementation, the position information of any cube is determined based on the vertex coordinates of the target vertex of any cube and the edge length of the cube. The edge length of the cube is determined based on the edge length of the virtual building's bounding box and the number of rows of the virtual building's bounding box. Optionally, the edge length of the cube is the quotient of the edge length of the virtual building's bounding box and the number of rows of the virtual building's bounding box. For example, if the edge length of the virtual building's bounding box is 100 and the number of rows of the virtual building's bounding box is 10, then the edge length of the cube is 10.
[0141] Optionally, the target vertex of any cube may be any vertex among the upper left front vertex, upper left rear vertex, lower left front vertex, lower left rear vertex, upper right front vertex, upper right rear vertex, lower right front vertex, and lower right rear vertex of any cube.
[0142] The process of determining the position information of each cube includes: obtaining the position information of each cube according to the maximum value coordinate, minimum value coordinate, row grid number and index value of each cube of the bounding box of the virtual building.
[0143] Optionally, the edge length of the virtual building's bounding box is determined based on the maximum and minimum coordinates of the virtual building's bounding box. The edge length of each cube included in the virtual building's bounding box is determined based on the edge length of the virtual building's bounding box and the number of rows of the virtual building's bounding box. The vertex coordinates of the target vertex of each cube are obtained based on the maximum and minimum coordinates of the virtual building's bounding box and the index values of each cube. The position information of any cube is determined based on the vertex coordinates of the target vertex of the cube and the edge length of the cube.
[0144] For example, the maximum value coordinates of the virtual building's bounding box are (100, 100, 100), the minimum value coordinates are (0, 0, 0), and the number of row grids is 10. Then, the edge length of the virtual building's bounding box is 100, and the edge length of each cube included in the virtual building's bounding box is 10. For the first cube in the cubes included in the virtual building's bounding box, the vertex coordinates of the upper left front vertex of the first cube are (0, 0, 0), and the edge length of the first cube is 10. Therefore, the position information of the first cube is: the vertex coordinates of the upper left front vertex are (0, 0, 0), and the vertex coordinates of the lower right back vertex are (10, 10, 10).
[0145] Step 504: Acquire triangular face data of the virtual building. The triangular face data includes a plurality of triangular facets, and each triangular facet includes three vertices.
[0146] In one possible implementation, the virtual building is discretized into triangular facets to obtain triangular facet data of the virtual building. The triangular facet data includes multiple triangular facets and the coordinates of the three vertices of each triangular facet. Each triangular facet is an independent triangle, and therefore, each triangular facet includes three vertices.
[0147] Step 505: Determine a cube constituting a virtual building from among the multiple cubes based on the coordinates of the vertices of each triangular facet and the position information of each cube. Any cube constituting the virtual building contains at least one triangular facet.
[0148] In one embodiment of the present application, a process of determining a cube constituting a virtual building from among multiple cubes based on the coordinates of the vertices of each triangular facet and the position information of each cube includes: for any cube from the multiple cubes, traversing the multiple triangular facets based on the position information of the cube, and determining the cube as a cube constituting the virtual building based on the presence of a triangular facet having three vertices located in the cube. Each triangular facet corresponds to one cube, and each cube corresponds to at least one triangular facet.
[0149] Exemplarily, the position information of any cube is: the coordinates of the upper left front vertex of any cube are (minX, minY, minZ), the coordinates of the lower right rear vertex are (MaxX, MaxY, MaxZ), and the three vertices of any triangle face are A, B, and C respectively. If vertices A, B, and C are all within any cube, then any cube will be regarded as a cube constituting a virtual building.
[0150] For any cube, if there is no triangular face with three vertices located in any cube, then any cube cannot be used as a cube constituting a virtual building.
[0151] Step 506: Generate model data of the virtual building according to the maximum coordinate value, minimum coordinate value, number of row grids and index value of the cube constituting the virtual building of the bounding box of the virtual building.
[0152] Optionally, model data including the maximum value coordinates, minimum value coordinates, number of row grids, and index values of cubes constituting the virtual building of the bounding box of the virtual building is used as the model data of the virtual building.
[0153] In one possible implementation, after determining the cubes that comprise the virtual building in step 5, the index values of the cubes that comprise the virtual building are written into the texture map to obtain a texture path. The maximum coordinates, minimum coordinates, number of rows, and texture path of the virtual building's bounding box are saved to a JSON file. This JSON file contains the model data of the virtual building and is used to describe the model data of the virtual building. JSON (JavaScript Object Notation) is a lightweight data exchange format.
[0154] Since the maximum number of rows of the virtual building's bounding box is 256, the texture map size is 256*256*256. Each pixel in the texture map can store the index value of a cube. The index value of a cube is the position (x, y, z) of the cube in the virtual building's bounding box. For example, the index value (0, 0, 0) represents one cube, and the index value (256, 256, 256) represents another cube. When writing to the texture map, it is written in the form of r=x, g=y, and b=z.
[0155] In step 209, the terminal device receives the model data of the virtual building sent by the server, and generates a virtual building in a transparent state according to the model data of the virtual building.
[0156] In one possible implementation, a terminal device receives model data of a virtual building sent by a server. The process of generating a virtual building in a transparent state based on the model data of the virtual building includes: generating a virtual building in a transparent state based on the data of the bounding box of the virtual building and the index value of the cube constituting the virtual building.
[0157] Optionally, Figure 8 This is a schematic diagram of a process for generating a transparent virtual building provided by an embodiment of the present application. Figure 8 As shown, the process includes steps 801 to 805.
[0158] Step 801: Generate a bounding box of the virtual building according to the maximum value coordinate and the minimum value coordinate of the bounding box of the virtual building.
[0159] Step 802: Divide the bounding box of the virtual building according to the number of row grids to obtain multiple candidate cubes included in the bounding box of the virtual building and the index value of each candidate cube.
[0160] The index value of any candidate cube includes the row coordinate, column coordinate and ordinate of any candidate cube. This process is similar to the process in step 502 above and will not be described in detail here.
[0161] Step 803: Determine the cube constituting the virtual building from among the multiple candidate cubes according to the index value of the cube constituting the virtual building and the index values of each candidate cube.
[0162] Among the plurality of candidate cubes, a candidate cube having the same index value as the index value of the cube constituting the virtual building is taken as the cube constituting the virtual building.
[0163] Optionally, after the cube constituting the virtual building is determined among the multiple candidate cubes, the candidate cubes other than the cube constituting the virtual building are deleted from the multiple candidate cubes.
[0164] Step 804: Determine the vertex coordinates of each vertex constituting the virtual building based on the data of the bounding box of the virtual building.
[0165] In one possible implementation, determining the vertex coordinates of each vertex constituting the virtual building based on the bounding box data of the virtual building includes determining the vertex coordinates of each vertex of each candidate cube based on the bounding box data of the virtual building. The vertices of each candidate cube are used as the vertices constituting the virtual building, thereby obtaining the vertex coordinates of each vertex constituting the virtual building.
[0166] Optionally, the vertices of each candidate cube can be deduplicated based on the vertex coordinates of the vertices of each candidate cube to obtain deduplicated vertices, and there are no vertices with the same vertex coordinates among the deduplicated vertices; the deduplicated vertices are used as the vertices constituting the virtual building, so the vertex coordinates of the vertices constituting the virtual building can be obtained.
[0167] The process of determining the vertex coordinates of the vertices of each candidate cube based on the bounding box data of the virtual building is similar to the process of determining the position information of any cube in step 503 above, and will not be described in detail here.
[0168] Step 805: Generate a virtual building in a transparent state according to the vertex coordinates of each vertex constituting the virtual building.
[0169] In one possible implementation, the process of generating a virtual building in a transparent state based on the vertex coordinates of the vertices constituting the virtual building includes: generating the vertices constituting the virtual building based on the vertex coordinates of the vertices constituting the virtual building; obtaining a first model based on the vertices constituting the virtual building, wherein any two vertices in the first model are connected; adjusting the transparency of a surface formed by any three vertices in the first model to a target transparency, thereby obtaining a virtual building in a transparent state, wherein the transparency of the virtual building in the transparent state is the target transparency.
[0170] Optionally, after generating the vertices constituting the virtual building based on the vertex coordinates of the vertices constituting the virtual building, the colors of the vertices can be adjusted to a target color to obtain color-adjusted vertices. The process of obtaining a first model based on the vertices constituting the virtual building includes: obtaining the first model based on the color-adjusted vertices, wherein the color of a line connecting any two vertices in the first model is the target color.
[0171] The target color can be any color, which is not limited in the present embodiment. The target transparency can be any transparency greater than 0, which is not limited in the present embodiment. For example, the target color is gray and the target transparency is 100.
[0172] Optionally, the process of generating each vertex constituting the virtual building according to the vertex coordinates of each vertex constituting the virtual building includes: transferring the vertex coordinates of each vertex constituting the virtual building to the GPU (Graphics Processing Unit) through the VertexBuffer (vertex buffer) to generate each vertex constituting the virtual building.
[0173] In step 210 , based on the emission duration of the light satisfying the first duration requirement, the terminal device displays the virtual building in a transparent state at the display position of the virtual building.
[0174] Optionally, the light emission duration meeting the first duration requirement may be that the light emission duration is not less than the first duration. The first duration is set based on experience or adjusted according to the implementation environment, and is not limited in this embodiment of the present application. For example, the first duration is 3 seconds.
[0175] In one possible implementation, the process of displaying a virtual building in a transparent state at the display position of the virtual building based on the emission duration of the light satisfying the first duration requirement includes: canceling the display of the virtual building at the display position of the virtual building based on the emission duration of the light satisfying the first duration requirement, and displaying the virtual building in a transparent state at the display position of the virtual building.
[0176] Optionally, after the virtual building is canceled from the display position of the virtual building, the point cloud of the virtual building may also be displayed at the display position of the virtual building. When the display duration of the point cloud of the virtual building is greater than a duration threshold, the point cloud of the virtual building is canceled from the display position of the virtual building, and a virtual building in a transparent state is displayed at the display position of the virtual building.
[0177] The point cloud of the virtual building is the set of vertices that constitute the virtual building. Figure 9 Schematic diagram of a point cloud of a virtual building displayed at a display position of the virtual building provided by an embodiment of the present application. Figure 10 This is a schematic diagram of another display of a game screen provided in an embodiment of the present application. Figure 10 The game screen shown shows a transparent virtual building 1001. When the virtual building is transparent, virtual objects outside the building can see inside it. This allows the virtual object to see inside the building, as can its teammates. The game object controlling the virtual object can also see inside the building, allowing the game object to plan its position or learn about the enemy.
[0178] In step 211 , based on the virtual building in the transparent state meeting the display cancellation requirement, the terminal device displays the virtual building in the non-transparent state at the display position of the virtual building.
[0179] Among them, the virtual buildings in a transparent state meet the requirements for canceling the display, including any of the following:
[0180] The display duration of the virtual building in a transparent state meets the second duration requirement; wherein, the display duration of the virtual building in a transparent state meeting the second duration requirement means that the display duration of the virtual building in a transparent state is not less than the second duration. The second duration is set based on experience or adjusted according to the implementation environment, and is not limited in this embodiment of the application. Exemplarily, the second duration is 10 seconds.
[0181] A cancel display instruction is received from the server, where the cancel display instruction is used to instruct the virtual building in the transparent state to be canceled; wherein the server sends the cancel display instruction to the terminal device when the virtual object is interfered with by other virtual objects, or when the server determines that the display duration of the virtual building in the transparent state meets a second duration requirement, the server sends the cancel display instruction to the terminal device. Optionally, the virtual object being interfered with by other virtual objects includes but is not limited to the virtual object being attacked by other virtual objects.
[0182] A trigger operation for a cancel control is received, where the cancel control is used to cancel the display of the virtual building in a transparent state. Optionally, when the virtual building in a transparent state is displayed on the game screen, a cancel control is displayed on the game screen, and when the cancel control is triggered, the terminal device receives the trigger operation for the cancel control.
[0183] Based on the virtual building in the transparent state meeting the display cancellation requirement, the virtual building in the transparent state is canceled at the display position of the virtual building, and the virtual building in the non-transparent state is displayed at the display position of the virtual building. In other words, the virtual building in the non-transparent state is restored to the display position of the virtual building.
[0184] When the transparent virtual building is canceled from the game screen, a cancel control is also canceled from the game screen.
[0185] When the virtual building's perspective function is triggered, the above method displays the virtual building in a transparent state, allowing virtual objects located outside the virtual building to view its interior. Compared to methods that require virtual objects to enter the virtual building to view its interior, this method provides more flexible and less difficult viewing of the virtual building's interior, and also allows for more diverse ways for virtual objects to view the virtual building's interior. Because virtual objects are controlled by game objects, game objects can also view the interior of the virtual building, which in turn helps game objects further plan their battles, enhances the game's fun, and increases the game's engagement with the game object.
[0186] Figure 11 This is a flowchart of a method for displaying a virtual building provided by an embodiment of the present application. The method can be performed by Figure 1 The terminal device 101 shown executes, as shown in FIG. Figure 11 As shown, the method includes the following steps.
[0187] In step 1101 , a game screen is displayed, which includes virtual objects and virtual buildings in a virtual environment. The virtual buildings are in a non-transparent state, and the virtual objects are located outside the virtual buildings.
[0188] In a possible implementation, the process of displaying the game screen has been described in the above step 201 and will not be repeated here.
[0189] In step 1102 , when the perspective function of the virtual building is triggered, the virtual object is controlled to emit light toward the virtual building through the virtual prop held by the virtual object.
[0190] In a possible implementation, when the perspective function of the virtual building is triggered, the process of controlling the virtual object to emit light toward the virtual building through the virtual prop held by the virtual object has been described in the above step 206 and will not be repeated here.
[0191] In step 1103 , based on the emission duration of the light satisfying the first duration requirement, a virtual building in a transparent state is displayed at the display position of the virtual building.
[0192] In a possible implementation, based on the emission duration of the light satisfying the first duration requirement, the process of displaying the virtual building in a transparent state at the display position of the virtual building has been described in the above step 210 and will not be repeated here.
[0193] When the virtual building's perspective function is triggered, the above method displays the virtual building in a transparent state, allowing virtual objects located outside the virtual building to view its interior. Compared to methods that require virtual objects to enter the virtual building to view its interior, this method provides more flexible and less difficult viewing of the virtual building's interior, and also allows for more diverse ways for virtual objects to view the virtual building's interior. Because virtual objects are controlled by game objects, game objects can also view the interior of the virtual building, which in turn helps game objects further plan their battles, enhances the game's fun, and increases the game's engagement with the game object.
[0194] Figure 12 This is a flowchart of a method for displaying a virtual building provided by an embodiment of the present application. The method can be performed by Figure 1 The server 102 shown executes, as Figure 12 As shown, the method includes the following steps.
[0195] In step 1201, a data acquisition request sent by a terminal device is received. The data acquisition request carries an identifier of a virtual building. The data acquisition request is used to obtain model data of the virtual building. The model data of the virtual building includes data of a bounding box of the virtual building and index values of cubes constituting the virtual building.
[0196] In a possible implementation, the process of receiving the data acquisition request sent by the terminal device has been described in the above step 208 and will not be repeated here.
[0197] In step 1202, model data of a virtual building is sent to a terminal device according to a data acquisition request. The model data of the virtual building is used by the terminal device to generate and display a virtual building in a transparent state.
[0198] In a possible implementation, the process of sending the model data of the virtual building to the terminal device according to the data acquisition request has been described in the above step 208 and will not be repeated here.
[0199] The above method transmits model data of a virtual building to a terminal device, causing the terminal device to generate and display a transparent virtual building. This allows virtual objects located outside the virtual building to view the interior of the virtual building. Compared to methods that require virtual objects to enter the virtual building to view the interior of the virtual building, this method makes viewing the interior of the virtual building more flexible and less difficult, and also provides more diverse ways for virtual objects to view the interior of the virtual building. Because virtual objects are controlled by game objects, game objects can also view the interior of the virtual building, which in turn can help game objects further formulate combat plans, enhance the game's fun, and increase the game's stickiness.
[0200] Figure 13 This is a flowchart of a method for displaying a virtual building provided by an embodiment of the present application. The method can be performed by Figure 1 The terminal device 101 shown executes, as shown in FIG. Figure 13 As shown, the method includes the following steps.
[0201] Step 1301: Display a game screen, which includes virtual objects and virtual buildings in a virtual environment. The virtual buildings are in a non-transparent state, and the virtual objects are located outside the virtual buildings.
[0202] In a possible implementation, the process of displaying the game screen has been described in the above step 201 and will not be repeated here.
[0203] Step 1302: When the perspective function of the virtual building is triggered, determine the object state of the virtual object.
[0204] In a possible implementation, when the perspective function of the virtual building is triggered, the process of determining the object state of the virtual object has been described in the above step 202 and will not be repeated here.
[0205] Step 1303: When the object state of the virtual object meets the state requirement and it is determined that the virtual object can trigger the perspective function of the virtual building, control the virtual object to emit light toward the virtual building through the virtual prop held by the virtual object.
[0206] In a possible implementation, the process of controlling the virtual object to emit light toward the virtual building through the virtual prop held by the virtual object has been described in the above step 206 and will not be repeated here.
[0207] Step 1304: Obtain model data of the virtual building.
[0208] In a possible implementation, the process of obtaining the model data of the virtual building has been described in steps 207 and 208 above and will not be repeated here.
[0209] Step 1305: Generate a virtual building in a transparent state according to the model data of the virtual building.
[0210] In a possible implementation, the process of generating a transparent virtual building according to the model data of the virtual building has been described in the above step 209 and will not be repeated here.
[0211] Step 1306: Based on the emission duration of the light satisfying the first duration requirement, a virtual building in a transparent state is displayed at the display position of the virtual building.
[0212] In a possible implementation, based on the emission duration of the light satisfying the first duration requirement, the process of displaying the virtual building in a transparent state at the display position of the virtual building has been described in the above step 210 and will not be repeated here.
[0213] When the virtual building's perspective function is triggered, the above method displays the virtual building in a transparent state, allowing virtual objects located outside the virtual building to view its interior. Compared to methods that require virtual objects to enter the virtual building to view its interior, this method provides more flexible and less difficult viewing of the virtual building's interior, and also allows for more diverse ways for virtual objects to view the virtual building's interior. Because virtual objects are controlled by game objects, game objects can also view the interior of the virtual building, which in turn helps game objects further plan their battles, enhances the game's fun, and increases the game's engagement with the game object.
[0214] Figure 14 FIG. 1 is a schematic diagram of a structure of a display device for a virtual building provided by an embodiment of the present application. Figure 14 As shown, the device includes:
[0215] The display module 1401 is used to display the game screen, which includes virtual objects and virtual buildings in a virtual environment. The virtual buildings are in a non-transparent state, and the virtual objects are located outside the virtual buildings.
[0216] The control module 1402 is used to control the virtual object to emit light toward the virtual building through the virtual prop held by the virtual object when the perspective function of the virtual building is triggered;
[0217] The display module 1401 is further configured to display the virtual building in a transparent state at the display position of the virtual building based on the emission duration of the light satisfying the first duration requirement.
[0218] In a possible implementation, the apparatus further includes:
[0219] An acquisition module, configured to acquire model data of a virtual building, wherein the model data of the virtual building includes data of a bounding box of the virtual building and index values of cubes constituting the virtual building;
[0220] The generating module is used for generating a virtual building in a transparent state according to the data of the bounding box of the virtual building and the index value of the cube constituting the virtual building.
[0221] In a possible implementation, the data of the bounding box of the virtual building includes the maximum value coordinates, the minimum value coordinates, and the number of row grids of the bounding box of the virtual building;
[0222] The generation module is used to generate a bounding box of the virtual building based on the maximum value coordinate and the minimum value coordinate of the bounding box of the virtual building; divide the bounding box of the virtual building according to the number of row grids to obtain multiple candidate cubes included in the bounding box of the virtual building and the index value of each candidate cube; determine the cube constituting the virtual building from the multiple candidate cubes based on the index value of the cube constituting the virtual building and the index value of each candidate cube; determine the vertex coordinates of each vertex constituting the virtual building based on the data of the bounding box of the virtual building; and generate a virtual building in a transparent state based on the vertex coordinates of each vertex constituting the virtual building.
[0223] In one possible implementation, a generation module is configured to determine the vertex coordinates of the vertices of each candidate cube based on the data of the bounding box of the virtual building; deduplicate the vertices of each candidate cube based on the vertex coordinates of the vertices of each candidate cube to obtain deduplicated vertices, wherein no vertices have the same vertex coordinates among the deduplicated vertices; and use the deduplicated vertices as the vertices constituting the virtual building.
[0224] In one possible implementation, a generation module is used to generate each vertex constituting a virtual building based on the vertex coordinates of each vertex constituting the virtual building; obtain a first model based on the each vertex constituting the virtual building, wherein any two vertices in the first model are connected; and adjust the transparency of a surface constituted by any three vertices in the first model to a target transparency to obtain a virtual building in a transparent state, wherein the transparency of the virtual building in the transparent state is the target transparency.
[0225] In a possible implementation, the generation module is further configured to adjust the color of each vertex to a target color, thereby obtaining a vertex with adjusted color;
[0226] The generating module is used to obtain a first model according to the vertices whose colors are adjusted, wherein the color of the line between any two vertices in the first model is the target color.
[0227] In one possible implementation, the acquisition module is used to send a data acquisition request to a server, the data acquisition request carries an identifier of a virtual building, and the data acquisition request is used to acquire model data of the virtual building; and receive the model data of the virtual building returned by the server based on the data acquisition request.
[0228] In one possible implementation, a perspective control is also displayed on the game screen, and the perspective control is used to trigger the perspective function of the virtual building;
[0229] The device also includes:
[0230] a determination module, configured to determine an object state of the virtual object in response to a triggering operation on the perspective control;
[0231] a sending module, configured to send a trigger request to a server based on the object state of the virtual object satisfying the state requirement, the trigger request including the object identifier of the virtual object and the identifier of the perspective control, the trigger request being used by the server to determine whether the virtual object can trigger the perspective function of the virtual building;
[0232] A receiving module, configured to receive a confirmation instruction returned by the server based on the trigger request;
[0233] The determination module is further configured to determine that the perspective function of the virtual building is triggered based on the confirmation instruction indicating that the virtual object can trigger the perspective function of the virtual building.
[0234] In a possible implementation, the object state of the virtual object satisfies the state requirement, including at least one of the following:
[0235] The virtual object is in a non-falling state;
[0236] The virtual object is not on the virtual vehicle;
[0237] The virtual object is in a non-climbing state;
[0238] The virtual object is in a non-rescue state;
[0239] The health value of the virtual object is greater than the health value threshold.
[0240] In a possible implementation, the receiving module is further configured to receive a denial instruction returned by the server based on the trigger request;
[0241] The display module 1401 is further configured to indicate that the virtual object cannot trigger the perspective function of the virtual building based on the denial instruction, and to display a prompt message indicating that the virtual object cannot trigger the perspective function of the virtual building.
[0242] In a possible implementation, the display module 1401 is further configured to cancel the display of the virtual building in the transparent state at the display position of the virtual building based on the virtual building in the transparent state meeting the display cancellation requirement, and display the virtual building in the non-transparent state at the display position of the virtual building.
[0243] In a possible implementation, the virtual building in a transparent state satisfies the display cancellation requirements, including any of the following:
[0244] The display duration of the virtual building in a transparent state meets the second duration requirement;
[0245] receiving a cancel display instruction sent by the server, where the cancel display instruction is used to instruct to cancel the display of the virtual building in a transparent state;
[0246] A trigger operation for a cancel control is received, where the cancel control is used to cancel display of the virtual building in a transparent state.
[0247] When the perspective function of a virtual building is triggered, the aforementioned device displays the virtual building in a transparent state, allowing virtual objects located outside the virtual building to view the interior of the virtual building. Compared to methods that require virtual objects to enter the virtual building to view the interior of the virtual building, this method makes viewing the interior of the virtual building more flexible and less difficult, and also allows virtual objects to view the interior of the virtual building in more diverse ways. Because virtual objects are controlled by game objects, game objects can also view the interior of the virtual building, which in turn can help game objects further formulate combat plans, increase the game's fun factor, and enhance the game's stickiness.
[0248] Figure 15 FIG. 1 is a schematic diagram of a structure of a display device for a virtual building provided by an embodiment of the present application. Figure 15 As shown, the device includes:
[0249] Receiving module 1501, configured to receive a data acquisition request sent by a terminal device, the data acquisition request carrying an identifier of a virtual building, the data acquisition request being used to acquire model data of the virtual building, the model data of the virtual building including data of a bounding box of the virtual building and index values of cubes constituting the virtual building;
[0250] The sending module 1502 is used to send the model data of the virtual building to the terminal device according to the data acquisition request. The model data of the virtual building is used by the terminal device to generate and display the virtual building in a transparent state.
[0251] In a possible implementation, the data of the bounding box of the virtual building includes the maximum value coordinates, the minimum value coordinates and the number of row grids of the bounding box of the virtual building;
[0252] The device also includes: a generation module, which is used to create a bounding box of a virtual building; divide the bounding box of the virtual building according to the number of row grids to obtain multiple cubes included in the bounding box of the virtual building and the index value of each cube; determine the position information of each cube; obtain triangular facet data of the virtual building, the triangular facet data includes multiple triangular facets, and each triangular facet includes three vertices; according to the coordinates of the vertices of each triangular facet and the position information of each cube, determine the cubes constituting the virtual building from the multiple cubes, and there is at least one triangular facet in any cube constituting the virtual building; and generate model data of the virtual building according to the maximum coordinate value, minimum coordinate value, number of row grids and index value of the cubes constituting the virtual building of the bounding box of the virtual building.
[0253] The above-mentioned device transmits model data of a virtual building to a terminal device, causing the terminal device to generate and display a transparent virtual building. This allows virtual objects located outside the virtual building to view the interior of the virtual building. Compared to methods that require virtual objects to enter the virtual building to view the interior of the virtual building, this method makes viewing the interior of the virtual building more flexible and less difficult, and also allows virtual objects to view the interior of the virtual building in more diverse ways. Because virtual objects are controlled by game objects, game objects can also view the interior of the virtual building, which can help game objects make further combat arrangements, improve the game's fun, and increase the game's stickiness to the game object.
[0254] It should be understood that the above-mentioned device is merely an example of the division of the above-mentioned functional modules when implementing its functions. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0255] Figure 16The following is a block diagram of a terminal device 1600 provided in accordance with an exemplary embodiment of the present application. The terminal device 1600 may be any electronic device capable of human-computer interaction with a user through one or more methods, such as a keyboard, touchpad, remote control, voice interaction, or handwriting device. Examples include a PC (Personal Computer), mobile phone, smartphone, PDA (Personal Digital Assistant), wearable device, Pocket PC (PPC), tablet computer, smart car computer, smart TV, smart speaker, smart watch, and the like.
[0256] Typically, the terminal device 1600 includes a processor 1601 and a memory 1602 .
[0257] The processor 1601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1601 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 1601 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1601 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0258] The memory 1602 may include one or more computer-readable storage media, which may be non-transitory. The memory 1602 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1602 is used to store at least one instruction, which is used to be executed by the processor 1601 to implement the present application. Figure 11 The method embodiment shown provides a method for displaying a virtual building.
[0259] In some embodiments, terminal device 1600 may optionally include a peripheral device interface 1603 and at least one peripheral device. The processor 1601, memory 1602, and peripheral device interface 1603 may be connected via a bus or signal lines. Each peripheral device may be connected to peripheral device interface 1603 via a bus, signal lines, or circuit boards. Specifically, the peripheral device may include at least one of a radio frequency circuit 1604, a display screen 1605, a camera assembly 1606, an audio circuit 1607, and a power supply 1609.
[0260] The peripheral device interface 1603 can be used to connect at least one I / O (Input / Output)-related peripheral device to the processor 1601 and the memory 1602. In some embodiments, the processor 1601, the memory 1602, and the peripheral device interface 1603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1601, the memory 1602, and the peripheral device interface 1603 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0261] RF circuit 1604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. RF circuit 1604 communicates with communication networks and other communication devices via electromagnetic signals. RF circuit 1604 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. RF circuit 1604 may optionally include an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. RF circuit 1604 may communicate with other terminal devices via at least one wireless communication protocol. Such wireless communication protocols include, but are not limited to, the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, RF circuit 1604 may also include circuitry related to Near Field Communication (NFC), although this application does not limit this.
[0262] The display screen 1605 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1605 is a touch screen display, the display screen 1605 also has the ability to collect touch signals on the surface or above the surface of the display screen 1605. The touch signal can be input as a control signal to the processor 1601 for processing. At this time, the display screen 1605 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 can be one display screen 1605, which is set on the front panel of the terminal device 1600; in other embodiments, there can be at least two display screens 1605, which are respectively set on different surfaces of the terminal device 1600 or in a folding design; in other embodiments, the display screen 1605 can be a flexible display screen, which is set on the curved surface or folding surface of the terminal device 1600. Even more, the display screen 1605 can be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 1605 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0263] The camera assembly 1606 is used to capture images or videos. Optionally, the camera assembly 1606 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal device 1600, and the rear camera is arranged on the back of the terminal device 1600. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 1606 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 a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0264] The audio circuit 1607 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals that are input into the processor 1601 for processing, or input into the radio frequency circuit 1604 to achieve voice communication. For the purpose of stereo sound collection or noise reduction, there can be multiple microphones, each located in different parts of the terminal device 1600. The microphone can also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert the electrical signal from the processor 1601 or the radio frequency circuit 1604 into sound waves. The speaker can 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 purposes such as ranging. In some embodiments, the audio circuit 1607 may also include a headphone jack.
[0265] Power supply 1609 is used to power the various components in terminal device 1600. Power supply 1609 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1609 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, while a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0266] In some embodiments, the terminal device 1600 further includes one or more sensors 1610 , including but not limited to: an acceleration sensor 1611 , a gyroscope sensor 1612 , a pressure sensor 1613 , an optical sensor 1615 , and a proximity sensor 1616 .
[0267] The accelerometer 1611 can detect the magnitude of acceleration along the three coordinate axes of the coordinate system established by the terminal device 1600. For example, the accelerometer 1611 can be used to detect the components of gravity acceleration along the three coordinate axes. The processor 1601 can control the display screen 1605 to display the user interface in a landscape or portrait view based on the gravity acceleration signal collected by the accelerometer 1611. The accelerometer 1611 can also be used to collect game or user motion data.
[0268] The gyroscope sensor 1612 can detect the body orientation and rotation angle of the terminal device 1600. The gyroscope sensor 1612 can work with the accelerometer 1611 to collect the user's 3D movements of the terminal device 1600. Based on the data collected by the gyroscope sensor 1612, the processor 1601 can implement the following functions: motion sensing (such as changing the UI based on the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0269] The pressure sensor 1613 can be set on the side frame of the terminal device 1600 and / or the lower layer of the display screen 1605. When the pressure sensor 1613 is set on the side frame of the terminal device 1600, it can detect the user's grip signal of the terminal device 1600, and the processor 1601 performs left and right hand recognition or shortcut operations based on the grip signal collected by the pressure sensor 1613. When the pressure sensor 1613 is set on the lower layer of the display screen 1605, the processor 1601 controls the operable controls on the UI interface based on the user's pressure operation on the display screen 1605. The operable controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0270] Optical sensor 1615 is used to detect ambient light intensity. In one embodiment, processor 1601 can control the display brightness of display screen 1605 based on the ambient light intensity detected by optical sensor 1615. Specifically, when the ambient light intensity is high, the display brightness of display screen 1605 is increased; when the ambient light intensity is low, the display brightness of display screen 1605 is decreased. In another embodiment, processor 1601 can also dynamically adjust the shooting parameters of camera assembly 1606 based on the ambient light intensity detected by optical sensor 1615.
[0271] Proximity sensor 1616, also known as a distance sensor, is typically located on the front panel of terminal device 1600. Proximity sensor 1616 is used to detect the distance between the user and the front of terminal device 1600. In one embodiment, when proximity sensor 1616 detects that the distance between the user and the front of terminal device 1600 is gradually decreasing, processor 1601 controls display screen 1605 to switch from the screen-on state to the screen-off state. When proximity sensor 1616 detects that the distance between the user and the front of terminal device 1600 is gradually increasing, processor 1601 controls display screen 1605 to switch from the screen-off state to the screen-on state.
[0272] Those skilled in the art will understand that Figure 16 The structure shown in the figure does not constitute a limitation on the terminal device 1600, and the terminal device 1600 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0273] Figure 17The server 1700 may have different configurations or performances, and may include one or more processors (CPUs) 1701 and one or more memories 1702. The one or more memories 1702 store at least one program code, which is loaded and executed by the one or more processors 1701 to implement the above-mentioned Figure 12 The method embodiment shown provides a method for displaying a virtual building. Of course, the server 1700 may also have components such as a wired or wireless network interface, a keyboard, and an input / output interface for input and output. The server 1700 may also include other components for implementing device functions, which will not be described in detail here.
[0274] In an exemplary embodiment, a computer-readable storage medium is further provided. The storage medium stores at least one program code. The at least one program code is loaded and executed by a processor to enable a computer to implement any of the above-mentioned methods for displaying a virtual building.
[0275] Optionally, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, or the like.
[0276] In an exemplary embodiment, a computer program or a computer program product is further provided. The computer program or the computer program product stores at least one computer instruction, which is loaded and executed by a processor to enable a computer to implement any of the above-mentioned virtual building display methods.
[0277] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, storage, display, etc.), and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the game images and model data involved in this application were obtained with full authorization.
[0278] It should be understood that the term "plurality" used herein refers to two or more. "And / or" describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. The character " / " generally indicates an "or" relationship between the associated objects.
[0279] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0280] The above description is merely an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for displaying a virtual building, characterized in that: The method comprises: Displaying a game screen, the game screen including a virtual object and a virtual building in a virtual environment, the virtual building being in a non-transparent state, and the virtual object being located outside the virtual building; When the perspective function of the virtual building is triggered, controlling the virtual object to emit light toward the virtual building through the virtual prop held by the virtual object; Based on the emission duration of the light satisfying the first duration requirement, a virtual building in a transparent state is displayed at the display position of the virtual building.
2. The method according to claim 1, characterized in that After controlling the virtual object to emit light toward the virtual building through the held virtual prop when the perspective function of the virtual building is triggered, the method further includes: Acquire model data of the virtual building, wherein the model data of the virtual building includes data of a bounding box of the virtual building and index values of cubes constituting the virtual building; A virtual building in a transparent state is generated according to the data of the bounding box of the virtual building and the index value of the cube constituting the virtual building.
3. The method according to claim 2, characterized in that The data of the bounding box of the virtual building includes the maximum value coordinates, the minimum value coordinates, and the number of row grids of the bounding box of the virtual building; Generating a virtual building in a transparent state according to the data of the bounding box of the virtual building and the index value of the cube constituting the virtual building includes: generating a bounding box of the virtual building according to the maximum value coordinate and the minimum value coordinate of the bounding box of the virtual building; Dividing the bounding box of the virtual building according to the number of row grids to obtain a plurality of candidate cubes included in the bounding box of the virtual building and an index value of each candidate cube; determining a cube constituting the virtual building from among the plurality of candidate cubes according to the index value of the cube constituting the virtual building and the index values of the candidate cubes; Determining vertex coordinates of each vertex constituting the virtual building according to the data of the bounding box of the virtual building; A virtual building in a transparent state is generated according to the vertex coordinates of the vertices constituting the virtual building.
4. The method according to claim 3, characterized in that The step of determining the vertex coordinates of each vertex constituting the virtual building based on the bounding box data of the virtual building includes: Determining vertex coordinates of vertices of each candidate cube based on the data of the bounding box of the virtual building; Deduplicating the vertices of the candidate cubes according to the vertex coordinates of the vertices of the candidate cubes to obtain deduplicated vertices, wherein no vertices have the same vertex coordinates among the deduplicated vertices; The vertices after deduplication are used as vertices constituting the virtual building.
5. The method according to claim 3, characterized in that The step of generating a transparent virtual building according to the vertex coordinates of the vertices constituting the virtual building comprises: generating the vertices constituting the virtual building according to the vertex coordinates of the vertices constituting the virtual building; Acquire a first model according to the vertices constituting the virtual building, wherein any two vertices in the first model are connected; The transparency of a surface formed by any three vertices in the first model is adjusted to a target transparency, thereby obtaining a virtual building in a transparent state, where the transparency of the virtual building in the transparent state is the target transparency.
6. The method according to claim 5, characterized in that After generating the vertices constituting the virtual building according to the vertex coordinates of the vertices constituting the virtual building, the method further includes: Adjusting the color of each vertex to a target color to obtain a vertex with adjusted color; The step of obtaining a first model according to the vertices constituting the virtual building includes: A first model is obtained according to the vertices whose colors are adjusted, and the color of a line between any two vertices in the first model is the target color.
7. The method according to claim 2, characterized in that The obtaining of the model data of the virtual building includes: Sending a data acquisition request to a server, wherein the data acquisition request carries an identifier of the virtual building, and the data acquisition request is used to acquire model data of the virtual building; The model data of the virtual building returned by the server based on the data acquisition request is received.
8. The method according to any one of claims 1 to 7, characterized in that: The game screen also displays a perspective control, which is used to trigger the perspective function of the virtual building; After displaying the game screen, the method further includes: In response to a triggering operation on the perspective control, determining an object state of the virtual object; Based on the object state of the virtual object meeting the state requirement, sending a trigger request to the server, the trigger request including the object identifier of the virtual object and the identifier of the perspective control, the trigger request being used by the server to determine whether the virtual object can trigger the perspective function of the virtual building; receiving a confirmation instruction returned by the server based on the trigger request; Based on the confirmation instruction indicating that the virtual object can trigger the perspective function of the virtual building, it is determined that the perspective function of the virtual building is triggered.
9. The method according to claim 8, characterized in that The object state of the virtual object satisfies the state requirement including at least one of the following: The virtual object is in a non-falling state; The virtual object is not on the virtual vehicle; The virtual object is in a non-climbing state; The virtual object is in a non-rescue state; The life value of the virtual object is greater than a life value threshold.
10. The method according to claim 8, characterized in that After sending a trigger request to the server based on the object state of the virtual object meeting the state requirement, the method further includes: receiving a denial instruction returned by the server based on the trigger request; Based on the denial instruction indicating that the virtual object cannot trigger the perspective function of the virtual building, prompt information is displayed, where the prompt information is used to indicate that the virtual object cannot trigger the perspective function of the virtual building.
11. The method according to any one of claims 1 to 7, characterized in that: Based on the emission duration of the light satisfying the first duration requirement, after displaying the virtual building in a transparent state at the display position of the virtual building, the method further includes: Based on the virtual building in the transparent state meeting the display cancellation requirement, the virtual building in the transparent state is canceled from the display position of the virtual building, and the virtual building in the non-transparent state is displayed at the display position of the virtual building.
12. The method according to claim 11, characterized in that The virtual building in a transparent state satisfies the display cancellation requirements, including any of the following: The display duration of the virtual building in the transparent state meets the second duration requirement; receiving a display cancellation instruction sent by the server, wherein the display cancellation instruction is used to instruct to cancel the display of the virtual building in the transparent state; A trigger operation for a cancel control is received, where the cancel control is used to cancel display of the virtual building in the transparent state.
13. A method for displaying a virtual building, characterized in that: The method comprises: Receiving a data acquisition request sent by a terminal device, the data acquisition request carrying an identifier of a virtual building, the data acquisition request being used to acquire model data of the virtual building, the model data of the virtual building including data of a bounding box of the virtual building and index values of cubes constituting the virtual building; The model data of the virtual building is sent to the terminal device according to the data acquisition request, and the model data of the virtual building is used by the terminal device to generate and display the virtual building in a transparent state.
14. The method according to claim 13, characterized in that The data of the bounding box of the virtual building includes the maximum value coordinates, the minimum value coordinates and the number of row grids of the bounding box of the virtual building; The method further comprises: Creating a bounding box of the virtual building; Dividing the bounding box of the virtual building according to the number of row grids to obtain a plurality of cubes included in the bounding box of the virtual building and an index value of each cube; Determining the position information of each cube; Acquire triangular face data of the virtual building, wherein the triangular face data includes a plurality of triangular facets, and each triangular facet includes three vertices; Determining a cube constituting the virtual building from the plurality of cubes according to the coordinates of the vertices of each triangular facet and the position information of each cube, wherein at least one triangular facet exists in any cube constituting the virtual building; Model data of the virtual building is generated according to the maximum coordinate value, the minimum coordinate value, the number of row grids and the index value of the cube constituting the virtual building of the bounding box of the virtual building.
15. The method according to claim 14, characterized in that The step of determining a cube constituting the virtual building from the plurality of cubes according to the coordinates of the vertices of each triangular facet and the position information of each cube comprises: For any cube among the multiple cubes, the multiple triangular facets are traversed according to the position information of the any cube, and based on the existence of a triangular facet whose three vertices are located in the any cube, the any cube is used as a cube constituting the virtual building.
16. A display device for a virtual building, characterized in that: The device comprises: A display module is configured to display a game screen, wherein the game screen includes virtual objects and virtual buildings located in a virtual environment, wherein the virtual buildings are in a non-transparent state, and the virtual objects are located outside the virtual buildings; a control module, configured to control the virtual object to emit light toward the virtual building through the virtual prop held by the virtual object when the perspective function of the virtual building is triggered; The display module is further configured to display a virtual building in a transparent state at the display position of the virtual building based on the emission duration of the light satisfying a first duration requirement.
17. A display device for a virtual building, characterized in that: The device comprises: a receiving module, configured to receive a data acquisition request sent by a terminal device, the data acquisition request carrying an identifier of a virtual building, the data acquisition request being used to acquire model data of the virtual building, the model data of the virtual building including maximum coordinates, minimum coordinates, number of rows of grids, and index values of cubes constituting the virtual building, of a bounding box of the virtual building; The sending module is used to send the model data of the virtual building to the terminal device according to the data acquisition request, and the model data of the virtual building is used by the terminal device to generate and display the virtual building in a transparent state.
18. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one program code, and the at least one program code is loaded and executed by the processor, so that the computer device implements the virtual building display method according to any one of claims 1 to 15.
19. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one program code, and the at least one program code is loaded and executed by a processor to enable a computer to implement the method for displaying a virtual building according to any one of claims 1 to 15.
20. A computer program product, characterized in that The computer program product stores at least one computer instruction, and the at least one computer instruction is loaded and executed by a processor to enable a computer to implement the method for displaying a virtual building according to any one of claims 1 to 15.