Scene model generation method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202311029537.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-15
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-08-15
AI Technical Summary
[0003]上述方法中,由于其流程繁杂,导致其须耗费大量的时间,因而,存在现有的场景模型优化效率较低的问题
[0018]上述场景模型的生成方法、装置、电子设备及存储介质,创建目标类型的待处理平面,并获取场景模型曲面;通过所述场景模型曲面对所述待处理平面进行拟合处理,得到拟合后的平面;对所述拟合后的平面进行区域的信息处理,得到目标平面;基于所述目标平面进行实体转换,得到目标场景模型。该方法中,通过场景模型的正表面(即待处理平面)的曲面拟合、平面适配与置换以及重建,能够有效、快速地提高场景模型精细度,且具有较高的准确性和稳定性,有效地提高了场景模型优化效率。
Smart Images

Figure CN117224935B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for generating scene models. Background Technology
[0002] In virtual games, various scene models must be created and applied, such as 3D terrain models for event handling. In the field of computer graphics (CG), continuously improving the detail and accuracy of scene models is a constant pursuit. Existing scene model optimization methods generally involve processes such as first subdividing surfaces, then manual sculpting, and finally retopology baking.
[0003] The above methods are complex and time-consuming, resulting in low optimization efficiency for existing scenario models. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method, apparatus, electronic device and storage medium for generating scene models. By performing surface fitting, planar adaptation and replacement and reconstruction on the front surface (i.e. the plane to be processed) of the scene model, the fineness of the scene model can be effectively and quickly improved, and it has high accuracy and stability, thus effectively improving the optimization efficiency of the scene model.
[0005] In a first aspect, embodiments of the present invention provide a method for generating a scene model, the method comprising:
[0006] Create a plane of the target type to be processed, and obtain the scene model surface;
[0007] The scene model surface is fitted to the plane to be processed to obtain the fitted plane.
[0008] The fitted plane is processed to obtain the target plane.
[0009] Based on the target plane, entity transformation is performed to obtain the target scene model.
[0010] Secondly, embodiments of the present invention provide a scene model generation apparatus, the scene model generation apparatus comprising:
[0011] Create an acquisition module to create a plane of the target type to be processed and acquire the surface of the scene model;
[0012] The fitting module is used to fit the plane to be processed using the curved surface of the scene model to obtain the fitted plane.
[0013] The permutation fusion module is used to process the region information of the fitted plane to obtain the target plane.
[0014] The reconstruction and transformation module is used to perform entity transformation based on the target plane to obtain the target scene model.
[0015] Thirdly, embodiments of the present invention provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-described method for generating the scene model.
[0016] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to implement the above-described method for generating the scene model.
[0017] The embodiments of the present invention bring the following beneficial effects:
[0018] The aforementioned method, apparatus, electronic device, and storage medium for generating scene models create a target-type plane to be processed and obtain a scene model surface; fit the scene model surface to the plane to be processed to obtain a fitted plane; perform regional information processing on the fitted plane to obtain a target plane; and perform entity transformation based on the target plane to obtain a target scene model. In this method, by fitting the surface of the scene model (i.e., the plane to be processed), adapting and replacing the plane, and reconstructing it, the refinement of the scene model can be effectively and quickly improved, with high accuracy and stability, thus effectively improving the optimization efficiency of the scene model.
[0019] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0020] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0021] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0022] Figure 1 A schematic diagram of an embodiment of the scene model generation method provided in this invention;
[0023] Figure 2 A schematic diagram of another embodiment of the scene model generation method provided in this invention;
[0024] Figure 3 This is a schematic diagram of an embodiment of the present invention, showing the effect of rotating an initial plane based on the slope direction of a scene model surface.
[0025] Figure 4 This is a schematic diagram of an embodiment of the projection range array point information of the plane to be processed, the set of points to be adsorbed, and the set of zero-height plane points provided in this invention.
[0026] Figure 5 A schematic diagram of an embodiment of the candidate plane provided by the present invention;
[0027] Figure 6 A schematic diagram of an embodiment of the region to be replaced and the region to be merged provided in this invention;
[0028] Figure 7 A schematic diagram of an embodiment of the replaced plane provided in this invention;
[0029] Figure 8 A schematic diagram of an embodiment of the invention for creating a height map of a surface slope after erosion;
[0030] Figure 9 This is a schematic diagram of an embodiment of the present invention for extracting and exporting height maps after surface slope erosion.
[0031] Figure 10 A schematic diagram of an embodiment of the target plane provided in this invention;
[0032] Figure 11 A schematic diagram of an embodiment of the effect diagram of the target scene model provided in the present invention;
[0033] Figure 12 A schematic diagram of a scene model generation device provided in an embodiment of the present invention;
[0034] Figure 13 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0035] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0036] This invention provides a method, apparatus, electronic device, and storage medium for generating scene models, which can be flexibly applied in various CG scenes. Its main application is in games, but it is not limited to games.
[0037] The scene model generation method in one embodiment of the present invention can run on a terminal device or a server. The terminal device can be a local terminal device. When the scene model generation method runs on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and client devices.
[0038] In an optional real-time mode, various cloud applications, such as cloud gaming, can run under the cloud interaction system. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program and the game screen presentation are separated. The storage and execution of information interaction methods are completed on the cloud gaming server. The client device is used for data reception, transmission, and game screen presentation. For example, the client device can be a display device with data transmission capabilities close to the user, such as a mobile terminal, television, computer, or PDA; however, the terminal device for information processing is the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses the game screen and other data, returns it to the client device via the network, and finally, the client device decodes and outputs the game screen.
[0039] In an alternative implementation, the terminal device can be a local terminal device. Taking a game as an example, the local terminal device stores the game program and is used to display the game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, conventionally downloading, installing, and running the game program via an electronic device. The local terminal device can provide the graphical user interface to the player in various ways, such as rendering it on the terminal's display screen, or providing it to the player through holographic projection. For example, the local terminal device can include a display screen for displaying the graphical user interface, which includes game screens, and a processor for running the game, generating the graphical user interface, and controlling the display of the graphical user interface on the display screen.
[0040] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 One embodiment of the scene model generation method in this invention includes the following steps:
[0041] Step 101: Create a plane to be processed of the target type and obtain the scene model surface.
[0042] The aforementioned target types are used to indicate specific built-in attributes (target attributes, e.g., mesh attributes) and specific functions (target functions, e.g., projection mapping). The plane to be processed is a plane corresponding to the type of the front surface of the scene model to be optimized or reconstructed, or a plane corresponding to the type of the front surface of the scene model to be optimized or reconstructed and containing corresponding details. As an example, and not a limitation, the plane to be processed can be mesh data. As an example, and not a limitation, the scene model surface is a surface that both integrates and adds details to the front surface of the original scene model (the original scene model to be optimized or reconstructed). The scene model surface can be the level ground; specific details are not limited here.
[0043] Optionally, a target-type plane to be processed can be created using pre-built software (e.g., Unreal Engine (UE)) or plugins (e.g., Unreal Live Link for Maya plugin); scene model surfaces can be obtained by reading scene model surfaces from a pre-built database, or by extracting them from the settings information.
[0044] Step 102: Fit the plane to be processed using the surface of the scene model to obtain the fitted plane.
[0045] Optionally, a pre-defined fitting algorithm is used to fit the plane to be processed based on the surface of the scene model, thereby obtaining the fitted plane. Here, as an example and not a limitation, the fitting algorithm can be a moving surface fitting (MSF) algorithm or a least squares algorithm. The operation steps of the moving surface fitting algorithm or the least squares algorithm can refer to existing ones, and will not be repeated here.
[0046] Optionally, the set of projection points of the plane to be processed is determined, and the set of projection points of the scene model surface is determined by the set of projection points; the set of projection points is projected and mapped to the set of projection points, thereby realizing the fitting process of the plane to be processed by the scene model surface to obtain the fitted plane.
[0047] Step 103: Perform regional information processing on the fitted plane to obtain the target plane.
[0048] The aforementioned information processing of the fitted plane can be understood as performing corresponding information processing on the regions after the fitted plane has been divided into regions, in order to improve the performance capability of the target scene model (details and accuracy of the front surface). As an example, and not a limitation, the aforementioned information processing of regions can include region permutation processing and region fusion processing; the aforementioned region permutation processing can be understood as replacing information within a region, and further, it can also be understood as transforming the positions of vertices within the region; the aforementioned region fusion processing can be understood as fusing information within regions.
[0049] As an example, and not a limitation, the fitted plane can be subjected to region permutation first, followed by region fusion; or the fitted plane can be subjected to region fusion first, followed by region permutation. If the fitted plane is subjected to region fusion first, followed by region permutation, the region permutation process includes information permutation and plane extension / offset processing. For example, region fusion is performed on the fitted plane to obtain a fused plane, and region permutation is performed on the fused plane to obtain the target plane. Specifically, the fitted plane is divided into regions to obtain regions to be permuted and regions to be fused, and the target plane is obtained. The target axis information of the fusion region is the local spatial Y-axis information of the region to be fused. The target axis information of the region to be fused is smoothed to obtain the first plane. The first plane is placed in reverse on the scene model surface and the intersection boundary is adjusted to obtain the second plane. The second plane is extended and offset to obtain the plane after region fusion. The target height value of the height map after the surface slope erosion is obtained. The displacement information of the region to be replaced is determined by the target height value. The vertices of the region to be replaced in the plane after region fusion are processed by the displacement information to obtain the processed plane. The intersection boundary is adjusted and extended and offset is performed on the processed plane to obtain the target plane.
[0050] Step 104: Perform entity transformation based on the target plane to obtain the target scene model.
[0051] The above entity conversion refers to the conversion of a graphic or image on a two-dimensional plane into a three-dimensional entity with depth and a sense of solidity (i.e., having surface, volume, and depth), that is, converting a target plane into a three-dimensional entity model.
[0052] Optionally, a new plane can be created using the information from the target plane, and the new plane can be assigned corresponding textures, UVs, and materials to obtain the target scene model. The obtained target scene model can add many rich details to the original effect and almost fit together, resulting in a significant improvement in effect, that is, the level of detail of the scene model is effectively improved.
[0053] The above-mentioned method for generating scene models can effectively and quickly improve the refinement of scene models by surface fitting, plane adaptation and replacement, and reconstruction of the front surface (i.e. the plane to be processed) of the scene model, and has high accuracy and stability, thus effectively improving the optimization efficiency of scene models.
[0054] See Figure 2 The diagram illustrates another embodiment of a method for generating a scene model, which includes the following steps:
[0055] Step 201: Create a plane to be processed of the target type and obtain the scene model surface.
[0056] In one implementation, step 201 specifically includes: creating an initial plane of the target type, and extracting the corresponding level ground information from the preset collision detection information to obtain the scene model surface; rotating the initial plane based on the slope direction of the scene model surface to obtain the plane to be processed.
[0057] As an example, and not a limitation, this describes creating an initial plane of type AUSurfaceMeshGrid using Unreal Engine (UE). AUSurfaceMeshGrid is a unique class, UObject, distinct from Unreal Engine's own meshes. This initial plane of the target type has built-in mesh attributes and functionalities (including but not limited to projection mapping and height texture generation). It should be noted that before or during the creation of the initial plane of the target type, parameters are set according to project requirements (e.g., the need to improve the detail and accuracy of the scene model's front surface), and corresponding information is generated. This generated information includes collision detection information, collision... The detection information is the information set by the UE for the ground level. The collision detection information includes the corresponding level ground information, which includes the grid information of the level ground (i.e., the grid information of the scene model surface) and the slope orientation of the level ground (i.e., the slope direction of the scene model surface). The scene model surface can be obtained by extracting the corresponding level ground information from the preset collision detection information. The initial plane is rotated according to the target direction to obtain the plane to be processed. The target direction is the angle formed by the initial plane and the slope orientation of the level ground which is less than a preset value. Preferably, the angle is 0, that is, the initial plane is parallel to the slope orientation of the level ground. The effect diagram after rotating the initial plane based on the slope direction of the scene model surface is shown in the figure. Figure 3 As shown.
[0058] Creating an initial plane of the target type facilitates surface detail processing and enhances its functionality, thereby improving processing efficiency. Rotating the initial plane expands the projected area, effectively enabling the processing of increased planar details.
[0059] Step 202: Obtain the projection range array point information of the plane to be processed, and determine the target array area through the projection range array point information.
[0060] The projection range array point information refers to the array point information corresponding to the range of the scene model surface projected onto the plane to be processed. This information includes the positional information of each point in the array within the projection range (e.g., 3D coordinate data, world coordinate data, or point cloud coordinate data). As an example, and not a limitation, the target array region is the array region formed by the X and Z axes. The target array region is calculated using the projection range array point information.
[0061] Step 203: Based on the target array region, perform vertex sampling on the surface of the scene model to obtain the set of points to be attracted.
[0062] In one implementation, step 203 specifically includes: obtaining the corresponding set of zero-height plane points through the array point information of the projection range of the plane to be processed; querying the boundary information corresponding to the scene model surface through the target array region and the set of zero-height plane points and sampling it to obtain the initial surface vertex set and the point set of the zero-height plane projection; performing iterative judgment on the set of zero-height plane points and the point set of the zero-height plane projection and searching for the initial surface vertex set to obtain the set of points to be attracted.
[0063] Specifically, the set of points corresponding to the projection range array point information of the plane to be processed is projected onto the zero-height plane (the zero-height plane is a plane with a height of 0) to obtain the zero-height plane point set. That is, the zero-height plane point set can be understood as the points on the zero-height plane at the corresponding positions after the projection of the set of points corresponding to the projection range array point information of the plane to be processed.
[0064] Optionally, the steps described above, which involve querying the boundary information corresponding to the scene model surface through the target array region and the zero-height plane point set and sampling it to obtain the initial surface vertex set and the point set of the zero-height plane projection, include: querying the scene model surface through the target array region and obtaining the row and column data of the outer side of the corresponding grid, the current row and column data, and the last row and last column data to obtain the boundary information corresponding to the scene model surface; obtaining the vertex displacement information corresponding to the boundary information of the scene model surface; attaching the plane to be processed to the scene model surface and obtaining the initial blending value after attachment, wherein the initial blending value is the value of the plane to be processed. After attaching to the surface to be fitted, the blending value is obtained when the number of blending rows is greater than the preset number of rows. The initial blending value is interpolated to obtain the target blending value. Based on the target blending value and the boundary information corresponding to the scene model surface, the set of points corresponding to the point set of the projection range array point information in the scene model surface (i.e., the initial surface vertex set) and the set of points projected onto the zero-height plane from the initial surface vertex set (i.e., the set of points projected onto the zero-height plane) are determined. Furthermore, the space corresponding to the boundary information of the scene model surface is converted into world space, and the position information of the world space is converted into local space. The initial surface vertex set and the set of points projected onto the zero-height plane are determined from the local space using the target blending value.
[0065] Optionally, the steps described above for iteratively judging the set of points on the zero-height plane and the set of points projected onto the zero-height plane, and searching for the initial set of surface vertices to obtain the set of points to be snapped up include: iteratively judging the set of points on the zero-height plane and the set of points projected onto the zero-height plane to obtain the point with the smallest distance from the set of points projected onto the zero-height plane to the set of points on the zero-height plane, i.e., the target nearest point set; querying the target nearest point set to obtain the set of points on the scene model surface corresponding to the target nearest point set, i.e., the set of points to be snapped up.
[0066] For ease of understanding, such as Figure 4 As shown, taking one point in each set as an example, point A is a point in the set corresponding to the projection range array point information of the plane to be processed, point B is a point in the set of points to be snapped, and point C is a point in the set of zero-height plane points. The positions of points A, B and C are corresponding, that is, after the plane to be processed is projected onto the scene model surface, points A and B coincide, and points A and B can both be projected onto point C.
[0067] By using boundary information query, vertex sampling, loop judgment and search, the accuracy of the set of points to be adsorbed is improved.
[0068] Step 204: Project and map the set of points corresponding to the projection range array points in the plane to be processed to the set of points to be absorbed to obtain the candidate plane.
[0069] In one implementation, step 204 specifically includes: obtaining the world coordinate information of each array point in the point set corresponding to the projection range array point information, and the world coordinate information, normal information, and tangent information of each point to be absorbed in the set of points to be absorbed; matching the world coordinate information of each array point to the world coordinate information of each point to be absorbed, and copying the normal information and tangent information of each point to be absorbed to the point information of the array point corresponding to each point to be absorbed, thereby obtaining a candidate plane.
[0070] Optionally, the space corresponding to the point set corresponding to the projection range array point information is converted into world space. The world coordinate system of the world space is used to determine the world coordinate information of each array point in the point set corresponding to the projection range array point information. The world coordinate information of each point to be absorbed is determined using the world coordinate system of the world space corresponding to the set of points to be absorbed. The vectors of each point to be absorbed in the set of points to be absorbed are obtained and converted into local space vectors. Other surface vectors corresponding to the scene model surface (other surface vectors are vectors of surfaces other than the scene model surface) are obtained and converted into world space. The normal and tangent information of each point to be absorbed are determined using the world space and local space vectors. The world coordinate information of each array point on the plane to be processed is updated to the world coordinate information of the corresponding point to be absorbed. The normal and tangent information of each point to be absorbed are copied to the point information of the array points corresponding to each point to be absorbed, thus obtaining the candidate plane. The candidate plane is as follows: Figure 5 As shown.
[0071] By matching world coordinate information, normal information, and tangent information, surface fitting is achieved, avoiding the manual carving process after subdividing the surface. This helps to effectively improve the surface details and accuracy of the scene model, as well as its improved accuracy and stability.
[0072] Step 205: If the candidate plane meets the preset conditions, then the candidate plane is determined as the fitted plane.
[0073] Optionally, obtain the display frame rate (Frames Per Second, FPS) data of the UE engine. If the FPS data meets the preset performance consumption conditions, and the slope of the candidate plane and the scene model surface are closely coincident when viewed from multiple angles, then the candidate plane is determined to meet the preset conditions and is identified as the fitted plane. If the FPS data does not meet the preset performance consumption conditions, and / or the slope of the candidate plane and the scene model surface are not closely coincident when viewed from multiple angles, then the candidate plane is determined to not meet the preset conditions. The plane to be processed is then re-projected and mapped onto the scene model surface, that is, the execution process of steps 202-204 above is repeated until the newly obtained candidate plane meets the preset conditions, thereby obtaining the fitted plane.
[0074] By sampling the vertex of the target array region and judging the effects of point set adsorption and projection mapping, the model's front surface detail processing is achieved through surface fitting, providing accuracy and stability for the model's front surface detail processing.
[0075] Step 206: Perform regional information processing on the fitted plane to obtain the target plane.
[0076] In one implementation, step 206 specifically includes: dividing the fitted plane into regions to obtain regions to be replaced and regions to be merged; obtaining the target height value of a specified height map and determining the replacement information of the regions to be replaced using the target height value; processing the vertices of the regions to be replaced in the fitted plane using the replacement information to obtain the replaced plane; obtaining the target axis information of the replaced plane, where the target axis information is the specified axis information of the local space of the regions to be merged; and performing fusion processing on the replaced plane using the target axis information to obtain the target plane.
[0077] As an example, and not a limitation, the fitted plane is divided into regions in the X-plane, the Y-plane, and the Z-axis longitudinal direction. The X-plane and Y-plane regions each comprise four regions, such as... Figure 6 As shown, the region to be replaced is Figure 6 The region where Z is located is the region to be merged. Figure 6 The region containing X and Y. By applying permutation information to the region to be permuted in the Z direction of the fitted plane, and then applying the permutation information to the vertices of the fitted plane, a new, richly detailed terrain can be obtained, i.e., the permuted plane. The resulting image is shown below. Figure 7 As shown, the process involves blending the area to be blended on the replaced plane with the curved surface of the scene model.
[0078] The steps of obtaining the target axis information of the permuted plane, wherein the target axis information is the specified axis information of the local space of the region to be merged, include: converting the permuted plane into world space, converting the position information of the world space into local space, obtaining the specified axis information of the region to be merged in the local space, and obtaining the target axis information; or, converting the region to be merged into world space, converting the position information of the world space into local space, obtaining the specified axis information in the local space, and obtaining the target axis information.
[0079] The specified axis information of the local space of the region to be merged can be the Y-axis information of the local space of the region to be merged. The plane after the displacement is converted into world space, the position information of the world space is converted into local space, and the Y-axis information of the region to be merged in the local space is obtained to obtain the target axis information; or, the region to be merged is converted into world space, the position information of the world space is converted into local space, and the Y-axis information in the local space is obtained to obtain the target axis information.
[0080] By specifying the target height value of the height map for displacement processing of the area to be replaced, as well as planar blending processing, the manual sculpting and retopology baking operations after subdividing the surface are avoided, which can quickly improve the detail and accuracy of the front surface of the scene model.
[0081] In one implementation, the steps of obtaining the target height value of a specified height map and determining the displacement information of the region to be displaced based on the target height value include: obtaining a specified height map; processing the specified height map to obtain a processed height map; mapping the fitted planar texture to the processed height map and sampling based on the texture direction to obtain a target height value; obtaining the maximum height value of the processed height map and scaling it using the maximum height value and the target height value to obtain displacement information.
[0082] As an example, and not a limitation, the specified height map mentioned above can be a height map of the ground after slope erosion. This is achieved by creating a height map of the level ground (the model corresponding to the virtual scene curves) after slope erosion using pre-built 3D terrain generation software or plugins (e.g., Worldcreate). This is the specified height map. Figure 8 As shown, the height map after surface slope erosion is extracted and exported, as follows. Figure 9 As shown. The steps described above for processing the height map to obtain the processed height map include: applying the height map and setting the displacement intensity; storing the height map data after setting the displacement intensity as a built-in custom class USurfaceMeshTasks, which has the function of real-time computation and processing of height map data; obtaining the pixel data of the height map, and performing cyclic processing on the pixel data through multiple preset channels to obtain the processed height map; and converting the processed pixel data into linear color data.
[0083] As an example, and not a limitation, the fitted planar texture is mapped (UV mapping) to the processed height map to obtain the mapped height map; linear color data corresponding to the UV positions of the vertices of the fitted plane are read from the mapped height map; the linear color data is sampled based on the range of the UV direction and continuous, smooth values are calculated to obtain sampled data; the mean of the sampled data is calculated to obtain the average value; a second smoothing process is performed on the average value to obtain the target height value; the maximum height value of the height texture corresponding to the height map is obtained; the maximum height value and the target height value are scaled on the Y-axis to obtain the displacement information.
[0084] By obtaining displacement information through texture mapping, texture direction sampling, and scaling, the height map pixels are made consistent with the fitted plane, and sharp information is removed to obtain a smoother height value. This allows the fitted plane to obtain new terrain with rich details, effectively improving the detail and accuracy of the scene model surface.
[0085] In one implementation, the step of fusing the displaced plane with the target axis information of the displaced plane to obtain the target plane includes: smoothing the target axis information in the displaced plane to obtain a smoothed plane; placing the smoothed plane in reverse on the scene model surface to obtain an adjusted plane; and extending and offsetting the adjusted plane to obtain the target plane.
[0086] As an example, and not a limitation, the local spatial Y-axis information (i.e., target axis information) of points in the XY region (the region to be merged) of the displaced plane is smoothed using displacement information (i.e., region gradient information) to obtain a smoothed plane. This smoothed plane is then placed inverted onto the scene model surface to obtain an adjusted plane. Because there is incomplete fitting and model overlap along the edge fitting directions of the X and Y planes, display issues arise. Therefore, it is necessary to repair the Z-values of the edge fitting and perform offset extension processing on the edge fitting positions. This is achieved by smoothing the Z-values of the coordinate axes of points in the XY region (the region to be merged) of the displaced plane using displacement information (i.e., region gradient information) to gradually reduce the Z-values, resulting in the target plane. Points closer to the Z-region experience a smaller reduction in their Z-values, while points further away from the edge experience a larger reduction, thus achieving edge indentation below the level ground. The target plane is as follows: Figure 10 As shown.
[0087] By using smoothing and planar extension offset processing, the display problem caused by incomplete fitting was solved, and the surface details of the model were preserved to the greatest extent, thereby improving the detail and accuracy of the scene model surface.
[0088] Step 207: Perform entity transformation through the target plane to obtain the target scene model.
[0089] In one implementation, step 207 specifically includes: copying the target plane to obtain a copied plane, and obtaining the vertex information of the target plane; assigning the vertex information of the target plane to the copied plane, and deleting the target plane to obtain the plane to be reconstructed; rendering the texture and material of the plane to be reconstructed to obtain the target scene model.
[0090] As an example, and not a limitation, since the target plane has displacement information, a meshN with the same subdivision as the target plane is copied to obtain a copied plane. The vertex information of the target plane is passed to the meshN, and the target plane is deleted, thus obtaining a meshN that fits the level ground (i.e., the scene model surface), which is the plane to be reconstructed. Texture UVs and materials are rendered on the plane to be reconstructed to obtain the target scene model. The obtained target scene model adds many rich details to the original effect and almost fits together, resulting in a significant improvement in effect, such as... Figure 11 As shown, Figure 11 (1) in the figure represents a portion of the positive surface of the original scene model (i.e., the scene model to be optimized or reconstructed). Figure 11 (2) in the model is a partial positive surface of the target scene model.
[0091] By reconstructing the target plane and transforming entities, the level of detail in the scene model is effectively improved, and it also has high accuracy and stability.
[0092] The above-mentioned method for generating scene models can effectively and quickly improve the refinement of scene models by surface fitting, plane adaptation and replacement, and reconstruction of the front surface (i.e. the plane to be processed) of the scene model, and has high accuracy and stability, thus effectively improving the optimization efficiency of scene models.
[0093] For the corresponding method embodiments described above, see [link to relevant documentation]. Figure 12 The diagram shows a scene model generation device, which includes:
[0094] Create module 1201 to create a plane of the target type to be processed and acquire the surface of the scene model;
[0095] The fitting module 1202 is used to fit the plane to be processed through the curved surface of the scene model to obtain the fitted plane.
[0096] The permutation fusion module 1203 is used to perform regional information processing on the fitted plane to obtain the target plane;
[0097] The reconstruction and transformation module 1204 is used to perform entity transformation based on the target plane to obtain the target scene model.
[0098] The aforementioned scene model generation device can effectively and quickly improve the refinement of the scene model by performing surface fitting, plane adaptation and replacement, and reconstruction on the front surface (i.e. the plane to be processed) of the scene model, and has high accuracy and stability, thus effectively improving the optimization efficiency of the scene model.
[0099] Optionally, the creation and acquisition module 1201 can also be specifically used for:
[0100] Create an initial plane of the target type and extract the corresponding level ground information from the preset collision detection information to obtain the scene model surface;
[0101] Based on the slope direction of the scene model surface, the initial plane is rotated to obtain the plane to be processed.
[0102] Optionally, the fitting module 1202 includes:
[0103] The first determining unit 12021 is used to acquire the projection range array point information of the plane to be processed, and to determine the target array region through the projection range array point information.
[0104] The sampling unit 12022 is used to sample the vertex of the scene model surface based on the target array region to obtain a set of points to be attracted.
[0105] The projection mapping unit 12023 is used to project and map the set of points corresponding to the projection range array point information in the plane to be processed to the set of points to be adsorbed, so as to obtain the candidate plane.
[0106] The second determining unit 12024 is used to determine the candidate plane as the fitted plane if the candidate plane meets the preset conditions.
[0107] Optionally, the sampling unit 12022 can also be specifically used for:
[0108] Obtain the corresponding set of zero-height plane points by using the array point information of the projection range of the plane to be processed;
[0109] By querying the boundary information corresponding to the scene model surface through the target array region and the zero-height plane point set, and sampling it, the initial surface vertex set and the point set of the zero-height plane projection are obtained.
[0110] The set of points on the zero-height plane and the set of points projected onto the zero-height plane are iteratively evaluated, and the set of vertices on the initial surface is searched to obtain the set of points to be attracted.
[0111] Optionally, the projection mapping unit 12023 can also be specifically used for:
[0112] Obtain the world coordinate information of each array point in the point set corresponding to the projection range array point information, as well as the world coordinate information, normal information, and tangent information of each point to be snapped in the point set to be snapped;
[0113] The world coordinate information of each array point is matched with the world coordinate information of each point to be adsorbed, and the normal and tangent information of each point to be adsorbed are copied to the point information of the array point corresponding to each point to be adsorbed, thus obtaining the candidate plane.
[0114] Optionally, the displacement fusion module 1203 includes:
[0115] The partitioning unit 12031 is used to divide the fitted plane into regions to obtain the regions to be replaced and the regions to be merged.
[0116] The third determining unit 12032 is used to obtain the target height value of the specified height map and determine the replacement information of the area to be replaced by the target height value;
[0117] The processing unit 12033 is used to process the vertices of the region to be replaced in the fitted plane using the permutation information to obtain the permuted plane;
[0118] The acquisition unit 12034 is used to acquire the target axis information of the replaced plane, wherein the target axis information is the specified axis information of the local space of the region to be fused;
[0119] The fusion unit 12035 is used to perform fusion processing on the substituted plane using the target axis information of the substituted plane to obtain the target plane.
[0120] Optionally, the third determining unit 12032 can also be specifically used for:
[0121] Get a texture map at a specified height, process the texture map at the specified height, and obtain a processed texture map;
[0122] The fitted planar texture is mapped to the processed height map, and the target height value is obtained by sampling based on the texture direction;
[0123] Obtain the maximum height value of the processed height map, and scale it using the maximum height value and the target height value to obtain the displacement information.
[0124] Optionally, the fusion unit 12035 can also be specifically used for:
[0125] The target axis information in the replaced plane is smoothed to obtain a smoothed plane.
[0126] The smoothed plane is inverted and placed on the curved surface of the scene model to obtain the adjusted plane;
[0127] The adjusted plane is extended and offset to obtain the target plane.
[0128] Optionally, the reconstruction conversion module 1204 can also be specifically used for:
[0129] The target plane is copied to obtain the copied plane, and the vertex information of the target plane is obtained;
[0130] Assign the vertex information of the target plane to the copy plane, and delete the target plane to obtain the plane to be reconstructed;
[0131] The reconstructed plane is rendered with textures and materials to obtain the target scene model.
[0132] This embodiment also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the above-described method for generating the scene model. This electronic device can be a server or a terminal device.
[0133] See Figure 13 As shown, the electronic device includes a processor 1300 and a memory 1301. The memory 1301 stores machine-executable instructions that can be executed by the processor 1300. The processor 1300 executes the machine-executable instructions to implement the above-mentioned method for generating the scene model.
[0134] Furthermore, Figure 13 The electronic device shown also includes a bus 1302 and a communication interface 1303. The processor 1300, the communication interface 1303 and the memory 1301 are connected via the bus 1302.
[0135] The memory 1301 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 1303 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 1302 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 13 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0136] The processor 1300 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 1300 or by instructions in software form. The processor 1300 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the field. This storage medium is located in memory 1301. Processor 1300 reads information from memory 1301 and, in conjunction with its hardware, completes the following steps:
[0137] Create a plane of the target type to be processed, and obtain the scene model surface;
[0138] The plane to be processed is fitted by the surface of the scene model to obtain the fitted plane;
[0139] The fitted plane is processed to obtain the target plane by performing regional information processing.
[0140] Entity transformation is performed based on the target plane to obtain the target scene model.
[0141] By performing surface fitting, plane adaptation and replacement, and reconstruction on the front surface (i.e. the plane to be processed) of the scene model, the refinement of the scene model can be effectively and quickly improved, with high accuracy and stability, thus effectively improving the optimization efficiency of the scene model.
[0142] The steps described above for creating the target type of plane to be processed and obtaining the scene model surface include:
[0143] Create an initial plane of the target type and extract the corresponding level ground information from the preset collision detection information to obtain the scene model surface;
[0144] Based on the slope direction of the scene model surface, the initial plane is rotated to obtain the plane to be processed.
[0145] Creating an initial plane of the target type facilitates surface detail processing and enhances its functionality, thereby improving processing efficiency. Rotating the initial plane expands the projected area, effectively enabling the processing of increased planar details.
[0146] The steps described above for fitting the plane to be processed using the surface of the scene model to obtain the fitted plane include:
[0147] Obtain the projection range array point information of the plane to be processed, and determine the target array region through the projection range array point information;
[0148] Vertex sampling is performed on the surface of the scene model based on the target array region to obtain the set of points to be attracted;
[0149] The point set corresponding to the projection range array point information in the plane to be processed is projected and mapped to the set of points to be adsorbed to obtain the candidate plane;
[0150] If a candidate plane meets the preset conditions, then the candidate plane is determined as the fitted plane.
[0151] By sampling the vertex of the target array region and judging the effects of point set adsorption and projection mapping, the model's front surface detail processing is achieved through surface fitting, providing accuracy and stability for the model's front surface detail processing.
[0152] The above steps for sampling vertices of the scene model surface based on the target array region to obtain the set of points to be snapped in include:
[0153] Obtain the corresponding set of zero-height plane points by using the array point information of the projection range of the plane to be processed;
[0154] By querying the boundary information corresponding to the scene model surface through the target array region and the zero-height plane point set, and sampling it, the initial surface vertex set and the point set of the zero-height plane projection are obtained.
[0155] The set of points on the zero-height plane and the set of points projected onto the zero-height plane are iteratively evaluated, and the set of vertices on the initial surface is searched to obtain the set of points to be attracted.
[0156] By using boundary information query, vertex sampling, and iterative judgment and query, the accuracy of the set of points to be attracted is improved.
[0157] The above-described steps of projecting and mapping the set of points corresponding to the array points of the projection range in the plane to be processed to the set of points to be adsorbed, to obtain the candidate plane, include:
[0158] Obtain the world coordinate information of each array point in the point set corresponding to the projection range array point information, as well as the world coordinate information, normal information, and tangent information of each point to be snapped in the point set to be snapped;
[0159] The world coordinate information of each array point is matched with the world coordinate information of each point to be adsorbed, and the normal and tangent information of each point to be adsorbed are copied to the point information of the array point corresponding to each point to be adsorbed, thus obtaining the candidate plane.
[0160] By matching world coordinate information, normal information, and tangent information, surface fitting is achieved, avoiding the manual carving process after subdividing the surface. This helps to effectively improve the surface details and accuracy of the scene model, as well as its improved accuracy and stability.
[0161] The steps described above for processing the region information of the fitted plane to obtain the target plane include:
[0162] The fitted plane is divided into regions to be replaced and regions to be merged.
[0163] Obtain the target height value of a specified height map, and determine the displacement information of the area to be replaced based on the target height value;
[0164] The permutation information is used to process the vertices of the region to be permuted in the fitted plane to obtain the permuted plane;
[0165] Obtain the target axis information of the replaced plane. The target axis information is the specified axis information of the local space of the region to be fused.
[0166] The target plane is obtained by fusing the replaced plane with the target axis information.
[0167] By specifying the target height value of the height map for displacement processing of the area to be replaced, as well as planar blending processing, the manual sculpting and retopology baking operations after subdividing the surface are avoided, which can quickly improve the detail and accuracy of the front surface of the scene model.
[0168] The steps described above for obtaining the target height value of a specified height map and determining the displacement information of the region to be displaced based on the target height value include:
[0169] Get a texture map at a specified height, process the texture map at the specified height, and obtain a processed texture map;
[0170] The fitted planar texture is mapped to the processed height map, and the target height value is obtained by sampling based on the texture direction;
[0171] Obtain the maximum height value of the processed height map, and scale it using the maximum height value and the target height value to obtain the displacement information.
[0172] By obtaining displacement information through texture mapping, texture direction sampling, and scaling, the height map pixels are made consistent with the fitted plane, and sharp information is removed to obtain a smoother height value. This allows the fitted plane to obtain new terrain with rich details, effectively improving the detail and accuracy of the scene model surface.
[0173] The steps described above, which involve fusing the displaced plane with its target axis information to obtain the target plane, include:
[0174] The target axis information in the replaced plane is smoothed to obtain a smoothed plane.
[0175] The smoothed plane is inverted and placed on the curved surface of the scene model to obtain the adjusted plane;
[0176] The adjusted plane is extended and offset to obtain the target plane.
[0177] By using smoothing and planar extension offset processing, the display problem caused by incomplete fitting was solved, and the surface details of the model were preserved to the greatest extent, thereby improving the detail and accuracy of the scene model surface.
[0178] The steps described above for entity transformation based on the target plane to obtain the target scene model include:
[0179] The target plane is copied to obtain the copied plane, and the vertex information of the target plane is obtained;
[0180] Assign the vertex information of the target plane to the copy plane, and delete the target plane to obtain the plane to be reconstructed;
[0181] The reconstructed plane is rendered with textures and materials to obtain the target scene model.
[0182] By reconstructing the target plane and transforming entities, the level of detail in the scene model is effectively improved, and it also has high accuracy and stability.
[0183] This embodiment also provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to implement the following steps of the above-described method for generating the scene model:
[0184] Create a plane of the target type to be processed, and obtain the scene model surface;
[0185] The plane to be processed is fitted by the surface of the scene model to obtain the fitted plane;
[0186] The fitted plane is processed to obtain the target plane by performing regional information processing.
[0187] Entity transformation is performed based on the target plane to obtain the target scene model.
[0188] By performing surface fitting, plane adaptation and replacement, and reconstruction on the front surface (i.e. the plane to be processed) of the scene model, the refinement of the scene model can be effectively and quickly improved, with high accuracy and stability, thus effectively improving the optimization efficiency of the scene model.
[0189] The steps described above for creating the target type of plane to be processed and obtaining the scene model surface include:
[0190] Create an initial plane of the target type and extract the corresponding level ground information from the preset collision detection information to obtain the scene model surface;
[0191] Based on the slope direction of the scene model surface, the initial plane is rotated to obtain the plane to be processed.
[0192] Creating an initial plane of the target type facilitates surface detail processing and enhances its functionality, thereby improving processing efficiency. Rotating the initial plane expands the projected area, effectively enabling the processing of increased planar details.
[0193] The steps described above for fitting the plane to be processed using the surface of the scene model to obtain the fitted plane include:
[0194] Obtain the projection range array point information of the plane to be processed, and determine the target array region through the projection range array point information;
[0195] Vertex sampling is performed on the surface of the scene model based on the target array region to obtain the set of points to be attracted;
[0196] The point set corresponding to the projection range array point information in the plane to be processed is projected and mapped to the set of points to be adsorbed to obtain the candidate plane;
[0197] If a candidate plane meets the preset conditions, then the candidate plane is determined as the fitted plane.
[0198] By sampling the vertex of the target array region and judging the effects of point set adsorption and projection mapping, the model's front surface detail processing is achieved through surface fitting, providing accuracy and stability for the model's front surface detail processing.
[0199] The above steps for sampling vertices of the scene model surface based on the target array region to obtain the set of points to be snapped in include:
[0200] Obtain the corresponding set of zero-height plane points by using the array point information of the projection range of the plane to be processed;
[0201] By querying the boundary information corresponding to the scene model surface through the target array region and the zero-height plane point set, and sampling it, the initial surface vertex set and the point set of the zero-height plane projection are obtained.
[0202] The set of points on the zero-height plane and the set of points projected onto the zero-height plane are iteratively evaluated, and the set of vertices on the initial surface is searched to obtain the set of points to be attracted.
[0203] By using boundary information query, vertex sampling, loop judgment and search, the accuracy of the set of points to be adsorbed is improved.
[0204] The above-described steps of projecting and mapping the set of points corresponding to the array points of the projection range in the plane to be processed to the set of points to be adsorbed, to obtain the candidate plane, include:
[0205] Obtain the world coordinate information of each array point in the point set corresponding to the projection range array point information, as well as the world coordinate information, normal information, and tangent information of each point to be snapped in the point set to be snapped;
[0206] The world coordinate information of each array point is matched with the world coordinate information of each point to be adsorbed, and the normal and tangent information of each point to be adsorbed are copied to the point information of the array point corresponding to each point to be adsorbed, thus obtaining the candidate plane.
[0207] By matching world coordinate information, normal information, and tangent information, surface fitting is achieved, avoiding the manual carving process after subdividing the surface. This helps to effectively improve the surface details and accuracy of the scene model, as well as its improved accuracy and stability.
[0208] The steps described above for processing the region information of the fitted plane to obtain the target plane include:
[0209] The fitted plane is divided into regions to be replaced and regions to be merged.
[0210] Obtain the target height value of a specified height map, and determine the displacement information of the area to be replaced based on the target height value;
[0211] The permutation information is used to process the vertices of the region to be permuted in the fitted plane to obtain the permuted plane;
[0212] Obtain the target axis information of the replaced plane. The target axis information is the specified axis information of the local space of the region to be fused.
[0213] The target plane is obtained by fusing the replaced plane with the target axis information.
[0214] By specifying the target height value of the height map for displacement processing of the area to be replaced, as well as planar blending processing, the manual sculpting and retopology baking operations after subdividing the surface are avoided, which can quickly improve the detail and accuracy of the front surface of the scene model.
[0215] The steps described above for obtaining the target height value of a specified height map and determining the displacement information of the region to be displaced based on the target height value include:
[0216] Get a texture map at a specified height, process the texture map at the specified height, and obtain a processed texture map;
[0217] The fitted planar texture is mapped to the processed height map, and the target height value is obtained by sampling based on the texture direction;
[0218] Obtain the maximum height value of the processed height map, and scale it using the maximum height value and the target height value to obtain the displacement information.
[0219] By obtaining displacement information through texture mapping, texture direction sampling, and scaling, the height map pixels are made consistent with the fitted plane, and sharp information is removed to obtain a smoother height value. This allows the fitted plane to obtain new terrain with rich details, effectively improving the detail and accuracy of the scene model surface.
[0220] The steps described above, which involve fusing the displaced plane with its target axis information to obtain the target plane, include:
[0221] The target axis information in the replaced plane is smoothed to obtain a smoothed plane.
[0222] The smoothed plane is inverted and placed on the curved surface of the scene model to obtain the adjusted plane;
[0223] The adjusted plane is extended and offset to obtain the target plane.
[0224] By using smoothing and planar extension offset processing, the display problem caused by incomplete fitting was solved, and the surface details of the model were preserved to the greatest extent, thereby improving the detail and accuracy of the scene model surface.
[0225] The steps described above for entity transformation based on the target plane to obtain the target scene model include:
[0226] The target plane is copied to obtain the copied plane, and the vertex information of the target plane is obtained;
[0227] Assign the vertex information of the target plane to the copy plane, and delete the target plane to obtain the plane to be reconstructed;
[0228] The reconstructed plane is rendered with textures and materials to obtain the target scene model.
[0229] By reconstructing the target plane and transforming entities, the level of detail in the scene model is effectively improved, and it also has high accuracy and stability.
[0230] The computer program product of the scene model generation method, apparatus, electronic device and storage medium provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0231] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0232] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0233] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0234] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0235] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for generating a scene model, characterized in that, The method includes: Create a plane of the target type to be processed, and obtain the scene model surface; The scene model surface is fitted to the plane to be processed to obtain the fitted plane. The fitted plane is processed to obtain the target plane. Based on the target plane, entity transformation is performed to obtain the target scene model; The step of processing the fitted plane to obtain the target plane includes: dividing the fitted plane into regions to obtain regions to be replaced and regions to be merged; obtaining the target height value of a specified height map, and determining the replacement information of the regions to be replaced using the target height value; processing the vertices of the regions to be replaced in the fitted plane using the replacement information to obtain a replaced plane; obtaining the target axis information of the replaced plane, wherein the target axis information is the specified axis information of the local space of the regions to be merged; and performing fusion processing on the replaced plane using the target axis information to obtain the target plane.
2. The method according to claim 1, characterized in that, The steps of creating a target-type plane to be processed and obtaining the scene model surface include: Create an initial plane of the target type and extract the corresponding level ground information from the preset collision detection information to obtain the scene model surface; Based on the slope direction of the scene model surface, the initial plane is rotated to obtain the plane to be processed.
3. The method according to claim 1, characterized in that, The step of fitting the scene model surface to the plane to be processed to obtain the fitted plane includes: Obtain the projection range array point information of the plane to be processed, and determine the target array region through the projection range array point information; Vertex sampling is performed on the surface of the scene model based on the target array region to obtain a set of points to be attracted. The point set corresponding to the projection range array point information in the plane to be processed is projected and mapped to the set of points to be adsorbed to obtain a candidate plane; If the candidate plane meets the preset conditions, then the candidate plane is determined as the fitted plane.
4. The method according to claim 3, characterized in that, The step of sampling the vertex of the scene model surface based on the target array region to obtain the set of points to be attracted includes: The corresponding set of zero-height plane points is obtained by using the projection range array point information of the plane to be processed; By querying the boundary information corresponding to the scene model surface through the target array region and the zero-height plane point set, and sampling it, the initial surface vertex set and the point set of the zero-height plane projection are obtained; The set of points on the zero-height plane and the set of points projected onto the zero-height plane are iteratively evaluated, and the set of vertices on the initial surface is searched to obtain the set of points to be attracted.
5. The method according to claim 3, characterized in that, The step of projecting and mapping the set of points corresponding to the projection range array points in the plane to be processed to the set of points to be adsorbed to obtain a candidate plane includes: Obtain the world coordinate information of each array point in the point set corresponding to the projection range array point information, as well as the world coordinate information, normal information, and tangent information of each point to be adsorbed in the set of points to be adsorbed; The world coordinate information of each array point is matched with the world coordinate information of each point to be adsorbed, and the normal and tangent information of each point to be adsorbed are copied to the point information of the array point corresponding to each point to be adsorbed, thus obtaining the candidate plane.
6. The method according to claim 1, characterized in that, The step of obtaining the target height value of a specified height map and determining the displacement information of the region to be displaced based on the target height value includes: Obtain a specified height texture, process the specified height texture to obtain a processed height texture; The fitted planar texture is mapped onto the processed height map, and the target height value is obtained by sampling based on the texture direction; Obtain the maximum height value of the processed height map, and scale it using the maximum height value and the target height value to obtain displacement information.
7. The method according to claim 1, characterized in that, The step of fusing the displaced plane using the target axis information of the displaced plane to obtain the target plane includes: The target axis information in the replaced plane is smoothed to obtain a smoothed plane. The smoothed plane is then placed in reverse on the curved surface of the scene model to obtain the adjusted plane; The adjusted plane is extended and offset to obtain the target plane.
8. The method according to any one of claims 1-7, characterized in that, The step of performing entity transformation based on the target plane to obtain the target scene model includes: The target plane is copied to obtain a copied plane, and the vertex information of the target plane is obtained; Assign the vertex information of the target plane to the copied plane, and delete the target plane to obtain the plane to be reconstructed; The plane to be reconstructed is rendered with textures and materials to obtain the target scene model.
9. A scene model generation device, characterized in that, The device for generating the scene model includes: Create an acquisition module to create a plane of the target type to be processed and acquire the surface of the scene model; The fitting module is used to fit the plane to be processed using the curved surface of the scene model to obtain the fitted plane. The permutation fusion module is used to process the region information of the fitted plane to obtain the target plane. The reconstruction and transformation module is used to perform entity transformation through the target plane to obtain the target scene model; The step of processing the fitted plane to obtain the target plane includes: dividing the fitted plane into regions to obtain regions to be replaced and regions to be merged; obtaining the target height value of a specified height map, and determining the replacement information of the regions to be replaced using the target height value; processing the vertices of the regions to be replaced in the fitted plane using the replacement information to obtain a replaced plane; obtaining the target axis information of the replaced plane, wherein the target axis information is the specified axis information of the local space of the regions to be merged; and performing fusion processing on the replaced plane using the target axis information to obtain the target plane.
10. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the method for generating a scene model according to any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the method for generating a scene model according to any one of claims 1-8.
Citation Information
Patent Citations
Real landform fast modeling method and landslide visualization technology
CN107403459A
Virtual scene processing method and device, computer equipment and storage medium
CN116271808A