Virtual city wall model generation method and device, computer device and storage medium
By acquiring the shape and trend of the virtual support model and the city wall model, and arranging them along the shape and trend, the problem of low efficiency in virtual model production is solved, and the efficient generation and diversified adjustment of virtual city wall models are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2022-11-22
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, the production efficiency of virtual models is low, they cannot be adjusted at any time according to the needs of game developers, and the reuse rate of virtual models is low.
By acquiring the shape and trend of virtual support models and city wall models, and arranging them along the shape and trend to construct virtual city wall models, a method and apparatus for generating virtual city wall models is provided, allowing game developers to adjust them according to their needs.
It improves the reusability and production efficiency of virtual city wall models, enabling the rapid generation of diverse virtual city wall models that meet specific needs.
Smart Images

Figure CN115738282B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more particularly to the field of game technology, specifically to a method, apparatus, computer device, and storage medium for generating virtual city wall models. Background Technology
[0002] With the continuous development of computer communication technology and the widespread use of terminals such as smartphones, tablets, and laptops, terminals are becoming increasingly diversified and personalized, becoming indispensable in people's lives and work. To satisfy people's pursuit of spiritual enrichment, entertainment games playable on these terminals have emerged, resulting in a growing number of such games. Terminal games have become an indispensable form of entertainment. To provide users with a better gaming experience, many terminal games are often built based on real-world scenarios. Therefore, when designing games, the implementation of game scenes aims to be as close to the real environment as possible.
[0003] In actual game design projects, artists and designers often propose the creation of game assets. For example, game assets can be used to create virtual models of various simulated real-life scenes or buildings, such as virtual city walls and virtual city walls with virtual doorways. Currently, game developers typically create models in modeling software based on each specific game requirement. However, virtual models created using this method cannot be easily adjusted according to the developers' needs, resulting in low reusability and low production efficiency. Summary of the Invention
[0004] This application provides a method, apparatus, computer device, and storage medium for generating virtual city wall models. By arranging multiple virtual composite models on model arrangement lines, an adjustable virtual city wall model is obtained. Game developers can adjust the virtual city wall model according to specific needs to obtain a virtual city wall model that meets the requirements. This allows for the rapid generation of various virtual city wall models, improving the reusability and production efficiency of virtual city wall models.
[0005] This application provides a method for generating a virtual city wall model, including:
[0006] Obtain a virtual support model, wherein the virtual support model is used to construct a virtual city wall model;
[0007] The shape trend of the virtual city wall model is obtained, wherein the shape trend is used to reflect the city wall structure of the virtual city wall model and the arrangement direction of the multiple virtual supports constituting the virtual city wall model;
[0008] The virtual support model is arranged along the shape and trend of the virtual city wall model to construct the virtual city wall model.
[0009] Accordingly, this application also provides an apparatus for generating a virtual city wall model, the apparatus comprising:
[0010] The first acquisition unit is used to acquire a virtual support model, wherein the virtual support model is used to construct a virtual city wall model;
[0011] The second acquisition unit is used to acquire the shape trend of the virtual city wall model, wherein the shape trend is used to reflect the city wall structure of the virtual city wall model and the arrangement direction of the multiple virtual supports constituting the virtual city wall model.
[0012] An arrangement unit is used to arrange the virtual support model along the shape and trend of the virtual city wall model, so as to construct the virtual city wall model through the virtual support model.
[0013] Accordingly, this application also provides a computer device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements any of the above-described methods for generating a virtual city wall model.
[0014] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the above-described methods for generating a virtual city wall model.
[0015] This application provides a method, apparatus, computer device, and storage medium for generating virtual city wall models. The method involves acquiring a virtual support model, which is used to construct the virtual city wall model; then, acquiring the shape and trend of the virtual city wall model, where the shape and trend reflect the wall structure and the arrangement direction of the multiple virtual supports constituting the virtual city wall model; finally, arranging the virtual support models along the shape and trend of the virtual city wall model to construct the virtual city wall model. This application provides an adjustable virtual city wall model by arranging multiple virtual combination models on model arrangement lines. Game developers can adjust the virtual city wall model according to specific needs to obtain a virtual city wall model that meets their requirements, thereby quickly generating various virtual city wall models, improving the reusability and production efficiency of virtual city wall models. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A schematic diagram of a system for generating virtual city wall models provided in this application embodiment.
[0018] Figure 2 This is a flowchart illustrating a method for generating a virtual city wall model provided in an embodiment of this application.
[0019] Figure 3 This is a schematic diagram illustrating an application scenario of the method for generating a virtual city wall model provided in this application embodiment.
[0020] Figure 4 This is a schematic diagram illustrating another application scenario of the method for generating a virtual city wall model provided in the embodiments of this application.
[0021] Figure 5 This is a schematic diagram illustrating another application scenario of the method for generating a virtual city wall model provided in the embodiments of this application.
[0022] Figure 6 This is a schematic diagram illustrating another application scenario of the method for generating a virtual city wall model provided in the embodiments of this application.
[0023] Figure 7 This is a schematic diagram illustrating another application scenario of the method for generating a virtual city wall model provided in the embodiments of this application.
[0024] Figure 8 This is a schematic diagram illustrating another application scenario of the method for generating a virtual city wall model provided in the embodiments of this application.
[0025] Figure 9 This is a schematic diagram illustrating another application scenario of the method for generating a virtual city wall model provided in the embodiments of this application.
[0026] Figure 10 This is a schematic diagram illustrating another application scenario of the method for generating a virtual city wall model provided in the embodiments of this application.
[0027] Figure 11 This is a schematic diagram of a device for generating a virtual city wall model provided in an embodiment of this application.
[0028] Figure 12 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0029] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0030] This application provides a method, apparatus, computer device, and storage medium for generating a virtual city wall model. Specifically, the method for generating a virtual city wall model can be executed by a computer device, which can be a terminal or a server. The terminal can be a smartphone, tablet, laptop, touchscreen, game console, personal computer (PC), personal digital assistant (PDA), or other terminal device. The terminal can also include a client, which can be a game application client, a browser client carrying a game program, or an instant messaging client. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0031] For example, when this method for generating a virtual city wall model runs on a terminal, the terminal device stores a game application and uses it to render a virtual scene in the game. The terminal device is used to interact with the user through a graphical user interface (GUI), such as by downloading, installing, and running the game application. The way the terminal device provides the GUI to the user can be varied; for example, it can be rendered and displayed on the terminal device's screen, or it can present the GUI through holographic projection. For instance, the terminal device can include a touchscreen display and a processor. The touchscreen display is used to present the GUI and receive user commands applied to the GUI, which includes game graphics. The processor is used to run the game, generate the GUI, respond to commands, and control the display of the GUI on the touchscreen display.
[0032] For example, when this method for generating virtual city wall models runs on a server, it can be used for cloud gaming. Cloud gaming refers to a gaming method based on cloud computing. In cloud gaming, the game application and the game screen presentation are separate. The storage and execution of the virtual city wall model generation method are completed on the cloud gaming server. The game screen presentation is completed on the cloud gaming client, which is mainly used for receiving and sending game data and presenting the game screen. For example, the cloud gaming client can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, PDA, or personal digital assistant. However, the terminal device for processing game data is the cloud gaming server in the cloud. When playing the game, the user operates the cloud gaming client to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses the game screen and other data, returns it to the cloud gaming client via the network, and finally, the cloud gaming client decodes and outputs the game screen.
[0033] Please see Figure 1 , Figure 1 This is a schematic diagram of a system for generating virtual city wall models provided in an embodiment of this application. The system may include at least one terminal, at least one server, at least one database, and a network. The user's terminal can connect to different game servers via the network. The terminal is any device with computing hardware capable of supporting and executing software products corresponding to the game. Furthermore, when the system includes multiple terminals, multiple servers, and multiple networks, different terminals can connect to each other through different networks and servers. The network can be a wireless network or a wired network, such as a wireless local area network (WLAN), local area network (LAN), cellular network, 2G network, 3G network, 4G network, 5G network, etc. Additionally, different terminals can also connect to other terminals or servers using their own Bluetooth networks or hotspot networks. For example, multiple users can connect online through different terminals via appropriate networks and synchronize with each other to support multiplayer games. Furthermore, the system may include multiple databases coupled to different servers, and can continuously store information related to the game environment in the databases while different users are playing multiplayer games online.
[0034] It should be noted that, Figure 1The schematic diagram of the virtual city wall model generation system shown is merely an example. The virtual city wall model generation system and scenario described in this application embodiment are for the purpose of more clearly illustrating the technical solutions of this application embodiment and do not constitute a limitation on the technical solutions provided by this application embodiment. As those skilled in the art will know, with the emergence of new business scenarios, the technical solutions provided by this application embodiment are also applicable to similar technical problems.
[0035] The method for generating virtual city wall models provided in this application embodiment can create virtual models using 3D modeling software; then, multiple virtual models are combined to form a virtual composite model; next, the multiple virtual composite models are arranged on model arrangement lines to obtain an adjustable target virtual model. Based on this, game developers can adjust the target virtual model according to specific needs to obtain a virtual model that meets those needs, thereby quickly generating various virtual buildings, improving the reusability of virtual models, and increasing the efficiency of virtual model production.
[0036] To address the aforementioned problems, this application provides a method, apparatus, computer device, and storage medium for generating virtual city wall models, which can improve the reusability and production efficiency of virtual models. These will be described in detail below. It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments.
[0037] Please see Figure 2 , Figure 2 This is a flowchart illustrating a method for generating a virtual city wall model according to an embodiment of this application. The specific process of this method can be shown in steps 101 to 103 as follows:
[0038] 101. Obtain a virtual support model, wherein the virtual support model is used to construct a virtual city wall model.
[0039] In this embodiment of the application, the virtual support model is a virtual model, which can be created using model making software. For example, it can be created using 3D MAX (3D Studio MAX). Designers can pre-set the size and shape of the model and create a virtual model in 3D MAX based on the preset model size and shape.
[0040] The virtual model can include skinning data and bounding boxes. Skinning data can include multiple vertex data, each with corresponding weights, vertex position information, normals, triangle sequences, and other attribute information. Based on the triangle sequence of each vertex, triangular faces can be formed, and multiple triangular faces can form a graphical mesh, i.e., a triangular mesh. A bounding box is a simple geometric space containing objects of complex shapes. Adding bounding boxes to individual virtual model units serves to perform rapid collision detection or to filter collisions before performing precise collision detection; that is, precise collision detection and processing are only performed when the bounding box collides with the object.
[0041] Specifically, the virtual support model can be a virtual brick model, a virtual earth and stone model, or a virtual timber model, etc. Within the same virtual city wall model, the virtual support models of each other can have the same or different shapes. That is, the length, width, and shape of the virtual supports can be the same or different, thus making each virtual support model have a similar or different shape, making the virtual city wall model more consistent with real-life city wall architecture, and improving the realism of the virtual city wall model.
[0042] To obtain virtual support models of different shapes and forms, before the step "Obtaining Virtual Support Models", the method may include:
[0043] Obtain the first virtual cuboid model and the second virtual cuboid model;
[0044] The first virtual cuboid model is cut using the second virtual cuboid model to obtain a virtual polygon model.
[0045] For example, please see Figure 3 Artists can create a first virtual cuboid model, then randomly select a vertex from this model and move a second virtual cuboid model to that vertex's position. Next, Boolean calculations are performed on both the first and second virtual cuboid models to obtain a virtual polygon model. All parameters in this step can be randomly set, such as the length, width, and height of the first and second virtual cuboid models, and the random vertex number.
[0046] For further details, please refer to Figure 4 Artists can create a first virtual cuboid model, and then set a second virtual cuboid model on each side of the first virtual cuboid model. By using multiple second virtual cuboid models to perform Boolean calculations on the first virtual cuboid model, a more complex virtual polygon model can be obtained.
[0047] Optionally, to obtain a virtual model with a smoother surface, after the step of "cutting the first virtual cuboid model using the second virtual cuboid model to obtain a virtual polygon model", the method may include:
[0048] Each vertex of the virtual polygon model is cut to obtain a virtual support model.
[0049] For example, please see Figure 5 To make the virtual polygon model smoother and more natural, and to make its shape more organic, each vertex of the virtual polygon model can be cut. That is, a plane is used to cut off the part of the vertex at each vertex, and the part of the model corresponding to the vertex is removed, thus obtaining the virtual model.
[0050] In one specific embodiment, to expedite the generation of the virtual city wall model, after the step "obtaining the virtual support model," the method may include:
[0051] A virtual composite model is obtained by arranging multiple virtual support models sequentially along the same direction.
[0052] Furthermore, the method for the step "arranging multiple virtual support models sequentially along the same direction to obtain a virtual composite model" may include:
[0053] Obtain a preset arrangement of lines, wherein a specified number of third reference points are provided on the preset arrangement of lines;
[0054] Obtain a specified number of virtual supports, wherein all virtual supports in the specified number of virtual supports have the same width;
[0055] Based on the positions of the third reference points on the preset arrangement lines, the virtual supports of the specified number of virtual supports are arranged on the preset arrangement lines to obtain a virtual combination model.
[0056] For details, please refer to Figure 6 Artists can define a vertical line as a preset arrangement line. The number of third reference points on this preset line corresponds to the number of virtual supports set vertically. Each virtual support can then be copied to its corresponding third reference point. During the copying process, artists can also set random values for some control parameters, ultimately creating five different virtual supports. Afterward, based on the height of the bounding box of each virtual support, calculations can be performed to stack all virtual supports together at zero distance, forming a vertically arranged virtual composite model.
[0057] 102. Obtain the shape trend of the virtual city wall model, wherein the shape trend is used to reflect the city wall structure of the virtual city wall model and the arrangement direction of the multiple virtual supports constituting the virtual city wall model.
[0058] Furthermore, in order to arrange and combine the virtual combination model in a regular manner, the method may include the following before the step of "obtaining the model arrangement lines":
[0059] Get custom lines;
[0060] The defined lines are divided to set multiple first reference points at specified intervals on the model arrangement lines, thereby obtaining the model arrangement lines, wherein the specified interval value is the width of the virtual model.
[0061] For details, please refer to Figure 7 Artists can randomly draw a horizontal curve in 3D modeling software as a custom line. The shape of this custom line is freely determined by the artist and serves as the shape and trend of the subsequent virtual city wall. Afterward, the artist can subdivide this custom line based on distance to set multiple first reference points at specified intervals along the model's lines. The subdivision distance is set to be approximately the length of the previously defined virtual support model.
[0062] In one specific embodiment, the method for the step "obtaining the morphological trend of the virtual city wall model, wherein the morphological trend is used to reflect the city wall structure of the virtual city wall model and the arrangement direction of the multiple virtual supports constituting the virtual city wall model" may include:
[0063] Obtain model arrangement lines, wherein the model arrangement lines represent the shape and trend of the virtual city wall, and multiple first reference points are distributed at intervals on the model arrangement lines, each first reference point being used to indicate the arrangement position of a virtual composite model on the model arrangement lines.
[0064] 103. Arrange the virtual support model along the shape and trend of the virtual city wall model to construct the virtual city wall model through the virtual support model.
[0065] To obtain a virtual city wall model with a target shape and trend, the step of "arranging the virtual support models along the shape and trend of the virtual city wall model to construct the virtual city wall model through the virtual support models" may include:
[0066] Based on the positions of the first reference points on the model arrangement lines, the virtual combination models among the multiple virtual combination models are arranged on the model arrangement lines to obtain a virtual city wall model.
[0067] In this embodiment, multiple virtual composite models can be copied to each first reference point. During the copying operation, some parameters of the virtual composite models are randomized, resulting in various "vertical rows" of different shapes. These vertical rows, when combined, form a relatively organic wall shape. For example, please refer to... Figure 8 A virtual city wall model is obtained by copying each virtual composite model from multiple virtual composite models to each first reference point.
[0068] To generate a virtual city wall model that meets the actual needs of artists, after the step "based on the setting positions of each first reference point on the model arrangement lines, arrange each virtual combination model from multiple virtual combination models on the model arrangement lines to obtain a virtual city wall model", the method may include:
[0069] In response to an adjustment command for the model arrangement lines, the adjusted setting position of each first reference point on the model arrangement lines is determined;
[0070] The virtual city wall model is updated based on the adjusted settings of each of the first reference points to obtain the updated virtual city wall model.
[0071] To add other virtual models to the virtual city wall model and make it more consistent with the shape of a real city wall, after the step "arranging the virtual combination models from multiple virtual combination models on the model arrangement lines based on the setting positions of the first reference points on the model arrangement lines to obtain the virtual city wall model", the method further includes:
[0072] In response to the instruction to set the doorway of the virtual city wall model, the virtual doorway model is obtained, and the setting position of the virtual doorway model is aligned with the target position in the shape and trend of the virtual city wall model. The virtual city wall model is then processed based on the virtual doorway model and the target position to obtain the processed virtual city wall model.
[0073] A virtual city wall model containing the virtual doorway model is generated based on the processed virtual city wall model, the virtual doorway model, and the target location.
[0074] Specifically, prior to the step "in response to the instruction to set a doorway for the virtual city wall model", the method may include:
[0075] The model arrangement lines are divided to set multiple second reference points on the model arrangement lines;
[0076] In response to the reference point determination command, a target second reference point is determined from the plurality of second reference points;
[0077] The target second reference point is taken as the target position of the trend.
[0078] Furthermore, the step "in response to the instruction to set the doorway of the virtual city wall model, obtaining the virtual doorway model, and aligning the setting position of the virtual doorway model with the target position in the shape and trend of the virtual city wall model, so as to process the virtual city wall model based on the virtual doorway model and the target position to obtain the processed virtual city wall model" can include:
[0079] In response to the instruction to set the doorway for the virtual city wall model, the virtual doorway model is obtained, and the virtual city wall model is processed based on the virtual doorway model and the target second reference point to obtain the processed virtual city wall model.
[0080] The method for generating a virtual city wall model including the virtual doorway model based on the processed virtual city wall model, the virtual doorway model, and the target location may include:
[0081] A virtual city wall model containing the virtual doorway model is generated based on the processed virtual city wall model, the virtual doorway model, and the target second reference point.
[0082] Specifically, the step "in response to the instruction to set the doorway for the virtual city wall model, obtain the virtual doorway model, and process the virtual city wall model based on the virtual doorway model and the target second reference point to obtain the processed virtual city wall model" can include:
[0083] Obtain the virtual cube model corresponding to the virtual doorway model;
[0084] Based on the setting position of the target second reference point on the model arrangement lines, the virtual cube model is used to generate doorways on the virtual city wall model to obtain the processed virtual city wall model; wherein, the center point of the model edge where the virtual doorway model coincides with the model arrangement lines coincides with the target second reference point;
[0085] The step of generating a virtual city wall model containing the virtual doorway model based on the processed virtual city wall model, the virtual doorway model, and the target second reference point includes:
[0086] Based on the setting position of the target second reference point on the model arrangement lines, the virtual doorway model is arranged on the model arrangement lines to obtain the arranged virtual doorway model;
[0087] Based on the arranged virtual doorway model and the processed virtual city wall model, a virtual city wall model containing the virtual doorway model is generated.
[0088] The virtual cube model can be a regular cube, such as a cuboid, cube, cylinder, or sphere; it can also be an irregular cube.
[0089] For example, please see Figure 9 The virtual cube model is used to generate doorways on the virtual city wall model, resulting in the processed virtual city wall model. For example, please refer to... Figure 10 The virtual doorway models are arranged on the model arrangement lines. Based on the arranged virtual doorway models and the processed virtual city wall models, a virtual city wall model containing the virtual doorway models is generated, which is the target virtual city wall model.
[0090] Specifically, artists can further subdivide the model's lines, allowing for a sufficient number of subdivisions. For example, the second reference points on the model's lines can be numbered sequentially starting from 0, used to control the movement of the virtual doorway model. Then, a cylindrical virtual model object is copied to one of the second reference points on the model's lines to create the doorway. The specific point to copy to can be determined by adjusting parameters, which control the doorway's movement along the model's lines. Next, a Boolean operation is performed between the cylindrical object and the target virtual model to create the hole. Afterward, artists can extrude the model's lines upward to form a curved surface, then perform a Boolean operation between the curved surface and the cylindrical virtual model object to obtain a line at their intersection, which is then further subdivided. Finally, a pre-defined fan-shaped virtual model is copied to the points obtained from the subdivided line to form the virtual doorway model. Finally, based on the arranged virtual doorway model and the processed target virtual model, a target virtual model for setting the doorway is generated. The target virtual model for setting the doorway is then tidied up, for example, by recalculating the surface normals and topology, to form the final shape.
[0091] To enable artists to adjust the placement of the virtual doorway model on the target virtual model according to actual needs, after the step "generating a virtual city wall model containing the virtual doorway model based on the processed virtual city wall model, the virtual doorway model, and the target second reference point," the method may include:
[0092] In response to a position adjustment command for the virtual doorway model, the adjusted position of the virtual doorway model on the model arrangement lines is determined;
[0093] The virtual city wall model containing the virtual doorway model is updated based on the adjusted position of the virtual doorway model to obtain the updated virtual city wall model.
[0094] To further illustrate the method for generating virtual city wall models provided in this application embodiment, the following will take the application of the method for generating virtual city wall models in a specific implementation scenario as an example. The specific application scenario is as follows.
[0095] (1) Artists can create a first virtual cuboid model. Then, on each edge of the first virtual cuboid model, a second virtual cuboid model is set. Boolean calculations are performed on the first virtual cuboid model using multiple second virtual cuboid models to obtain a more complex virtual polygon model. Various parameters in this step can be set randomly, such as the length, width, and height of the first virtual cuboid model, the length, width, and height of the second virtual cuboid model, and the random vertex numbers.
[0096] (2) In order to make the virtual polygon model smoother and more natural, and to make the shape more organic, each vertex of the virtual polygon model can be cut. That is, a plane is used to cut the part where the vertex is located at each vertex, and the vertex part of the model is removed to obtain the virtual model.
[0097] (3) Artists can define a vertical line as a preset arrangement line. The number of third reference points on this preset arrangement line is equal to the number of virtual models set in the vertical direction. Then, the virtual models are copied to the corresponding third reference points. During the copying operation, artists can also set random values for some control parameters, ultimately forming 5 different virtual models. Afterward, based on the height of the bounding box of each virtual model, all virtual models are stacked together at zero distance to form a row of vertically arranged virtual composite models.
[0098] (4) Artists can randomly draw a curve along the horizontal direction in the 3D modeling software as a custom line. The shape of this custom line can be freely determined by the artist and will serve as the shape and trend of the subsequent virtual city wall. Afterwards, the artist can subdivide this custom line based on distance to set multiple first reference points at specified intervals on the model's line arrangement. The subdivision distance is set to be approximately the length of the previously defined virtual model.
[0099] (5) The computer device can arrange each virtual combination model among the multiple virtual combination models on the model arrangement lines based on the set positions of each first reference point on the model arrangement lines to obtain the target virtual model. Specifically, the artist copies each virtual combination model among the multiple virtual combination models to each first reference point. During the copying operation, some parameters of the virtual combination models are randomized to form various different forms of "vertical rows". These vertical rows are combined to form a relatively organic city wall shape, thus obtaining the target virtual model.
[0100] (6) When the computer device responds to the adjustment instruction for the model arrangement lines, it determines the adjusted setting position of each first reference point on the model arrangement lines; then, it updates the target virtual model based on the adjusted setting position of each first reference point to obtain the updated target virtual model.
[0101] (7) Alternatively, the artists can further subdivide the model's lines, making a sufficient number of subdivisions. For example, the second reference points on the model's lines can be numbered sequentially starting from 0, used to control the movement of the virtual doorway model. Then, a cylindrical virtual model object is copied to one of the second reference points on the model's lines to create the doorway. The artist can determine the specific second reference point by adjusting parameters, which allows control of the doorway's movement on the model's lines. Next, a Boolean operation is performed between the cylindrical object and the target virtual model to create the hole. Afterward, the artist can extrude the model's lines upward to form a curved surface, and then perform a Boolean operation between the curved surface and the cylindrical virtual model object to obtain a line at their intersection, which is then subdivided. Finally, a pre-defined fan-shaped virtual model is copied to the point obtained after subdividing the line, forming the virtual doorway model. Finally, based on the arranged virtual doorway model and the processed target virtual model, a target virtual model for setting the doorway is generated. The target virtual model for setting the doorway is then tidied up, for example, by recalculating the surface normals and topology, to form the final shape.
[0102] (8) Further, the computer device can, in response to a position adjustment command for the virtual doorway model, determine the adjusted position of the virtual doorway model on the model arrangement lines. Then, based on the adjusted position of the virtual doorway model, the target virtual model for setting the doorway is updated to obtain an updated target virtual model.
[0103] In summary, this application provides a method for generating a virtual city wall model. The method involves obtaining a virtual support model, which is used to construct the virtual city wall model. Next, the shape and trend of the virtual city wall model are obtained, reflecting the wall structure and the arrangement direction of the multiple virtual supports constituting the virtual city wall model. Finally, the virtual support models are arranged along the shape and trend of the virtual city wall model to construct the virtual city wall model. This application provides an adjustable virtual city wall model by arranging multiple virtual combination models on model arrangement lines. Game developers can adjust the virtual city wall model according to specific needs to obtain a virtual city wall model that meets their requirements. This allows for the rapid generation of various virtual city wall models, improving the reusability and production efficiency of virtual city wall models.
[0104] To facilitate better implementation of the method for generating virtual city wall models provided in this application, this application also provides an apparatus for generating virtual city wall models based on the above-described method. The meanings of the terms used are the same as in the method for generating virtual city wall models described above, and specific implementation details can be found in the descriptions in the method embodiments.
[0105] Please see Figure 11 , Figure 11 This application provides a schematic diagram of a device for generating a virtual city wall model, the device comprising:
[0106] The first acquisition unit 201 is used to acquire a virtual support model, wherein the virtual support model is used to construct a virtual city wall model;
[0107] The second acquisition unit 202 is used to acquire the shape trend of the virtual city wall model, wherein the shape trend is used to reflect the city wall structure of the virtual city wall model and the arrangement direction of the multiple virtual supports constituting the virtual city wall model.
[0108] Arrangement unit 203 is used to arrange the virtual support model along the shape and trend of the virtual city wall model, so as to construct the virtual city wall model through the virtual support model.
[0109] In some embodiments, the device for generating a virtual city wall model includes:
[0110] The first setting sub-unit is used to arrange multiple virtual support models sequentially along the same direction to obtain a virtual combined model.
[0111] In some embodiments, the device for generating a virtual city wall model includes:
[0112] The first acquisition subunit is used to acquire a preset arrangement of lines, wherein a specified number of third reference points are provided on the preset arrangement of lines;
[0113] The first acquisition subunit is further configured to acquire a specified number of virtual supports, wherein the width of each virtual support in the specified number of virtual supports is the same;
[0114] The first arrangement subunit is used to arrange each virtual support body among the specified number of virtual supports on the preset arrangement line based on the setting position of each third reference point on the preset arrangement line, so as to obtain a virtual combination model.
[0115] In some embodiments, the device for generating a virtual city wall model includes:
[0116] The second acquisition subunit is used to acquire model arrangement lines, wherein the model arrangement lines represent the shape and trend of the virtual city wall, and multiple first reference points are distributed at intervals on the model arrangement lines, each first reference point being used to indicate the arrangement position of a virtual combined model on the model arrangement lines.
[0117] In some embodiments, the device for generating a virtual city wall model includes:
[0118] The second arrangement subunit is used to arrange each virtual combination model in the multiple virtual combination models on the model arrangement lines based on the setting position of each first reference point on the model arrangement lines, so as to obtain a virtual city wall model.
[0119] In some embodiments, the device for generating a virtual city wall model includes:
[0120] The first processing subunit is configured to respond to the instruction for setting the doorway of the virtual city wall model, obtain the virtual doorway model, and make the setting position of the virtual doorway model coincide with the target position in the shape trend of the virtual city wall model, so as to process the virtual city wall model based on the virtual doorway model and the target position to obtain the processed virtual city wall model.
[0121] The first generation subunit is used to generate a virtual city wall model containing the virtual doorway model based on the processed virtual city wall model, the virtual doorway model, and the target location.
[0122] In some embodiments, the device for generating a virtual city wall model includes:
[0123] The second processing subunit is used to divide the model arrangement lines to set multiple second reference points on the model arrangement lines;
[0124] The first determining subunit is configured to determine a target second reference point from the plurality of second reference points in response to a reference point determining instruction;
[0125] The second setting subunit is used to set the target second reference point as the target position of the morphological trend.
[0126] In some embodiments, the device for generating a virtual city wall model includes:
[0127] The third processing subunit is used to respond to the doorway setting instruction for the virtual city wall model, obtain the virtual doorway model, and process the virtual city wall model based on the virtual doorway model and the target second reference point to obtain the processed virtual city wall model.
[0128] In some embodiments, the device for generating a virtual city wall model includes:
[0129] The second generation subunit is used to generate a virtual city wall model containing the virtual doorway model based on the processed virtual city wall model, the virtual doorway model, and the target second reference point.
[0130] In some embodiments, the device for generating a virtual city wall model includes:
[0131] The third acquisition subunit is used to acquire the virtual cube model corresponding to the virtual doorway model;
[0132] The fourth processing subunit is used to generate a doorway on the virtual city wall model using the virtual cube model based on the setting position of the target second reference point on the model arrangement lines, so as to obtain the processed virtual city wall model; wherein, the center point of the model edge that coincides with the model arrangement lines of the virtual doorway model coincides with the target second reference point.
[0133] In some embodiments, the device for generating a virtual city wall model includes:
[0134] The third arrangement subunit is used to arrange the virtual doorway model on the model arrangement line based on the setting position of the target second reference point on the model arrangement line, so as to obtain the arranged virtual doorway model;
[0135] The third generation subunit is used to generate a virtual city wall model containing the virtual doorway model based on the arranged virtual doorway model and the processed virtual city wall model.
[0136] In some embodiments, the device for generating a virtual city wall model includes:
[0137] The second determining subunit is used to determine the adjusted position of the virtual doorway model on the model arrangement lines in response to the position adjustment command for the virtual doorway model;
[0138] The fifth processing subunit is used to update the virtual city wall model containing the virtual doorway model based on the adjusted position of the virtual doorway model, so as to obtain the updated virtual city wall model.
[0139] In some embodiments, the device for generating a virtual city wall model includes:
[0140] The third determining subunit is used to determine the adjusted setting position of each first reference point on the model arrangement lines in response to the adjustment command for the model arrangement lines.
[0141] The update subunit is used to update the virtual city wall model based on the adjusted setting positions of each of the first reference points, so as to obtain the updated virtual city wall model.
[0142] In some embodiments, the device for generating a virtual city wall model includes:
[0143] The fourth acquisition subunit is used to acquire the first virtual cuboid model and the second virtual cuboid model;
[0144] The sixth processing subunit is used to cut the first virtual cuboid model using the second virtual cuboid model to obtain a virtual polygon model;
[0145] In some embodiments, the device for generating a virtual city wall model includes:
[0146] The seventh processing subunit is used to cut each vertex of the virtual polygon model to obtain a virtual support model.
[0147] This application provides a device for generating virtual city wall models. A first acquisition unit 201 acquires virtual support models, which are used to construct virtual city wall models. A second acquisition unit 202 acquires the shape and trend of the virtual city wall model, which reflects the wall structure and the arrangement direction of the multiple virtual supports constituting the virtual city wall model. An arrangement unit 203 arranges the virtual support models along the shape and trend of the virtual city wall model to construct the virtual city wall model. This application provides an adjustable virtual city wall model by arranging multiple virtual combination models on model arrangement lines. Game developers can adjust the virtual city wall model according to specific needs to obtain a virtual city wall model that meets their requirements, thereby quickly generating various virtual city wall models, improving the reusability and production efficiency of virtual city wall models.
[0148] Accordingly, this application also provides a computer device, which can be a terminal or a server. The terminal can be a smartphone, tablet computer, laptop computer, touch screen, game console, personal computer (PC), personal digital assistant (PDA), or other terminal device. Figure 12 As shown, Figure 12 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device 300 includes a processor 301 with one or more processing cores, a memory 302 with one or more storage media, and a computer program stored in the memory 302 and executable on the processor. The processor 301 and the memory 302 are electrically connected. Those skilled in the art will understand that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0149] The processor 301 is the control center of the computer device 300. It connects various parts of the computer device 300 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, it performs various functions of the computer device 300 and processes data, thereby monitoring the computer device 300 as a whole.
[0150] In this embodiment, the processor 301 in the computer device 300 loads the instructions corresponding to the processes of one or more applications into the memory 302 according to the following steps, and the processor 301 runs the applications stored in the memory 302 to achieve various functions:
[0151] Obtain a virtual support model, wherein the virtual support model is used to construct a virtual city wall model;
[0152] The shape trend of the virtual city wall model is obtained, wherein the shape trend is used to reflect the city wall structure of the virtual city wall model and the arrangement direction of the multiple virtual supports constituting the virtual city wall model;
[0153] The virtual support model is arranged along the shape and trend of the virtual city wall model to construct the virtual city wall model.
[0154] In one embodiment, after obtaining the virtual support model, the method further includes:
[0155] A virtual composite model is obtained by arranging multiple virtual support models sequentially along the same direction.
[0156] In one embodiment, arranging multiple virtual support models sequentially along the same direction to obtain a virtual composite model includes:
[0157] Obtain a preset arrangement of lines, wherein a specified number of third reference points are provided on the preset arrangement of lines;
[0158] Obtain a specified number of virtual supports, wherein all virtual supports in the specified number of virtual supports have the same width;
[0159] Based on the positions of the third reference points on the preset arrangement lines, the virtual supports of the specified number of virtual supports are arranged on the preset arrangement lines to obtain a virtual combination model.
[0160] In one embodiment, obtaining the morphological trend of the virtual city wall model, wherein the morphological trend is used to reflect the city wall structure of the virtual city wall model and the arrangement direction of the multiple virtual supports constituting the virtual city wall model, includes:
[0161] Obtain model arrangement lines, wherein the model arrangement lines represent the shape and trend of the virtual city wall, and multiple first reference points are distributed at intervals on the model arrangement lines, each first reference point being used to indicate the arrangement position of a virtual composite model on the model arrangement lines.
[0162] In one embodiment, arranging the virtual support model along the shape and trend of the virtual city wall model to construct the virtual city wall model using the virtual support model includes:
[0163] Based on the positions of the first reference points on the model arrangement lines, the virtual combination models among the multiple virtual combination models are arranged on the model arrangement lines to obtain a virtual city wall model.
[0164] In one embodiment, after arranging each virtual composite model among multiple virtual composite models on the model arrangement lines based on the setting positions of each first reference point on the model arrangement lines to obtain a virtual city wall model, the method further includes:
[0165] In response to the instruction to set the doorway of the virtual city wall model, the virtual doorway model is obtained, and the setting position of the virtual doorway model is aligned with the target position in the shape and trend of the virtual city wall model. The virtual city wall model is then processed based on the virtual doorway model and the target position to obtain the processed virtual city wall model.
[0166] A virtual city wall model containing the virtual doorway model is generated based on the processed virtual city wall model, the virtual doorway model, and the target location.
[0167] In one embodiment, prior to responding to a doorway setting instruction for the virtual city wall model, the method further includes:
[0168] The model arrangement lines are divided to set multiple second reference points on the model arrangement lines;
[0169] In response to the reference point determination command, a target second reference point is determined from the plurality of second reference points;
[0170] The target second reference point is taken as the target position of the trend.
[0171] In one embodiment, the step of responding to a doorway setting command for the virtual city wall model, acquiring a virtual doorway model, and aligning the setting position of the virtual doorway model with a target position in the shape and trend of the virtual city wall model, and processing the virtual city wall model based on the virtual doorway model and the target position to obtain a processed virtual city wall model, includes:
[0172] In response to the instruction to set the doorway for the virtual city wall model, the virtual doorway model is obtained, and the virtual city wall model is processed based on the virtual doorway model and the target second reference point to obtain the processed virtual city wall model.
[0173] The step of generating a virtual city wall model containing the virtual doorway model based on the processed virtual city wall model, the virtual doorway model, and the target location includes:
[0174] A virtual city wall model containing the virtual doorway model is generated based on the processed virtual city wall model, the virtual doorway model, and the target second reference point.
[0175] In one embodiment, the step of obtaining a virtual doorway model in response to a doorway setting command for the virtual city wall model, and processing the virtual city wall model based on the virtual doorway model and the target second reference point to obtain a processed virtual city wall model, includes:
[0176] Obtain the virtual cube model corresponding to the virtual doorway model;
[0177] Based on the setting position of the target second reference point on the model arrangement lines, the virtual cube model is used to generate doorways on the virtual city wall model to obtain the processed virtual city wall model; wherein, the center point of the model edge where the virtual doorway model coincides with the model arrangement lines coincides with the target second reference point;
[0178] The step of generating a virtual city wall model containing the virtual doorway model based on the processed virtual city wall model, the virtual doorway model, and the target second reference point includes:
[0179] Based on the setting position of the target second reference point on the model arrangement lines, the virtual doorway model is arranged on the model arrangement lines to obtain the arranged virtual doorway model;
[0180] Based on the arranged virtual doorway model and the processed virtual city wall model, a virtual city wall model containing the virtual doorway model is generated.
[0181] In one embodiment, after generating a virtual city wall model including the virtual doorway model based on the processed virtual city wall model, the virtual doorway model, and the target second reference point, the method further includes:
[0182] In response to a position adjustment command for the virtual doorway model, the adjusted position of the virtual doorway model on the model arrangement lines is determined;
[0183] The virtual city wall model containing the virtual doorway model is updated based on the adjusted position of the virtual doorway model to obtain the updated virtual city wall model.
[0184] In one embodiment, after arranging each virtual combined model among multiple virtual combined models on the model arrangement lines based on the setting positions of each first reference point on the model arrangement lines to obtain a virtual city wall model, the method further includes:
[0185] In response to an adjustment command for the model arrangement lines, the adjusted setting position of each first reference point on the model arrangement lines is determined;
[0186] The virtual city wall model is updated based on the adjusted settings of each of the first reference points to obtain the updated virtual city wall model.
[0187] In one embodiment, before obtaining the virtual support model, the method further includes:
[0188] Obtain the first virtual cuboid model and the second virtual cuboid model;
[0189] The first virtual cuboid model is cut using the second virtual cuboid model to obtain a virtual polygon model;
[0190] After cutting the first virtual cuboid model using the second virtual cuboid model to obtain a virtual polygon model, the process further includes:
[0191] Each vertex of the virtual polygon model is cut to obtain a virtual support model.
[0192] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0193] Optional, such as Figure 12 As shown, the computer device 300 also includes: a touch screen display 303, a radio frequency circuit 304, an audio circuit 305, an input unit 306, and a power supply 307. The processor 301 is electrically connected to the touch screen display 303, the radio frequency circuit 304, the audio circuit 305, the input unit 306, and the power supply 307. Those skilled in the art will understand that... Figure 12 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0194] The touch display screen 303 can be used to display a graphical player interface (GUI) and receive operation commands generated by the player interacting with the GUI. The touch display screen 303 may include a display panel and a touch panel. The display panel can be used to display information input by the player or information provided to the player, as well as various GUIs of the computer device. These GUIs can be composed of graphics, text, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar technologies. The touch panel can be used to collect touch operations performed by the player on or near it (such as operations performed by the player using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program according to the operation commands. Optionally, the touch panel may include a touch detection device and a touch controller. The touch detection device detects the player's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 301. It can also receive and execute commands from the processor 301. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 301 to determine the type of touch event. Subsequently, the processor 301 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into the touch display screen 303 to achieve input and output functions. However, in some embodiments, the touch panel and the touch display screen 303 can be implemented as two independent components to achieve input and output functions. That is, the touch display screen 303 can also be used as part of the input unit 306 to achieve input functions.
[0195] In this embodiment, a game application is executed by processor 301 to generate a graphical player interface on touch display screen 303. The touch display screen 303 is used to present the graphical player interface and receive operation commands generated by the player interacting with it.
[0196] The radio frequency circuit 304 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other computer devices, and to transmit and receive signals with network devices or other computer devices.
[0197] Audio circuitry 305 can be used to provide an audio interface between the player and the computer device via a speaker and a microphone. Audio circuitry 305 converts received audio data into electrical signals, transmits them to the speaker, and the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 305, converted back into audio data, and then processed by processor 301 before being transmitted via radio frequency circuitry 304 to, for example, another computer device, or output to memory 302 for further processing. Audio circuitry 305 may also include an earphone jack to facilitate communication between peripheral headphones and the computer device.
[0198] The input unit 306 can be used to receive input numbers, characters, or player characteristic information (such as fingerprints, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to player settings and function control.
[0199] Power supply 307 is used to supply power to various components of computer device 300. Optionally, power supply 307 can be logically connected to processor 301 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 307 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0200] although Figure 12 As not shown in the diagram, the computer device 300 may also include a camera, sensor, wireless fidelity module, Bluetooth module, etc., which will not be described in detail here.
[0201] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0202] As can be seen from the above, the computer device provided in this embodiment acquires a virtual support model, wherein the virtual support model is used to construct a virtual city wall model; then, it acquires the shape trend of the virtual city wall model, wherein the shape trend is used to reflect the city wall structure of the virtual city wall model and the arrangement direction of the multiple virtual supports constituting the virtual city wall model; finally, it arranges the virtual support model along the shape trend of the virtual city wall model to construct the virtual city wall model. This embodiment of the application obtains an adjustable virtual city wall model by arranging multiple virtual combination models on model arrangement lines. Game developers can adjust the virtual city wall model according to specific needs to obtain a virtual city wall model that meets the requirements, thereby quickly generating various virtual city wall models, improving the reusability of virtual city wall models, and increasing the production efficiency of virtual city wall models.
[0203] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0204] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of computer programs that can be loaded by a processor to execute the steps in any of the methods for generating virtual city wall models provided in embodiments of this application. For example, the computer program can execute the following steps:
[0205] Obtain a virtual support model, wherein the virtual support model is used to construct a virtual city wall model;
[0206] The shape trend of the virtual city wall model is obtained, wherein the shape trend is used to reflect the city wall structure of the virtual city wall model and the arrangement direction of the multiple virtual supports constituting the virtual city wall model;
[0207] The virtual support model is arranged along the shape and trend of the virtual city wall model to construct the virtual city wall model.
[0208] In one embodiment, after obtaining the virtual support model, the method further includes:
[0209] A virtual composite model is obtained by arranging multiple virtual support models sequentially along the same direction.
[0210] In one embodiment, arranging multiple virtual support models sequentially along the same direction to obtain a virtual composite model includes:
[0211] Obtain a preset arrangement of lines, wherein a specified number of third reference points are provided on the preset arrangement of lines;
[0212] Obtain a specified number of virtual supports, wherein all virtual supports in the specified number of virtual supports have the same width;
[0213] Based on the positions of the third reference points on the preset arrangement lines, the virtual supports of the specified number of virtual supports are arranged on the preset arrangement lines to obtain a virtual combination model.
[0214] In one embodiment, obtaining the morphological trend of the virtual city wall model, wherein the morphological trend is used to reflect the city wall structure of the virtual city wall model and the arrangement direction of the multiple virtual supports constituting the virtual city wall model, includes:
[0215] Obtain model arrangement lines, wherein the model arrangement lines represent the shape and trend of the virtual city wall, and multiple first reference points are distributed at intervals on the model arrangement lines, each first reference point being used to indicate the arrangement position of a virtual composite model on the model arrangement lines.
[0216] In one embodiment, arranging the virtual support model along the shape and trend of the virtual city wall model to construct the virtual city wall model using the virtual support model includes:
[0217] Based on the positions of the first reference points on the model arrangement lines, the virtual combination models among the multiple virtual combination models are arranged on the model arrangement lines to obtain a virtual city wall model.
[0218] In one embodiment, after arranging each virtual composite model among multiple virtual composite models on the model arrangement lines based on the setting positions of each first reference point on the model arrangement lines to obtain a virtual city wall model, the method further includes:
[0219] In response to the instruction to set the doorway of the virtual city wall model, the virtual doorway model is obtained, and the setting position of the virtual doorway model is aligned with the target position in the shape and trend of the virtual city wall model. The virtual city wall model is then processed based on the virtual doorway model and the target position to obtain the processed virtual city wall model.
[0220] A virtual city wall model containing the virtual doorway model is generated based on the processed virtual city wall model, the virtual doorway model, and the target location.
[0221] In one embodiment, prior to responding to a doorway setting instruction for the virtual city wall model, the method further includes:
[0222] The model arrangement lines are divided to set multiple second reference points on the model arrangement lines;
[0223] In response to the reference point determination command, a target second reference point is determined from the plurality of second reference points;
[0224] The target second reference point is taken as the target position of the trend.
[0225] In one embodiment, the step of responding to a doorway setting command for the virtual city wall model, acquiring a virtual doorway model, and aligning the setting position of the virtual doorway model with a target position in the shape and trend of the virtual city wall model, and processing the virtual city wall model based on the virtual doorway model and the target position to obtain a processed virtual city wall model, includes:
[0226] In response to the instruction to set the doorway for the virtual city wall model, the virtual doorway model is obtained, and the virtual city wall model is processed based on the virtual doorway model and the target second reference point to obtain the processed virtual city wall model.
[0227] The step of generating a virtual city wall model containing the virtual doorway model based on the processed virtual city wall model, the virtual doorway model, and the target location includes:
[0228] A virtual city wall model containing the virtual doorway model is generated based on the processed virtual city wall model, the virtual doorway model, and the target second reference point.
[0229] In one embodiment, the step of obtaining a virtual doorway model in response to a doorway setting command for the virtual city wall model, and processing the virtual city wall model based on the virtual doorway model and the target second reference point to obtain a processed virtual city wall model, includes:
[0230] Obtain the virtual cube model corresponding to the virtual doorway model;
[0231] Based on the setting position of the target second reference point on the model arrangement lines, the virtual cube model is used to generate doorways on the virtual city wall model to obtain the processed virtual city wall model; wherein, the center point of the model edge where the virtual doorway model coincides with the model arrangement lines coincides with the target second reference point;
[0232] The step of generating a virtual city wall model containing the virtual doorway model based on the processed virtual city wall model, the virtual doorway model, and the target second reference point includes:
[0233] Based on the setting position of the target second reference point on the model arrangement lines, the virtual doorway model is arranged on the model arrangement lines to obtain the arranged virtual doorway model;
[0234] Based on the arranged virtual doorway model and the processed virtual city wall model, a virtual city wall model containing the virtual doorway model is generated.
[0235] In one embodiment, after generating a virtual city wall model including the virtual doorway model based on the processed virtual city wall model, the virtual doorway model, and the target second reference point, the method further includes:
[0236] In response to a position adjustment command for the virtual doorway model, the adjusted position of the virtual doorway model on the model arrangement lines is determined;
[0237] The virtual city wall model containing the virtual doorway model is updated based on the adjusted position of the virtual doorway model to obtain the updated virtual city wall model.
[0238] In one embodiment, after arranging each virtual combined model among multiple virtual combined models on the model arrangement lines based on the setting positions of each first reference point on the model arrangement lines to obtain a virtual city wall model, the method further includes:
[0239] In response to an adjustment command for the model arrangement lines, the adjusted setting position of each first reference point on the model arrangement lines is determined;
[0240] The virtual city wall model is updated based on the adjusted settings of each of the first reference points to obtain the updated virtual city wall model.
[0241] In one embodiment, before obtaining the virtual support model, the method further includes:
[0242] Obtain the first virtual cuboid model and the second virtual cuboid model;
[0243] The first virtual cuboid model is cut using the second virtual cuboid model to obtain a virtual polygon model;
[0244] After cutting the first virtual cuboid model using the second virtual cuboid model to obtain a virtual polygon model, the process further includes:
[0245] Each vertex of the virtual polygon model is cut to obtain a virtual support model.
[0246] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0247] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0248] The computer program stored in this storage medium acquires a virtual support model, which is used to construct a virtual city wall model. Next, it acquires the shape and trend of the virtual city wall model, which reflects the wall structure and the arrangement direction of the multiple virtual supports constituting the virtual city wall model. Finally, it arranges the virtual support models along the shape and trend of the virtual city wall model to construct the virtual city wall model. This embodiment of the application obtains an adjustable virtual city wall model by arranging multiple virtual combination models on model arrangement lines. Game developers can adjust the virtual city wall model according to specific needs to obtain a virtual city wall model that meets the requirements, thereby quickly generating various virtual city wall models, improving the reusability and production efficiency of virtual city wall models. In the above embodiments, the descriptions of each embodiment have different focuses; parts not described in detail in a certain embodiment can be referred to in the relevant descriptions of other embodiments.
[0249] The foregoing has provided a detailed description of a method, apparatus, computer device, and storage medium for generating a virtual city wall model according to the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the technical solutions and core ideas of this application. Those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for generating a virtual city wall model, characterized in that, include: Obtain a virtual support model, wherein the virtual support model is used to construct a virtual city wall model; The shape trend of the virtual city wall model is obtained, wherein the shape trend is used to reflect the city wall structure of the virtual city wall model and the arrangement direction of the multiple virtual supports constituting the virtual city wall model; The virtual support model is arranged along the shape and trend of the virtual city wall model to construct the virtual city wall model through the virtual support model; In response to the instruction to set the doorway of the virtual city wall model, the virtual doorway model is obtained, and the setting position of the virtual doorway model is aligned with the target position in the shape and trend of the virtual city wall model. The virtual city wall model is then processed based on the virtual doorway model and the target position to obtain the processed virtual city wall model. A virtual city wall model containing the virtual doorway model is generated based on the processed virtual city wall model, the virtual doorway model, and the target location.
2. The method for generating a virtual city wall model according to claim 1, characterized in that, After obtaining the virtual support model, the following steps are also included: A virtual composite model is obtained by arranging multiple virtual support models sequentially along the same direction.
3. The method for generating a virtual city wall model according to claim 2, characterized in that, The process of arranging multiple virtual support models sequentially along the same direction to obtain a virtual composite model includes: Obtain a preset arrangement of lines, wherein a specified number of third reference points are provided on the preset arrangement of lines; Obtain a specified number of virtual supports, wherein all virtual supports in the specified number of virtual supports have the same width; Based on the positions of the third reference points on the preset arrangement lines, the virtual supports of the specified number of virtual supports are arranged on the preset arrangement lines to obtain a virtual combination model.
4. The method for generating a virtual city wall model according to claim 2, characterized in that, The step of obtaining the morphological trend of the virtual city wall model, wherein the morphological trend is used to reflect the city wall structure of the virtual city wall model and the arrangement direction of the multiple virtual supports constituting the virtual city wall model, includes: Obtain model arrangement lines, wherein the model arrangement lines represent the shape and trend of the virtual city wall, and multiple first reference points are distributed at intervals on the model arrangement lines, each first reference point being used to indicate the arrangement position of a virtual composite model on the model arrangement lines.
5. The method for generating a virtual city wall model according to claim 4, characterized in that, The step of arranging the virtual support model along the shape and trend of the virtual city wall model to construct the virtual city wall model using the virtual support model includes: Based on the positions of the first reference points on the model arrangement lines, the virtual combination models among the multiple virtual combination models are arranged on the model arrangement lines to obtain a virtual city wall model.
6. The method for generating a virtual city wall model according to claim 1, characterized in that, Prior to responding to the instruction to set a doorway for the virtual city wall model, the method also includes: The model arrangement lines are divided to set multiple second reference points on the model arrangement lines; In response to the reference point determination command, a target second reference point is determined from the plurality of second reference points; The target second reference point is taken as the target position of the trend.
7. The method for generating a virtual city wall model according to claim 6, characterized in that, The step of responding to the instruction to set a doorway for the virtual city wall model, acquiring a virtual doorway model, and aligning the setting position of the virtual doorway model with the target position in the shape and trend of the virtual city wall model, and processing the virtual city wall model based on the virtual doorway model and the target position to obtain a processed virtual city wall model, includes: In response to the instruction to set the doorway for the virtual city wall model, the virtual doorway model is obtained, and the virtual city wall model is processed based on the virtual doorway model and the target second reference point to obtain the processed virtual city wall model. The step of generating a virtual city wall model containing the virtual doorway model based on the processed virtual city wall model, the virtual doorway model, and the target location includes: A virtual city wall model containing the virtual doorway model is generated based on the processed virtual city wall model, the virtual doorway model, and the target second reference point.
8. The method for generating a virtual city wall model according to claim 7, characterized in that, The step of responding to the instruction to set a doorway for the virtual city wall model, acquiring a virtual doorway model, and processing the virtual city wall model based on the virtual doorway model and the target second reference point to obtain a processed virtual city wall model includes: Obtain the virtual cube model corresponding to the virtual doorway model; Based on the setting position of the target second reference point on the model arrangement lines, the virtual cube model is used to generate doorways on the virtual city wall model to obtain the processed virtual city wall model; wherein, the center point of the model edge where the virtual doorway model coincides with the model arrangement lines coincides with the target second reference point; The step of generating a virtual city wall model containing the virtual doorway model based on the processed virtual city wall model, the virtual doorway model, and the target second reference point includes: Based on the setting position of the target second reference point on the model arrangement lines, the virtual doorway model is arranged on the model arrangement lines to obtain the arranged virtual doorway model; Based on the arranged virtual doorway model and the processed virtual city wall model, a virtual city wall model containing the virtual doorway model is generated.
9. The method for generating a virtual city wall model according to claim 8, characterized in that, After generating a virtual city wall model including the virtual doorway model based on the processed virtual city wall model, the virtual doorway model, and the target second reference point, the process further includes: In response to a position adjustment command for the virtual doorway model, the adjusted position of the virtual doorway model on the model arrangement lines is determined; The virtual city wall model containing the virtual doorway model is updated based on the adjusted position of the virtual doorway model to obtain the updated virtual city wall model.
10. The method for generating a virtual city wall model according to claim 5, characterized in that, After arranging each virtual composite model on the model arrangement lines based on the positions of the first reference points on the model arrangement lines to obtain a virtual city wall model, the process further includes: In response to an adjustment command for the model arrangement lines, the adjusted setting position of each first reference point on the model arrangement lines is determined; The virtual city wall model is updated based on the adjusted settings of each of the first reference points to obtain the updated virtual city wall model.
11. The method for generating a virtual city wall model according to claim 1, characterized in that, Before obtaining the virtual support model, the following steps are also included: Obtain the first virtual cuboid model and the second virtual cuboid model; The first virtual cuboid model is cut using the second virtual cuboid model to obtain a virtual polygon model; After cutting the first virtual cuboid model using the second virtual cuboid model to obtain a virtual polygon model, the process further includes: Each vertex of the virtual polygon model is cut to obtain a virtual support model.
12. A device for generating a virtual city wall model, characterized in that, include: The first acquisition unit is used to acquire a virtual support model, wherein the virtual support model is used to construct a virtual city wall model; The second acquisition unit is used to acquire the shape trend of the virtual city wall model, wherein the shape trend is used to reflect the city wall structure of the virtual city wall model and the arrangement direction of the multiple virtual supports constituting the virtual city wall model. An arrangement unit is used to arrange the virtual support model along the shape and trend of the virtual city wall model, so as to construct the virtual city wall model through the virtual support model; The first processing subunit is configured to respond to the instruction for setting the doorway of the virtual city wall model, obtain the virtual doorway model, and make the setting position of the virtual doorway model coincide with the target position in the shape trend of the virtual city wall model, so as to process the virtual city wall model based on the virtual doorway model and the target position to obtain the processed virtual city wall model. The first generation subunit is used to generate a virtual city wall model containing the virtual doorway model based on the processed virtual city wall model, the virtual doorway model, and the target location.
13. A computer device, characterized in that, The computer device includes a memory and a processor. The memory stores a computer program, and the processor executes the method for generating a virtual city wall model as described in any one of claims 1 to 11 by calling the computer program stored in the memory.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted for loading by a processor to perform the method for generating a virtual city wall model as described in any one of claims 1 to 11.