Model generation method and device, computer readable storage medium and electronic device

By creating virtual wall instances and performing vertex offset processing on the basic wall model, the problems of complex, low-efficiency and high-cost wall model generation processes in the existing technology are solved, and adaptation to the terrain undulations of the virtual scene is achieved. Improved effectiveness and efficiency.

CN119327115APending Publication Date: 2025-01-21GUANGZHOU BOGUAN TELECOMM TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411406104.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The scheme of assembling and generating wall models using pre-baked multiple wall components in the prior art has a complex process, low efficiency and high cost.

Method used

By obtaining the wall outline information and the basic wall model, a virtual wall instance is created, and the virtual wall instance is used to perform vertex offset processing on the basic wall model to generate a target wall model.

Benefits of technology

It achieves the adaptive effect to the terrain undulations of the virtual scene, improves the efficiency of target wall model generation, and reduces costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119327115A_ABST
    Figure CN119327115A_ABST
Patent Text Reader

Abstract

The invention discloses a model generation method and device, a computer readable storage medium and an electronic device. The method comprises the steps that wall contour information and a basic wall model are acquired, the wall contour information is used for determining a corresponding form trend line of a to-be-generated target wall model in a virtual scene, and the basic wall model is a first subunit for generating the target wall model; based on the wall contour information and the basic wall model, a plurality of virtual wall instances are created, and the virtual wall instances are used for representing the geometrical morphology of the basic wall model when the basic wall model is arranged along the morphology trend line; and performing vertex offset processing on the basic wall body model by using the virtual wall body instance to generate a target wall body model. According to the method and the device, the technical problems of complex process, low efficiency and high cost of a scheme for assembling and generating a wall model by utilizing multiple pre-baked wall components in the related technology are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a model generation method, device, computer-readable storage medium, and electronic device. Background Art

[0002] In application scenarios involving the generation of virtual wall models in virtual scenes, the shape of the wall often changes according to factors such as the specific geographical location and the level of the city. In particular, in virtual game scenes, the virtual ground may have many terrain undulations, which will also affect the model shape of the virtual wall model set on the virtual ground. In this regard, the virtual wall model generation scheme proposed in the related art is: pre-bake wall models with multiple slopes according to the terrain undulations of the virtual scene, and then splice these wall models (often manually spliced ​​by technicians) to obtain the final wall model.

[0003] However, the solution provided by the above-mentioned related technology has a cumbersome model making process, and the wall model obtained after splicing will correspond to a large amount of additional model data (such as the number of grids, the number of control components, etc.). In addition, the pre-baked wall model is a unique model corresponding to the terrain undulations, which cannot be reused or is unlikely to be reused. Therefore, the solution provided by the above-mentioned related technology has a complicated process, low model generation efficiency and high model generation cost.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0006] At least some embodiments of the present application provide a model generation method, device, computer-readable storage medium and electronic device to at least solve the technical problems in the related art of using a plurality of pre-baked wall components to assemble and generate a wall model, which has a complex process, low efficiency and high cost.

[0007] According to one embodiment of the present application, a model generation method is provided, including: obtaining wall contour information and a basic wall model, wherein the wall contour information is used to determine the morphological trend line corresponding to the target wall model to be generated in the virtual scene, and the basic wall model is the first subunit for generating the target wall model; based on the wall contour information and the basic wall model, creating a virtual wall instance, wherein the virtual wall instance is used to characterize the geometric shape of the basic wall model when arranged along the morphological trend line; using the virtual wall instance, performing vertex offset processing on the basic wall model to generate the target wall model.

[0008] According to one embodiment of the present application, a model generation device is also provided, including: an acquisition module, used to acquire wall contour information and a basic wall model, wherein the wall contour information is used to determine the morphological trend line corresponding to the target wall model to be generated in the virtual scene, and the basic wall model is the first subunit for generating the target wall model; a creation module, used to create a virtual wall instance based on the wall contour information and the basic wall model, wherein the virtual wall instance is used to characterize the geometric shape of the basic wall model when arranged along the morphological trend line; a generation module, used to use the virtual wall instance to perform vertex offset processing on the basic wall model to generate the target wall model.

[0009] According to one embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute any one of the above-mentioned model generation methods when executed by a processor.

[0010] According to one embodiment of the present application, there is also provided an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any one of the above-mentioned model generation methods.

[0011] According to one embodiment of the present application, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, it implements any one of the above-mentioned model generation methods.

[0012] In at least some embodiments of the present application, wall contour information and a basic wall model are obtained, wherein the wall contour information is used to determine the morphological trend line corresponding to the target wall model to be generated in the virtual scene, and the basic wall model is the first subunit for generating the target wall model; based on the wall contour information and the basic wall model, a virtual wall instance is created, wherein the virtual wall instance is used to characterize the geometric shape of the basic wall model when arranged along the morphological trend line; using the virtual wall instance, the basic wall model is subjected to vertex offset processing to generate the target wall model. Therefore, in the embodiment of the present application, the morphological trend lines in the virtual scene can represent the terrain undulations of the virtual ground. By creating a virtual wall instance to perform vertex offset processing on the basic wall model arranged along the morphological trend line, the generated target wall model can achieve an adaptive effect on the terrain undulations of the virtual scene. In other words, the present application achieves the purpose of programmatically and automatically generating a target wall model of adaptive terrain through virtual wall instances, thereby achieving the technical effect of improving the efficiency of generating the target wall model and reducing the cost, and further solves the technical problem of complex process, low efficiency and high cost of the solution in the related technology of assembling a wall model using a plurality of pre-baked wall components. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0014] Figure 1 It is a hardware structure block diagram of a mobile terminal according to a model generation method in one embodiment of the present application;

[0015] Figure 2 is a flow chart of a model generation method according to one embodiment of the present application;

[0016] Figure 3 is a schematic diagram of multiple key points of an optional morphological trend line according to one embodiment of the present application;

[0017] Figure 4 is a schematic diagram of an optional coordinate array corresponding to a plurality of key points according to one embodiment of the present application;

[0018] Figure 5 is a schematic diagram of an optional method for calculating the vertical slope corresponding to a target sub-segment according to one embodiment of the present application;

[0019] Figure 6 is a schematic diagram of an optional vertex offset deformation mode of a single basic wall model according to one embodiment of the present application;

[0020] Figure 7 is a schematic diagram of an optional target wall model according to one embodiment of the present application;

[0021] Figure 8 is a schematic diagram of another optional target wall model according to one embodiment of the present application;

[0022] Fig. 9 is a partially enlarged schematic diagram of another optional target wall model according to one embodiment of the present application;

[0023] Fig.10 is a structural block diagram of a model generation device according to one embodiment of the present application;

[0024] Fig.11 is a schematic diagram of an electronic device according to one embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] It should be noted that, in the specification of the present application, the word "for example" is used to mean "used as an example, illustration or description". Any embodiment described as "for example" in the present application is not necessarily interpreted as being more preferred or more advantageous than other embodiments. In order to enable any technician in the field to implement and use the present application, the following description is given. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid unnecessary details that make the description of the present application obscure. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest range of principles and features disclosed in the present application.

[0028] In the process of describing the embodiments of the present application, some nouns or terms appearing are applicable to the following interpretations:

[0029] Hierarchical Instanced Static Mesh (HISM): refers to a type of mesh in the rendering engine that efficiently renders and manages a large number of static mesh instances. HISM allows multiple instances of the same static mesh to be rendered using a single draw call, thereby reducing computer processing overhead and improving performance.

[0030] World space coordinates: World space coordinates in a rendering engine refer to the position and orientation of all objects in a three-dimensional scene described relative to a common world coordinate system. This world coordinate system is usually a fixed reference point used to determine the position relationship of objects in space. During the rendering process, all objects are converted to the world space coordinate system for rendering to ensure that their position and orientation in the scene are correct. The world space coordinate system is usually represented by a three-dimensional coordinate system with an origin and three axes (x, y, z axes) to determine the position and orientation of objects in space.

[0031] In a possible implementation of the present application, with respect to the solution of assembling a plurality of pre-baked virtual wall components to generate a wall model, which is commonly used in the background of wall model generation in a virtual scene in the field of computer technology, the inventor, after practice and careful research, still found technical problems of complex process, low efficiency and high cost. Based on this, the embodiment of the present application proposes a model generation method, which uses a morphological trend line in a virtual scene to characterize the terrain undulation of the virtual ground, and creates a virtual wall instance to perform vertex offset processing on the basic wall model arranged along the morphological trend line, so that the generated target wall model can achieve the technical concept of adaptive effect to the terrain undulation of the virtual scene, and achieves the purpose of programmatically and automatically generating a target wall model of adaptive terrain through a virtual wall instance, thereby achieving the technical effect of improving the efficiency of generating the target wall model and reducing the cost, thereby solving the technical problems of complex process, low efficiency and high cost in the related technology of assembling a plurality of pre-baked wall components to generate a wall model.

[0032] The above method embodiments involved in this application can be executed in a terminal device (for example, a mobile terminal, a computer terminal or a similar computing device). Taking running on a mobile terminal as an example, the mobile terminal can be a smart phone, a tablet computer, a PDA, a mobile Internet device, a game console and other terminal devices.

[0033] Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal according to a model generation method in one embodiment of the present application. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1(only one is shown in the figure) processor 102, memory 104, transmission device 106, input / output device 108 and display device 110. Taking the application of the model generation method to an electronic game scene through the mobile terminal as an example, the processor 102 calls and runs the computer program stored in the memory 104 to execute the model generation method, and the generated target wall model in the electronic game scene is transmitted to the input / output device 108 and / or the display device 110 through the transmission device 106, and then the target wall model is provided to the player.

[0034] Still like Figure 1 As shown, the processor 102 may include but is not limited to: a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microcontroller unit (MCU), a programmable logic device (Field Programmable Gate Array, FPGA), a neural network processor (Neural-Network Processing Unit, NPU), a tensor processor (Tensor Processing Unit, TPU), an artificial intelligence (Artificial Intelligence, AI) type processor and other processing devices.

[0035] Those skilled in the art will understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0036] In some optional embodiments mainly based on game scenarios, the above-mentioned terminal device can also provide a human-computer interaction interface with a touch-sensitive surface, which can sense finger contact and / or gestures to perform human-computer interaction with a graphical user interface (Graphical User Interface, GUI). The human-computer interaction function may include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interface, playing digital videos, playing digital music and / or web browsing, etc. The executable instructions for executing the above-mentioned human-computer interaction functions are configured / stored in a computer program product or readable storage medium executable by one or more processors.

[0037] The above method embodiments involved in this application can also be executed in a server. Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms. Taking the application of the model generation method to an electronic game scene through an electronic game server as an example, the electronic game server can generate a target wall model in the electronic game scene based on the model generation method, and provide the target wall model to the player (for example, it can be rendered and displayed on the display screen of the player's terminal, or provided to the player through holographic projection, etc.).

[0038] According to one embodiment of the present application, an embodiment of a model generation method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0039] In this embodiment, a model generation method running on the above mobile terminal is provided. Figure 2 is a flow chart of a model generation method according to one embodiment of the present application, such as Figure 2 As shown, the method includes the following steps S21 to S23.

[0040] Step S21, obtaining wall contour information and a basic wall model, wherein the wall contour information is used to determine the shape trend line corresponding to the target wall model to be generated in the virtual scene, and the basic wall model is the first subunit for generating the target wall model.

[0041] The above-mentioned virtual scene can be a virtual game scene, a virtual city scene, a virtual building scene, etc. In particular, when the virtual scene is a virtual game scene, the game type corresponding to the virtual game scene can be: action (for example: first-person or third-person shooting games, two-dimensional or three-dimensional fighting games, war action games and sports action games, etc.), adventure (for example: exploration games, collection games, puzzle games, etc.), simulation (for example: simulation sandbox games, simulation development games, strategy simulation games, city construction simulation games, business simulation games, etc.), role-playing and leisure (for example: chess and card table games, casual competitive games, music rhythm games, dress-up development games, etc.), etc.

[0042] In the application scenario, the basic wall model can be a pre-made first subunit for generating a target wall model, and the first subunit can be a wall asset unit obtained by digital packaging. In the extension direction of the target wall model (which can also be expressed as the direction corresponding to the morphological trend line), the size of the basic wall model is usually much smaller than the size of the target wall model to be generated.

[0043] In the application scenario, the above-mentioned morphological trend line can be in the virtual ground in the virtual scene. The virtual ground can be a plane or a virtual surface containing undulating terrain corresponding to the virtual terrain. The above-mentioned morphological trend line can be input by the user or determined by other processes related to the model generation process. After obtaining the morphological trend line, it can be determined that multiple wall model copies are arranged in sequence along the morphological trend line, and the multiple wall model copies are model copies of the basic wall model, thereby obtaining the target wall model.

[0044] In the application scenario, how to make the generated target wall model fit the terrain undulations of the virtual ground is one of the important technical issues. In this regard, the morphological trend line determined by the above-mentioned wall contour information in the embodiment of the present application can represent the terrain undulations of the virtual ground. For example, the morphological trend line can be directly specified based on the virtual ground with terrain undulations, or multiple key points on the morphological trend line can be specified. In this way, the terrain undulations of the virtual ground can be represented based on the coordinates of the morphological trend line or the coordinates of multiple key points.

[0045] Step S22: creating a virtual wall instance based on the wall contour information and the basic wall model, wherein the virtual wall instance is used to represent the geometric shape of the basic wall model when arranged along the shape trend line.

[0046] The above virtual wall instance can be generated based on multiple wall model copies arranged on the morphological trend line, and the virtual wall instance can include multiple sub-instances, and the multiple sub-instances correspond to the multiple wall model copies. The wall model copies set at different positions on the morphological trend line can have different model parameters (such as state parameters, attribute parameters, etc.), and the model parameters of the wall model copy at a certain position are recorded in the sub-instance corresponding to the position.

[0047] In the application scenario, a virtual wall instance is created based on the wall contour information and the basic wall model, so that the virtual wall instance can also include parameter information that characterizes the terrain undulations of the virtual ground. Correspondingly, these parameter information can also characterize the geometric form (such as offset, rotation, deformation, etc.) of the basic wall model when it is arranged along the morphological trend line. For example, the morphological trend line is subdivided into multiple sub-segments, and the slope information of each sub-segment (for example, the slope of the sub-segment in the vertical direction relative to the virtual ground surface) is recorded in the sub-instance corresponding to the wall model copy arranged on the sub-segment. Thus, the slope information of the sub-segment where the corresponding wall model copy is located can be calculated and recorded in each sub-instance of the above-mentioned virtual wall instance, and then the slope information of the virtual wall instance is used as the basis for model vertex offset of the basic wall model.

[0048] Step S23: Using the virtual wall instance, the basic wall model is subjected to vertex offset processing to generate a target wall model.

[0049] In the application scenario, after determining the morphological trend line, the basic wall model (that is, multiple wall model copies) can be inserted along the morphological trend line. Since the virtual surface may contain terrain undulations, the inserted basic wall model may have problems such as being unable to align with each other, overlapping, and jagged. To this end, the embodiment of the present application uses a virtual wall instance to perform vertex offset processing on the basic wall model, and the vertex offset of the basic wall model can be calculated using the parameter information recorded in the virtual wall instance corresponding to the basic wall model (such as the slope information of the sub-segment). After the vertex offset processing is performed on the basic wall model, the basic wall model may produce different degrees of deformation corresponding to its position in the virtual scene, and then generate a target wall model based on the deformed basic wall model. The target wall model may include multiple wall model copies corresponding to the basic wall model, and these multiple wall model copies can transition naturally, and each wall model copy can adapt to the terrain undulations of the virtual ground to obtain a target wall model with better visual performance.

[0050] Through the above steps S21 to S23, the morphological trend lines in the virtual scene in the embodiment of the present application can represent the terrain undulations of the virtual ground. By creating a virtual wall instance to perform vertex offset processing on the basic wall model arranged along the morphological trend line, the generated target wall model can achieve an adaptive effect on the terrain undulations of the virtual scene. In other words, the present application achieves the purpose of programmatically and automatically generating a target wall model of adaptive terrain through a virtual wall instance, thereby achieving the technical effect of improving the efficiency of generating the target wall model and reducing the cost, and further solves the technical problems of the related art of assembling a wall model using a plurality of pre-baked wall components, which has a complex process, low efficiency and high cost.

[0051] The above method of the embodiment of the present application is further introduced below.

[0052] Optionally, in step S21, the wall contour information includes at least one of the following: coordinate information of the configured morphological trend line; a coordinate array corresponding to multiple configured key points, wherein the coordinate array includes world space coordinates of multiple key points arranged in a target order, and the target order is a clockwise order or counterclockwise order corresponding to the morphological trend line.

[0053] The above coordinate information and / or the above coordinate array can be pre-configured by a technician according to scene requirements, or can be automatically triggered by other programs or processes in a model generation project (such as a game project, a virtual scene rendering project, etc.).

[0054] The coordinate information of the above-mentioned morphological trend line can be represented by a line fitting expression of the morphological trend line, or by the line point coordinates of the morphological trend line. In the application scenario, the user or other processes related to the wall model generation process can determine the morphological trend line by specifying the above-mentioned multiple key points on the virtual ground, and then determine the trend of the target wall model to be generated.

[0055] It should be noted that when specifying multiple key points, the world space coordinates of the multiple key points can be given in a target order. In the application scenario, the target order can be the arrangement order of the multiple key points in the direction from the starting point of the morphological trend line to the end point of the morphological trend line, or the arrangement order of the multiple key points in the direction from the end point of the morphological trend line to the starting point of the morphological trend line. According to the display state of the morphological trend line in the screen space, the world space coordinates of the multiple key points in the coordinate array can also be sorted in a clockwise order or a counterclockwise order.

[0056] In an exemplary application scenario, the user specifies Figure 3 The 13 key points (numbered 0 to 12) shown in FIG. 1 are used to determine the shape trend line corresponding to the target wall model to be generated. Figure 4 As shown, in the coordinate array (i.e., Sorted Vector Array) corresponding to the 13 key points, the world space coordinates of the 13 key points are recorded in the target order (counterclockwise order in this example). It should be noted that in the world space coordinate system corresponding to the world space coordinates, the plane determined by the X-axis and the Y-axis is parallel to the virtual plane corresponding to the virtual ground, and the Z-axis is perpendicular to the virtual plane corresponding to the virtual ground.

[0057] Through the above-mentioned steps S211 to S212, the embodiment of the present application can provide multiple methods of specifying the shape trend line. In the method of given coordinate information of the shape trend line, the user can also select multiple key points from the coordinate information again. The multiple key points can also be used for other processing of the shape trend line. For example, the multiple key points are used as the basis for sub-segment division. For another example, the multiple key points are used as the insertion positions of other components in the target wall component.

[0058] Optionally, in step S22, creating a virtual wall instance based on the wall outline information and the basic wall model may include the following execution steps:

[0059] Step S221, calculating multiple groups of geometric feature data corresponding to multiple sub-segments of the shape trend line according to the wall contour information;

[0060] Step S222: creating a virtual wall instance based on the multiple sets of geometric feature data and the model width data of the basic wall model.

[0061] According to the multiple key points on the morphological trend line, multiple sub-segments are determined. Specifically, according to the target order, the part of the morphological trend line between two adjacent key points is determined as a sub-segment, thereby obtaining multiple sub-segments. Figure 3 As shown, based on the 13 key points, the 12 sub-segments of the pattern trend line can be determined.

[0062] Furthermore, the wall contour information may include a coordinate array corresponding to a plurality of key points, and the coordinate array is used to calculate a plurality of sets of geometric feature data corresponding to a plurality of sub-segments. In particular, when the wall contour information includes coordinate information of a morphological trend line without specifying a plurality of key points on the morphological trend line, the morphological trend line may be divided into a plurality of sub-segments according to a preset segmentation rule, for example, the segmentation rule may be a specific number of evenly spaced segments, segmentation by terrain category, etc.

[0063] In the application scenario, the target wall model can be made by using the wall blueprint tool in the rendering engine. The coordinate array corresponding to multiple key points and the basic wall model (usually a pre-made digital asset) are used as the initial input of the wall blueprint tool. A wall grid component is set in the wall blueprint tool. The wall grid component can be a hierarchical instantiated static grid component. Based on this, the wall grid component can also be called a wall HISM. The wall HISM is used to manage the specific data of multiple virtual wall instances corresponding to the target wall model. In the process of arranging multiple basic wall models along the morphological trend line, a corresponding virtual wall instance is created for each basic wall model. In particular, custom parameters (custom data) are also provided in the wall HISM, and the custom parameters are used to record the vertical slope information corresponding to each virtual wall instance.

[0064] It should be noted that the above-mentioned multiple sets of geometric feature data are used to characterize the terrain changes corresponding to multiple sub-segments on the virtual ground. For example, the projection information of a sub-segment on the virtual plane corresponding to the virtual ground and the rotation angle of the sub-segment around the Z-axis (perpendicular to the virtual plane) can characterize the terrain undulations of the sub-segment. Considering the terrain undulations corresponding to multiple sub-segments, the terrain changes of the virtual ground corresponding to the morphological trend line can be determined.

[0065] Furthermore, in an application scenario, multiple sets of geometric feature data are used as inputs of multiple virtual wall instances managed by the wall HISM.

[0066] Through the above steps S221 to S222, the embodiment of the present application determines the instance data of the virtual wall instance to be created by calculating the geometric feature data of multiple sub-segments of the morphological trend line, and the instance data is used to determine the state parameters, attribute parameters, etc. of the basic wall model corresponding to the virtual wall instance. Therefore, the embodiment of the present application can characterize the terrain changes of the virtual scene through geometric feature data, thereby realizing the programmatic and automated creation of the virtual wall instance, and further improving the generation efficiency of the target wall model.

[0067] Optionally, in step S221, calculating multiple sets of geometric feature data according to the wall contour information may include the following execution steps:

[0068] Step S2211, for any target sub-segment among the multiple sub-segments, determine the three-dimensional coordinate data corresponding to the target sub-segment according to the wall contour information;

[0069] Step S2212, using the three-dimensional coordinate data, calculate the target geometric feature data corresponding to the target sub-segment.

[0070] The above-mentioned multiple sub-segments can be obtained by dividing the shape trend line using multiple key points. The above-mentioned three-dimensional coordinate data can be the world space coordinates of multiple points on the target sub-segment.

[0071] In the application scenario, multiple sub-segments are traversed, and for the current target sub-segment in the traversal, the three-dimensional coordinate data of the target sub-segment is determined according to the wall contour information. Then, a set of target geometric feature data corresponding to the target sub-segment is calculated using the three-dimensional coordinate data.

[0072] Through the above steps S2211 to S2212, the embodiment of the present application determines the three-dimensional coordinate data for each sub-segment in the morphological trend line, and further calculates the geometric feature data based on the three-dimensional coordinate data. Thus, by subdividing the morphological trend line into multiple sub-segments, the geometric feature data is used to characterize the terrain changes of the virtual scene at a more detailed level, thereby ensuring the model refinement of the generated target wall model, so that the target wall model has better scene visual performance.

[0073] Optionally, the target geometric feature data includes a projection length, a target rotation value, and a target slope; in step S2212, using the three-dimensional coordinate data, calculating a set of target geometric feature data corresponding to the target sub-segment may include the following execution steps:

[0074] Step S2213, using the three-dimensional coordinate data, calculate a target vector pointing from the starting point of the target subsegment to the end point of the target subsegment;

[0075] Step S2214, based on the virtual ground in the virtual scene, performing projection calculation on the target vector and the virtual ground to obtain a projection length;

[0076] Step S2215, calculating the vector angle between the target vector and the unit vector in the first direction to determine the target rotation value, wherein the first direction is a preset coordinate axis direction parallel to the virtual ground in the three-dimensional coordinate system corresponding to the three-dimensional coordinate data;

[0077] For step S2216, a ratio calculation is performed between the increment of the target vector in the second direction and the projection length to determine the target slope, wherein the second direction is a preset coordinate axis direction perpendicular to the virtual ground in the three-dimensional coordinate system.

[0078] In the application scenario, for each target sub-segment on the shape trend line, the projection length, target rotation value and target slope corresponding to the target sub-segment are calculated.

[0079] In the application scenario, the projection length of the target sub-segment is the projection length of the target vector corresponding to the target sub-segment on the plane corresponding to the virtual ground.

[0080] The first direction can be set to the positive direction of the Y axis, based on which the target rotation value is defined as the rotation value of the target sub-segment around the Z axis, which can be obtained by calculating the rotation of the target sub-segment relative to the unit vector (0, 1, 0), that is, calculating the arccosine value (arccos) of the dot product result of the target vector and the unit vector (0, 1, 0) to obtain the target rotation value. In addition, since the virtual wall model has a front side and a back side, after the target rotation value is calculated, the target rotation value can be added or subtracted from π (or 180°) according to whether the target rotation value is an acute angle value or an obtuse angle value, and the target rotation value is updated.

[0081] The second direction can be set as the Z-axis direction, and the ratio of the increment of the target vector in the Z-axis direction to the modulus of the target vector is calculated to obtain the target slope. Figure 5 As shown in , the target vector is the vector from the starting point of the target sub-segment to the end point of the target sub-segment. Figure 5The topographic undulations are represented by the dotted lines in the middle. The virtual plane corresponding to the virtual ground is the XY plane ( Figure 5 The X-axis direction is perpendicular to the paper surface). The vertical inclination angle (i.e., the target rotation value) corresponding to the target sub-segment is expressed as θ, and the above target slope (also known as the vertical slope) is expressed as the tangent value of θ, that is, the target slope is calculated by tanθ=H / L, where H represents the increment of the target vector in the Z-axis direction, and L represents the projection length.

[0082] Through the above steps S2213 to S2216, the embodiment of the present application performs digital representation of the terrain change of the virtual ground, and determines the terrain change corresponding to the target sub-segment through the projection length, target rotation value and target slope corresponding to each target sub-segment. In particular, the above target slope can determine the vertical slope corresponding to multiple virtual wall instances on the target sub-segment, and the vertical slope can determine the vertical offset of the basic wall model corresponding to the virtual wall instance on the target sub-segment. Therefore, based on the target slope, the subsequent model vertex offset processing of the basic wall model can be facilitated, which helps to optimize the visual performance of the target wall model.

[0083] Optionally, in step S222, creating a virtual wall instance based on multiple sets of geometric feature data and model width data may include the following execution steps:

[0084] Step S2221, for any target sub-segment among the multiple sub-segments, using the projection length, target rotation value and model width data corresponding to the target sub-segment, determining the instance plane coordinates of multiple instance generation positions on the target sub-segment;

[0085] Step S2222, using the instance plane coordinates and the target slope, calculate the instance vertical coordinates of the multiple instance generation positions;

[0086] Step S2223, creating a virtual wall instance based on the instance generation position, wherein the virtual wall instance includes multiple sub-instances, and the multiple sub-instances correspond to multiple wall model copies arranged end to end on the target sub-segment, and the data recorded by the multiple sub-instances include at least: instance plane coordinates, instance vertical coordinates and target slope.

[0087] The model width data of the above basic wall model is at least used to determine the wall width of the basic wall model, and half of the wall width is recorded as y0, that is, the wall width of the basic wall model is 2y0. For the target sub-segment, the starting point and the end point of the target sub-segment are first determined as two instance generation positions, and then starting from the starting point of the target sub-segment along the direction of the target sub-segment (determined by the target rotation value) an instance plane coordinate is determined every 2y0 (that is, the plane coordinates X and Y of each instance generation position are determined), and further, according to the target slope, the instance vertical coordinate at the plane position corresponding to each instance plane coordinate is calculated (that is, the vertical coordinate Z of each instance generation position), and then the virtual wall instance is generated at these instance generation positions.

[0088] Specifically, the vertical coordinates of the above instances can be calculated by trigonometric functions. For example, the vertical inclination angle corresponding to the target sub-segment is θ (that is, the target slope is tanθ), and the ratio between the change along the Z axis and the change along the target sub-segment direction of each instance generation position relative to the previous instance generation position is tanθ. Visually, a wall model copy of the basic wall model is placed at each instance generation position.

[0089] In the application scenario, the position calculation function (Record City Wall Instance Info function) preset in the wall blueprint tool can be used in the rendering engine to calculate the instance generation position corresponding to each target sub-segment.

[0090] In the process of calculating the instance generation position, the last instance generation position of each target sub-segment in the direction from the starting point to the end point can also be adjusted, for example, the last instance generation position is adjusted in the direction of the starting point of the target sub-segment so that multiple wall model copies in the target sub-segment will not cross the boundary (that is, exceed the range of the target sub-segment). In addition, the case where the vertical slope corresponding to the target sub-segment is 0 or not 0 can also be considered, wherein, when the vertical slope is not 0, after calculating the instance horizontal coordinate, the change of each instance generation position along the Z axis relative to the previous instance generation position is usually determined by dividing the vertical slope, and the change of the instance generation position along the target sub-segment relative to the previous instance generation position is determined, and then the instance generation position (the instance vertical coordinate) is determined; for the case where the vertical slope is 0 (that is, the virtual ground is horizontal and has no undulations), the instance generation position (the instance vertical coordinate) can be determined according to the wall width.

[0091] Through the above steps S2221 to S2223, in the process of generating a virtual wall instance in the embodiment of the present application, not only the terrain changes represented by each target sub-segment in the morphological trend line are taken into account, but also the model width data of the basic wall model itself is taken into account, and a virtual wall instance is created for the appropriate position on each target sub-segment. The virtual wall instance corresponds to the basic wall model arranged at the appropriate position, thereby further ensuring the generation quality of the target wall model.

[0092] Optionally, in step S23, using the virtual wall instance to perform vertex offset processing on the basic wall model to generate the target wall model may include the following execution steps:

[0093] Step S231, using the instance plane coordinates, the instance vertical coordinates and the target slope corresponding to the virtual wall instance, calculate the amount of the basic wall model to be offset in the second direction, wherein the second direction is a preset coordinate axis direction perpendicular to the virtual ground of the virtual scene in the three-dimensional coordinate system of the virtual scene;

[0094] Step S232: Perform vertex offset processing on the basic wall model according to the amount to be offset to generate a target wall model.

[0095] The second direction is the Z-axis direction. Figure 6 As shown, for a basic wall model, Figure 6 In the figure, a dotted rectangular frame is used to represent the basic wall model before distortion, and a solid parallelogram frame is used to represent the basic wall model after distortion. The model vertex data of the basic wall model before distortion can be determined by the instance plane coordinates, instance vertical coordinates and static mesh data of the basic wall model. For example, the scene space position of the basic wall model in the virtual scene can be determined based on the instance plane coordinates and instance vertical coordinates. Based on the scene space position and static mesh data, the position of each model vertex of the basic wall model in the virtual scene is calculated, that is, the model vertex data is obtained. Figure 6 Taking the upper right corner vertex of the virtual wall model in the figure as an example, the vertex is offset in the positive direction of the Z axis, and the vertex offset can represent the amount of the basic model to be offset in the Z axis direction. The vertex offset can be expressed as the product of the wall width and the target slope (tanθ), that is, 2y0*tanθ, where 2y0 represents the wall width of the basic wall model. Further, based on the amount of offset corresponding to each basic wall model, the basic wall model is subjected to vertex offset processing, and each model vertex is offset in the positive direction of the Z axis by 2y0*tanθ to obtain the model vertex data of the distorted basic wall model. Then, based on the distorted basic wall model (that is, multiple distorted copies of the wall model) arranged on each sub-segment in the multiple sub-segments on the morphological trend line, a target wall model is generated.

[0096] Through the above steps S231 to S232, the embodiment of the present application utilizes the slope information recorded in the virtual wall instance to realize programmatic and automated vertex offset processing of the basic wall model. Compared with the related art, the generation process of the target wall model is simplified and the generation efficiency of the target wall model is improved.

[0097] Optionally, the above model generation method may further include the following execution steps:

[0098] Step S241, creating a first grid component based on multiple virtual wall instances, wherein the first grid component includes at least a first target parameter, and the first target parameter is used to record target slopes recorded by multiple sub-instances corresponding to the target sub-segment;

[0099] Step S242: Render multiple wall model copies corresponding to the basic wall model using the first grid component to obtain a target wall model.

[0100] The first grid component may be a wall HISM. In an application scenario, after obtaining the coordinate data of the virtual wall instance, the coordinate data is input into the wall HISM so that the wall HISM manages multiple sub-instances in the virtual wall instance.

[0101] In addition, for each sub-instance in the virtual wall instance, a custom parameter (customvalue) is set to record the target slope of the sub-segment where the virtual wall instance is located. At this time, select the wall HISM in the wall blueprint tool, and you can see the data of multiple virtual wall instances managed by the wall HISM.

[0102] Through the above steps S241 to S242, the embodiment of the present application uses HISM to uniformly manage multiple virtual wall instances corresponding to the shape trend lines, which can reduce additional model data in the process of generating the target wall model, reduce resource consumption, and reduce costs.

[0103] Optionally, the above model generation method may further include the following execution steps:

[0104] Step S251, obtaining a basic corner tower model, wherein the basic corner tower model is a second subunit for generating a target wall model;

[0105] Step S252, determining the other key points except the first key point and the last key point among the multiple key points arranged in the target order on the shape trend line as target key points;

[0106] Step S253, according to the world space coordinates of the target key point, insert the basic corner tower model at the position corresponding to the target key point in the target wall model, and update the target wall model.

[0107] The second subunit may be a corner tower asset unit obtained by pre-digital packaging corresponding to the basic corner tower model.

[0108] In the application scenario, the basic wall model can be combined with the basic corner tower model to generate a target wall model. That is, multiple virtual corner tower instances can be generated at multiple key points on the target wall model. For example, among the multiple key points input, it is specified that the corner tower is generated at all points except the first key point and the last key point, that is, the other key points except the first key point and the last key point among the multiple key points are determined as target key points.

[0109] Furthermore, the coordinate data of the target key point is recorded in the coordinate array. According to the world space coordinates of any one of the multiple key points, the basic corner tower model is inserted into the position corresponding to the target key point in the target wall model, and the target wall model is updated. At this time, the target wall model includes both the basic wall model and the basic corner tower model.

[0110] Through the above steps S251 to S253, the embodiment of the present application can also generate a target wall model including a corner tower, and can support the user to specify the insertion position of the corner tower in the target wall model, which is highly flexible and improves the visual richness of the target wall model.

[0111] Optionally, in step S253, according to the world space coordinates of the target key point, inserting the basic corner tower model at the position corresponding to the target key point in the target wall model may include the following execution steps:

[0112] Step S2531, creating a second mesh component according to the world space coordinates of the target key point, wherein the second mesh component includes at least a second target parameter, and the second target parameter is used to record a target slope corresponding to a virtual turret instance set at the target key point;

[0113] Step S2532: using the second grid component, inserting the basic corner tower model at the position corresponding to the target key point in the target wall model.

[0114] The second grid component may be a corner tower HISM corresponding to the basic corner tower model. The HISM corresponding to the basic corner tower model may also record the target slope of the location of the basic corner tower model (such as the vertical slope information mentioned above). Furthermore, according to the vertical slope information recorded in the HISM corresponding to the basic corner tower model, in the process of inserting the basic corner tower model into the position corresponding to the target key point in the target wall model, the model vertex offset of the basic corner tower model may also be achieved.

[0115] Through the above steps S2531 to S2532, when generating a target wall model including a corner tower, the embodiment of the present application can also take into account the adaptive deformation of the basic corner tower model to the terrain changes at its location, thereby optimizing the overall visual performance of the target wall model including the corner tower. In addition, through the HISM corresponding to the basic corner tower model, the present application can also programmatically and automatically insert the basic corner tower model, thereby improving the generation efficiency of the target wall model.

[0116] In the application scenario, a target wall model including a corner tower according to an embodiment of the present application is as follows: Figure 7 As shown, the target wall model can show an adaptive effect to the terrain changes of the virtual ground. It should be noted that according to the above method provided in the embodiment of the present application, the following can be generated: Figure 7 On this basis, by applying the above method provided in the embodiment of the present application multiple times and adding virtual door opening models between multiple segments of unclosed target wall models, a virtual door opening model can be generated as shown in FIG. Figure 8 The enclosed city wall model shown in FIG. Fig. 9 As shown, it can be seen that the overall closed city wall model can also show an adaptive effect to the terrain changes of the virtual ground.

[0117] The above method steps provided in the embodiment of the present application can be applied to the scene of generating virtual walls of arbitrary shapes, and can be easily used in the rendering engine. The above wall generation scheme is highly scalable, and can meet almost all types of wall generation requirements with different wall and corner tower assets. In addition, the embodiment of the present application utilizes programmatic automation, which can be iterated at any time, saving a lot of manpower and time costs. When applied to large world or strategy game types, the efficiency improvement is particularly obvious.

[0118] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a disk, an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0119] In this embodiment, a model generation device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0120] Fig.10 is a structural block diagram of a model generation device according to one embodiment of the present application, such as Fig.10 As shown, the device comprises:

[0121] An acquisition module 1001 is used to acquire wall contour information and a basic wall model, wherein the wall contour information is used to determine a shape trend line corresponding to a target wall model to be generated in a virtual ground of a virtual scene, and the basic wall model is a first subunit for generating a target wall model;

[0122] A creation module 1002 is used to create multiple virtual wall instances based on the wall contour information and the basic wall model, wherein the virtual wall instance is used to represent the geometric shape of the basic wall model when arranged along the shape trend line;

[0123] The generation module 1003 is used to use the virtual wall instance to perform vertex offset processing on the basic wall model to generate a target wall model.

[0124] Optionally, in the above-mentioned acquisition module 1001, the wall contour information includes at least one of the following: coordinate information corresponding to the configured morphological trend line and a coordinate array corresponding to the configured multiple key points, wherein the coordinate array includes the world space coordinates of multiple key points arranged in a target order, and the target order is a clockwise order or a counterclockwise order corresponding to the morphological trend line.

[0125] Optionally, the creation module 1002 is further used to: calculate multiple sets of geometric feature data corresponding to multiple sub-segments of the morphological trend line according to the wall contour information; and create a virtual wall instance based on the multiple sets of geometric feature data and model width data of the basic wall model.

[0126] Optionally, the creation module 1002 is further used to: for any target sub-segment among the multiple sub-segments, determine the three-dimensional coordinate data corresponding to the target sub-segment according to the wall contour information; and calculate the target geometric feature data corresponding to the target sub-segment using the three-dimensional coordinate data.

[0127] Optionally, the target geometric feature data includes a projection length, a target rotation value and a target slope; the above-mentioned creation module 1002 is also used to: use the three-dimensional coordinate data to calculate a target vector pointing from the start point of the target subsegment to the end point of the target subsegment; based on the virtual ground in the virtual scene, perform a projection calculation on the target vector to obtain the projection length; calculate the vector angle between the target vector and the unit vector in the first direction to determine the target rotation value, wherein the first direction is a preset coordinate axis direction parallel to the virtual ground in the three-dimensional coordinate system corresponding to the three-dimensional coordinate data; calculate the ratio of the increment of the target vector in the second direction to the projection length to determine the target slope, wherein the second direction is a preset coordinate axis direction perpendicular to the virtual ground in the three-dimensional coordinate system.

[0128] Optionally, the creation module 1002 is further used to: for any target sub-segment among the multiple sub-segments, determine the instance plane coordinates of multiple instance generation positions on the target sub-segment using the projection length, target rotation value and model width data corresponding to the target sub-segment; calculate the instance vertical coordinates of the multiple instance generation positions using the instance plane coordinates and the target slope; and create a virtual wall instance based on the instance generation position, wherein the virtual wall instance includes multiple sub-instances, and the multiple sub-instances correspond to multiple wall model copies that are connected end to end on the target sub-segment, and the data recorded by the multiple sub-instances include at least: instance plane coordinates, instance vertical coordinates and target slope.

[0129] Optionally, in addition to all the above-mentioned modules, the above-mentioned model generation device also includes a rendering module (not shown in the figure), which is used to: create a first grid component based on a virtual wall instance, wherein the first grid component includes at least a first target parameter, and the first target parameter is used to record the target slopes recorded by multiple sub-instances corresponding to the target sub-segment; use the first grid component to render multiple basic wall models to obtain a target wall model.

[0130] Optionally, the above-mentioned generation module 1003 is also used to: use the instance plane coordinates, instance vertical coordinates and target slope corresponding to the virtual wall instance to calculate the amount of offset of the basic wall model in the second direction, wherein the second direction is a preset coordinate axis direction perpendicular to the virtual ground of the virtual scene in the three-dimensional coordinate system of the virtual scene; perform vertex offset processing on the basic wall model according to the amount of offset to generate a target wall model.

[0131] Optionally, in addition to all the above-mentioned modules, the above-mentioned model generation device also includes an update module (not shown in the figure), which is used to: obtain a basic corner tower model, wherein the basic corner tower model is the second sub-unit for generating a target wall model; determine other key points except the first key point and the last key point among the multiple key points arranged in the target order on the morphological trend line as target key points; insert the basic corner tower model at the position corresponding to the target key point in the target wall model according to the world space coordinates of the target key point, and update the target wall model.

[0132] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0133] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0134] Optionally, in this embodiment, the above-mentioned computer-readable storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0135] Optionally, in this embodiment, the computer-readable storage medium may be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the mobile terminals in a mobile terminal group.

[0136] Optionally, in this embodiment, the above-mentioned computer-readable storage medium can be configured to store a computer program for performing the following steps: obtaining wall contour information and a basic wall model, wherein the wall contour information is used to determine the morphological trend line corresponding to the target wall model to be generated in the virtual scene, and the basic wall model is the first subunit for generating the target wall model; based on the wall contour information and the basic wall model, creating a virtual wall instance, wherein the virtual wall instance is used to characterize the geometric shape of the basic wall model when arranged along the morphological trend line; using the virtual wall instance, performing vertex offset processing on the basic wall model to generate the target wall model.

[0137] Optionally, the computer-readable storage medium is also configured to store program code for executing the following steps: the wall contour information includes at least one of the following: coordinate information corresponding to the configured morphological trend line and a coordinate array corresponding to multiple configured key points, wherein the coordinate array includes world space coordinates of multiple key points arranged in a target order, and the target order is a clockwise order or a counterclockwise order corresponding to the morphological trend line.

[0138] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: calculating multiple sets of geometric feature data corresponding to multiple sub-segments of the morphological trend line according to the wall contour information; and creating a virtual wall instance based on the multiple sets of geometric feature data and the model width data of the basic wall model.

[0139] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: for any target sub-segment among the multiple sub-segments, determining the three-dimensional coordinate data corresponding to the target sub-segment based on the wall contour information; and calculating the target geometric feature data corresponding to the target sub-segment using the three-dimensional coordinate data.

[0140] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: target geometric feature data includes projection length, target rotation value and target slope; using three-dimensional coordinate data, calculate a target vector pointing from the start point of the target subsegment to the end point of the target subsegment; based on the virtual ground in the virtual scene, perform projection calculation on the target vector to obtain the projection length; perform vector angle calculation on the target vector and a unit vector in a first direction to determine the target rotation value, wherein the first direction is a preset coordinate axis direction parallel to the virtual ground in the three-dimensional coordinate system corresponding to the three-dimensional coordinate data; perform ratio calculation on an increment of the target vector in a second direction and the projection length to determine the target slope, wherein the second direction is a preset coordinate axis direction perpendicular to the virtual ground in the three-dimensional coordinate system.

[0141] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: for any target sub-segment among the multiple sub-segments, determining instance plane coordinates of multiple instance generation positions on the target sub-segment using the projection length, target rotation value, and model width data corresponding to the target sub-segment; calculating instance vertical coordinates of the multiple instance generation positions using the instance plane coordinates and the target slope; and creating a virtual wall instance based on the instance generation position, wherein the virtual wall instance includes multiple sub-instances, the multiple sub-instances corresponding to multiple wall model copies connected end to end on the target sub-segment, and the data recorded by the multiple sub-instances include at least: instance plane coordinates, instance vertical coordinates, and target slope.

[0142] Optionally, the computer-readable storage medium is also configured to store program code for executing the following steps: based on the virtual wall instance, creating a first grid component, wherein the first grid component includes at least a first target parameter, and the first target parameter is used to record the target slopes recorded by multiple sub-instances corresponding to the target sub-segment; using the first grid component to render multiple basic wall models to obtain a target wall model.

[0143] Optionally, the computer-readable storage medium is also configured to store program code for executing the following steps: using the instance plane coordinates, instance vertical coordinates and target slope corresponding to the virtual wall instance, calculate the amount of the basic wall model to be offset in the second direction, wherein the second direction is a preset coordinate axis direction in the three-dimensional coordinate system of the virtual scene that is perpendicular to the virtual ground of the virtual scene; according to the amount of offset, perform vertex offset processing on the basic wall model to generate a target wall model.

[0144] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: obtaining a basic corner tower model, wherein the basic corner tower model is a second subunit for generating a target wall model; determining other key points except the first key point and the last key point among a plurality of key points arranged in a target order on the morphological trend line as target key points; and inserting the basic corner tower model at a position corresponding to the target key point in the target wall model according to the world space coordinates of the target key point, thereby updating the target wall model.

[0145] In the computer-readable storage medium of the above embodiment, a technical solution for implementing a model generation method is provided. Obtain wall contour information and a basic wall model, wherein the wall contour information is used to determine the shape trend line corresponding to the target wall model to be generated in the virtual scene, and the basic wall model is the first subunit for generating the target wall model; based on the wall contour information and the basic wall model, create a virtual wall instance, wherein the virtual wall instance is used to characterize the geometric shape of the basic wall model when arranged along the shape trend line; use the virtual wall instance to perform vertex offset processing on the basic wall model to generate the target wall model. Therefore, in the embodiment of the present application, the morphological trend lines in the virtual scene can represent the terrain undulations of the virtual ground. By creating a virtual wall instance to perform vertex offset processing on the basic wall model arranged along the morphological trend line, the generated target wall model can achieve an adaptive effect on the terrain undulations of the virtual scene. In other words, the present application achieves the purpose of programmatically and automatically generating a target wall model of adaptive terrain through virtual wall instances, thereby achieving the technical effect of improving the efficiency of generating the target wall model and reducing the cost, and further solves the technical problem of complex process, low efficiency and high cost of the solution in the related technology of assembling a wall model using a plurality of pre-baked wall components.

[0146] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation methods of the present application.

[0147] In an exemplary embodiment of the present application, a program product capable of implementing the above method of the present embodiment is stored on a computer-readable storage medium. In some possible implementations, various aspects of the embodiments of the present application can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present application described in the above "Exemplary Method" section of the present embodiment.

[0148] According to the program product for implementing the above method in the embodiment of the present application, it can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the embodiment of the present application is not limited thereto. In the embodiment of the present application, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0149] The program product may be in any combination of one or more computer-readable media. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive) of computer-readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0150] It should be noted that the program code contained in the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0151] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0152] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0153] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program: obtaining wall contour information and a basic wall model, wherein the wall contour information is used to determine a morphological trend line corresponding to a target wall model to be generated in a virtual scene, and the basic wall model is a first subunit for generating the target wall model; creating a virtual wall instance based on the wall contour information and the basic wall model, wherein the virtual wall instance is used to characterize the geometric shape of the basic wall model when arranged along the morphological trend line; and performing vertex offset processing on the basic wall model using the virtual wall instance to generate a target wall model.

[0154] Optionally, the processor can be configured to perform the following steps through a computer program: the wall contour information includes at least one of the following: coordinate information corresponding to the configured morphological trend line and a coordinate array corresponding to multiple configured key points, wherein the coordinate array includes world space coordinates of multiple key points arranged in a target order, and the target order is a clockwise order or a counterclockwise order corresponding to the morphological trend line.

[0155] Optionally, the processor may be configured to perform the following steps through a computer program: calculating multiple sets of geometric feature data corresponding to multiple sub-segments of the morphological trend line according to the wall contour information; and creating a virtual wall instance based on the multiple sets of geometric feature data and model width data of the basic wall model.

[0156] Optionally, the processor may be configured to perform the following steps through a computer program: for any target sub-segment among the multiple sub-segments, determine the three-dimensional coordinate data corresponding to the target sub-segment based on the wall contour information; and calculate the target geometric feature data corresponding to the target sub-segment using the three-dimensional coordinate data.

[0157] Optionally, the processor may be configured to perform the following steps through a computer program: target geometric feature data includes a projection length, a target rotation value, and a target slope; using the three-dimensional coordinate data, a target vector pointing from the start point of the target subsegment to the end point of the target subsegment is calculated; based on the virtual ground in the virtual scene, a projection calculation is performed on the target vector to obtain the projection length; a vector angle is calculated between the target vector and a unit vector in a first direction to determine the target rotation value, wherein the first direction is a preset coordinate axis direction parallel to the virtual ground in the three-dimensional coordinate system corresponding to the three-dimensional coordinate data; a ratio calculation is performed on an increment of the target vector in the second direction and the projection length to determine the target slope, wherein the second direction is a preset coordinate axis direction perpendicular to the virtual ground in the three-dimensional coordinate system.

[0158] Optionally, the processor may be configured to perform the following steps through a computer program: for any target sub-segment among the multiple sub-segments, determining instance plane coordinates of multiple instance generation positions on the target sub-segment using the projection length, target rotation value, and model width data corresponding to the target sub-segment; calculating instance vertical coordinates of the multiple instance generation positions using the instance plane coordinates and the target slope; and creating a virtual wall instance based on the instance generation position, wherein the virtual wall instance includes multiple sub-instances, the multiple sub-instances corresponding to multiple wall model copies that are connected end to end on the target sub-segment, and the data recorded by the multiple sub-instances include at least: instance plane coordinates, instance vertical coordinates, and target slope.

[0159] Optionally, the processor may be configured to perform the following steps through a computer program: creating a first grid component based on a virtual wall instance, wherein the first grid component includes at least a first target parameter, and the first target parameter is used to record target slopes recorded by multiple sub-instances corresponding to the target sub-segment; and rendering multiple basic wall models using the first grid component to obtain a target wall model.

[0160] Optionally, the processor may be configured to execute the following steps through a computer program: using the instance plane coordinates, instance vertical coordinates and target slope corresponding to the virtual wall instance, calculate the amount of the basic wall model to be offset in the second direction, wherein the second direction is a preset coordinate axis direction in the three-dimensional coordinate system of the virtual scene that is perpendicular to the virtual ground of the virtual scene; performing vertex offset processing on the basic wall model according to the amount of offset to generate a target wall model.

[0161] Optionally, the processor can be configured to perform the following steps through a computer program: obtaining a basic corner tower model, wherein the basic corner tower model is a second subunit for generating a target wall model; determining other key points except the first key point and the last key point among a plurality of key points arranged in a target order on the morphological trend line as target key points; and inserting the basic corner tower model at a position corresponding to the target key point in the target wall model according to the world space coordinates of the target key point, thereby updating the target wall model.

[0162] In the electronic device of the above embodiment, a technical solution for implementing a model generation method is provided. The wall contour information and the basic wall model are obtained, wherein the wall contour information is used to determine the shape trend line corresponding to the target wall model to be generated in the virtual scene, and the basic wall model is the first subunit for generating the target wall model; based on the wall contour information and the basic wall model, a virtual wall instance is created, wherein the virtual wall instance is used to characterize the geometric shape of the basic wall model when arranged along the shape trend line; using the virtual wall instance, the basic wall model is subjected to vertex offset processing to generate the target wall model. Therefore, in the embodiment of the present application, the morphological trend lines in the virtual scene can represent the terrain undulations of the virtual ground. By creating a virtual wall instance to perform vertex offset processing on the basic wall model arranged along the morphological trend line, the generated target wall model can achieve an adaptive effect on the terrain undulations of the virtual scene. In other words, the present application achieves the purpose of programmatically and automatically generating a target wall model of adaptive terrain through virtual wall instances, thereby achieving the technical effect of improving the efficiency of generating the target wall model and reducing the cost, and further solves the technical problem of complex process, low efficiency and high cost of the solution in the related technology of assembling a wall model using a plurality of pre-baked wall components.

[0163] Fig.11 is a schematic diagram of an electronic device according to one embodiment of the present application. Fig.11 As shown, the electronic device 1100 is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0164] like Fig.11 As shown, the electronic device 1100 is in the form of a general computing device. The components of the electronic device 1100 may include but are not limited to: the at least one processor 1110, the at least one memory 1120, a bus 1130 connecting different system components (including the memory 1120 and the processor 1110), and a display 1140.

[0165] The memory 1120 stores program codes, which can be executed by the processor 1110, so that the processor 1110 executes the steps described in the method part of the embodiment of the present application according to various exemplary embodiments of the present application.

[0166] The memory 1120 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 11201 and / or a cache memory unit 11202, and may further include a read-only memory unit (ROM) 11203, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.

[0167] In some examples, the memory 1120 may also include a program / utility 11204 having a set (at least one) of program modules 11205, such program modules 11205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or a combination thereof may include the implementation of a network environment. The memory 1120 may further include a memory remotely disposed relative to the processor 1110, and these remote memories may be connected to the electronic device 1100 via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0168] The bus 1130 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a local bus of the processor 1110, or a bus using any of a variety of bus architectures.

[0169] The display 1140 may be, for example, a touch screen liquid crystal display (LCD), which may enable a user to interact with a user interface of the electronic device 1100 .

[0170] Optionally, the electronic device 1100 may also communicate with one or more external devices 1200 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 1100, and / or any device that enables the electronic device 1100 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 1150. Furthermore, the electronic device 1100 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 1160. Fig.11 As shown, the network adapter 1160 communicates with other modules of the electronic device 1100 via the bus 1130. It should be understood that although Fig.11 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk arrays (Redundant Arrays of Independent Disks, RAID) systems, tape drives, and data backup storage systems.

[0171] The electronic device 1100 may further include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply and / or a camera.

[0172] It can be understood by those skilled in the art that Fig.11 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.11 More or fewer components as shown, or with Fig.11 The memory 1120 may be used to store computer programs and corresponding data, such as the computer programs and corresponding data corresponding to the model generation method in the embodiment of the present application. The processor 1110 executes various functional applications and data processing by running the computer programs stored in the memory 1120, that is, implementing the above-mentioned model generation method.

[0173] According to an embodiment of the present application, a computer program product is also provided. Optionally, in this embodiment, the computer program product can provide a model generation service based on the model generation method provided in the above embodiment.

[0174] Optionally, in this embodiment, the computer program product may be a set of instructions and codes pre-written according to the model generation method. The computer program product may run on various computer platforms, including personal computers, servers, mobile devices, etc.

[0175] Optionally, in an embodiment of the present application, instructions and codes corresponding to the computer program product are used to implement the following method steps: obtaining wall contour information and a basic wall model, wherein the wall contour information is used to determine the morphological trend line corresponding to the target wall model to be generated in the virtual scene, and the basic wall model is the first subunit for generating the target wall model; based on the wall contour information and the basic wall model, creating a virtual wall instance, wherein the virtual wall instance is used to characterize the geometric shape of the basic wall model when arranged along the morphological trend line; using the virtual wall instance, performing vertex offset processing on the basic wall model to generate the target wall model.

[0176] Through the above-mentioned computer program product, it is possible to provide model generation services in application scenarios involving the generation of wall models in virtual scenes in the field of computer technology, thereby achieving the purpose of programmatically and automatically generating target wall models of adaptive terrain through virtual wall instances, thereby achieving the technical effect of improving the efficiency of generating target wall models and reducing costs, and further solving the technical problems of complex processes, low efficiency and high costs in the solution of assembling and generating wall models using a variety of pre-baked wall components in the related technology.

[0177] 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.

[0178] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0179] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0180] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0181] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0182] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly or all or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0183] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A model generation method, characterized in that: include: Acquire wall contour information and a basic wall model, wherein the wall contour information is used to determine a shape trend line corresponding to a target wall model to be generated in a virtual scene, and the basic wall model is a first subunit for generating the target wall model; Based on the wall contour information and the basic wall model, a virtual wall instance is created, wherein the virtual wall instance is used to represent the geometric shape of the basic wall model when arranged along the shape trend line; The virtual wall instance is used to perform vertex offset processing on the basic wall model to generate the target wall model.

2. The model generation method according to claim 1, characterized in that: The wall contour information includes at least one of the following: The coordinate information corresponding to the configured morphological trend line and the coordinate array corresponding to the configured multiple key points, wherein the coordinate array includes the world space coordinates of the multiple key points arranged in a target order, and the target order is a clockwise order or a counterclockwise order corresponding to the morphological trend line.

3. The model generation method according to claim 1 or 2, characterized in that: Based on the wall contour information and the basic wall model, creating the virtual wall instance includes: Calculating multiple groups of geometric feature data corresponding to multiple sub-segments of the morphological trend line according to the wall contour information; The virtual wall instance is created based on the multiple sets of geometric feature data and the model width data of the basic wall model.

4. The model generation method according to claim 3, characterized in that: Calculating the plurality of sets of geometric feature data according to the wall contour information includes: For any target sub-segment among the multiple sub-segments, determining three-dimensional coordinate data corresponding to the target sub-segment according to the wall contour information; The target geometric feature data corresponding to the target sub-segment is calculated using the three-dimensional coordinate data.

5. The model generation method according to claim 4, characterized in that: The target geometric feature data includes a projection length, a target rotation value and a target slope; using the three-dimensional coordinate data, a set of target geometric feature data corresponding to the target subsegment is calculated, including: Using the three-dimensional coordinate data, a target vector pointing from the starting point of the target subsegment to the end point of the target subsegment is calculated; Based on the virtual ground in the virtual scene, performing projection calculation on the target vector to obtain the projection length; Calculating the vector angle between the target vector and a unit vector in a first direction to determine the target rotation value, wherein the first direction is a preset coordinate axis direction parallel to the virtual ground in the three-dimensional coordinate system corresponding to the three-dimensional coordinate data; The target slope is determined by calculating the ratio of the increment of the target vector in the second direction to the projection length, wherein the second direction is a preset coordinate axis direction perpendicular to the virtual ground in a three-dimensional coordinate system.

6. The model generation method according to claim 5, characterized in that: Based on the multiple sets of geometric feature data and the model width data, creating the virtual wall instance includes: For any target sub-segment among the multiple sub-segments, determining instance plane coordinates of multiple instance generation positions on the target sub-segment by using the projection length, the target rotation value and the model width data corresponding to the target sub-segment; Calculating the instance vertical coordinates of the plurality of instance generation positions using the instance plane coordinates and the target slope; Based on the instance generation position, the virtual wall instance is created, wherein the virtual wall instance includes multiple sub-instances, and the multiple sub-instances correspond to multiple wall model copies arranged end to end on the target sub-segment, and the data recorded by the multiple sub-instances include at least: the instance plane coordinates, the instance vertical coordinates and the target slope.

7. The model generation method according to any one of claim 6, characterized in that: The model generation method further comprises: Based on the virtual wall instance, create a first grid component, wherein the first grid component includes at least a first target parameter, and the first target parameter is used to record the target slopes recorded by the multiple sub-instances corresponding to the target sub-segment; The first grid component is used to render the multiple wall model copies corresponding to the basic wall model to obtain the target wall model.

8. The model generation method according to claim 1, characterized in that: Using the virtual wall instance to perform vertex offset processing on the basic wall model to generate the target wall model includes: The amount of the basic wall model to be offset in the second direction is calculated by using the instance plane coordinates, the instance vertical coordinates and the target slope corresponding to the virtual wall instance, wherein the second direction is a preset coordinate axis direction perpendicular to the virtual ground of the virtual scene in the three-dimensional coordinate system of the virtual scene; According to the amount to be offset, vertex offset processing is performed on the basic wall model to generate the target wall model.

9. The model generation method according to claim 1, characterized in that: The model generation method further comprises: Acquire a basic corner tower model, wherein the basic corner tower model is a second subunit for generating the target wall model; Determine the other key points except the first key point and the last key point among the multiple key points arranged in the target order on the pattern trend line as target key points; According to the world space coordinates of the target key point, the basic corner tower model is inserted at the position corresponding to the target key point in the target wall model to update the target wall model.

10. A model generation device, characterized in that: include: An acquisition module, used to acquire wall contour information and a basic wall model, wherein the wall contour information is used to determine a shape trend line corresponding to a target wall model to be generated in a virtual scene, and the basic wall model is a first subunit for generating the target wall model; A creation module, used for creating a virtual wall instance based on the wall outline information and the basic wall model, wherein the virtual wall instance is used to represent the geometric shape of the basic wall model when arranged along the shape trend line; A generation module is used to use the virtual wall instance to perform vertex offset processing on the basic wall model to generate the target wall model.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the model generation method according to any one of claims 1 to 9 when executed by a processor.

12. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the model generation method according to any one of claims 1 to 9.

13. A computer program product, characterized in that The invention comprises a computer program, which implements the model generation method according to any one of claims 1 to 9 when being executed by a processor.