Virtual scene model processing method and device, computer equipment and storage medium
By reducing the surface of the polygon mesh of the virtual scene model, resources with physical functions are generated, which solves the problem of low efficiency in setting physical resources of the virtual scene model in the existing technology, and realizes the effect of automated batch generation and multiplexing of physical resources.
Patent Information
- Application Number
- CN202311587872.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-24
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2043-11-24
AI Technical Summary
The prior art is inefficient and requires a lot of manpower when setting up physical resources for virtual scene models, and the physical resources produced cannot be reused, resulting in each virtual scene model that needs to create physical resources separately.
By reducing the surface of the polygon mesh of the target virtual scene model, the reduced surface of the virtual scene model is generated, and then physical resources with the target physical function are generated based on these models and mounted on the virtual scene model.
It realizes the automatic batch generation of physical resources for multiple virtual scene models, saves labor costs, improves the efficiency of physical resource settings, and can be reused.
Smart Images

Figure CN120037660A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, particularly to the field of game technology, and specifically relates to a method, device, computer device, and storage medium for processing virtual scene models. Background Art
[0002] With the continuous development of computer communication technology and the widespread application of terminals such as smart phones, tablet computers, and laptop computers, terminals are developing towards diversification and personalization, and are increasingly becoming indispensable terminals in people's lives and work. To meet people's pursuit of spiritual life, entertainment games that can be operated on terminals have emerged as the times require. For example, games such as multiplayer online battle arena games and massively multiplayer online games developed based on client or server architectures are deeply loved by users due to their high smoothness, good operation feel, and instant battles. With the booming development of online games, people's requirements for the realism of game scenes are getting higher and higher. To enable players to obtain a better game experience, many terminal games are often built based on real scenes and items in real scenes. Therefore, when designing games, the implementation of game resources such as virtual scenes and virtual elements in the game is expected to be closer to the real environment.
[0003] In actual game design projects, in order to make the game world more realistic, game production personnel often use game engines to produce game scenes. 3ds Max is a professional 3D modeling software that can be used for applications such as animation production and rendering, and can be used to produce 3D animations, models, interactive games, and visual effects for the entertainment industry. In the prior art, when performing game physics settings on virtual scene models or virtual object models, usually, art production personnel manually create a model in the 3ds Max software to simulate the physical shape of the scene static model, and then import it into the game engine for physical simulation. This requires manual modeling by art production personnel in 3D modeling DCCs such as 3DMax, resulting in high labor costs. Moreover, the produced physical resources cannot be reused, and art production personnel need to create physical resources separately for each virtual scene model, resulting in low efficiency in setting physical resources for virtual scene models or virtual object models. Summary of the Invention
[0004] An embodiment of the present application provides a method, apparatus, computer device, and storage medium for processing a virtual scene model. By performing decimation processing on the polygon meshes of the target virtual scene model, one or more decimated virtual scene models that can be used for physical resource production are obtained. Then, based on the decimated virtual scene model, a physical resource with a target physical function is generated and output to the game engine where the target virtual scene model is located for physical resource reference, thereby realizing the automated batch generation of physical resources for multiple virtual scene models, saving labor costs, and improving the efficiency of physical resource setting for virtual scene models.
[0005] An embodiment of the present application provides a method for processing a virtual scene model. The method includes:
[0006] Obtaining at least one target virtual scene model from a preset virtual scene space, where the target virtual scene model is composed of multiple polygon meshes;
[0007] Performing decimation processing on the polygon meshes of the target virtual scene model based on preset decimation parameters to obtain a processed virtual scene model;
[0008] Generating a target bounding box with a target physical function based on preset bounding box parameters and the model shape of the processed virtual scene model;
[0009] Mounting the target bounding box on the target virtual scene model to obtain a target virtual scene model with the target physical function.
[0010] Correspondingly, an embodiment of the present application further provides a processing apparatus for a virtual scene model. The processing apparatus for the virtual scene model includes:
[0011] An obtaining unit, configured to obtain at least one target virtual scene model from a preset virtual scene space, where the target virtual scene model is composed of multiple polygon meshes;
[0012] A first processing unit, configured to perform decimation processing on the polygon meshes of the target virtual scene model based on preset decimation parameters to obtain a processed virtual scene model;
[0013] A generating unit, configured to generate a target physical resource with a target physical function based on preset physical attribute parameters and the processed virtual scene model;
[0014] A second processing unit, configured to mount the target physical resource on the target virtual scene model to obtain a target virtual scene model with the target physical function.
[0015] Correspondingly, an embodiment of the present application further provides a computer device, including a processor, a memory, and a computer program stored on the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the processing method of the virtual scene model as described in any one of the above.
[0016] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the processing method of the virtual scene model as described in any one of the above.
[0017] An embodiment of the present application provides a processing method, device, computer device, and storage medium for a virtual scene model. By obtaining at least one target virtual scene model from a preset virtual scene space, where the target virtual scene model is composed of multiple polygon meshes; then, performing decimation processing on the polygon meshes of the target virtual scene model based on a preset decimation parameter to obtain a processed virtual scene model; then, generating a target physical resource with a target physical function based on the preset physical attribute parameter and the processed virtual scene model; finally, mounting the target physical resource onto the target virtual scene model to obtain a target virtual scene model with the target physical function. The embodiment of the present application can perform decimation processing on the polygon meshes of the target virtual scene model to obtain one or more decimated virtual scene models that can be used for physical resource production. Then, according to the decimated virtual scene model, a physical resource with a target physical function is generated and output to the game engine where the target virtual scene model is located for physical resource reference, thereby realizing the automated batch generation of corresponding physical resources for multiple virtual scene models, saving labor costs, improving physical interaction performance, and enhancing the physical resource generation efficiency of the virtual scene model. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0019] Figure 1 It is a system schematic diagram of a processing device for a virtual scene model provided by an embodiment of the present application.
[0020] Figure 2 It is a flowchart of a processing method for a virtual scene model provided by an embodiment of the present application.
[0021] Figure 3It is a schematic diagram of a scenario of the method for processing a virtual scene model provided by an embodiment of the present application.
[0022] Figure 4 It is another schematic diagram of a scenario of the method for processing a virtual scene model provided by an embodiment of the present application.
[0023] Figure 5 It is a schematic structural diagram of the apparatus for processing a virtual scene model provided by an embodiment of the present application.
[0024] Figure 6 It is a schematic structural diagram of the computer device provided by an embodiment of the present application. Detailed implementation manners
[0025] Next, the technical solutions in the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present application.
[0026] The embodiments of the present application provide a method, an apparatus, a computer device and a storage medium for processing a virtual scene model. Specifically, the method for processing a virtual scene model in the embodiments of the present application can be executed by a computer device, where the computer device can be a terminal. The terminal can be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC), a personal digital assistant (PDA), etc. The terminal can also include a client, and the client can be a video application client, a music application client, a game application client, a browser client with a game program, or an instant messaging client, etc.
[0027] Please refer to Figure 1 , Figure 1A scene schematic diagram of the processing system for the virtual scene model provided by the embodiments of the present application, including a computer device. The system may include at least one terminal, at least one server, and a network. The terminal held by the user can be connected to the servers of different games through the network. The terminal is any device with computing hardware that can support and execute software products corresponding to the games. Additionally, the terminal has one or more multi-touch sensitive screens for sensing and obtaining inputs of touch or swipe operations performed by the user at multiple points on one or more touch display screens. Additionally, when the system includes multiple terminals, multiple servers, and multiple networks, different terminals can be interconnected through different networks and different servers. The network can be a wireless network or a wired network. For example, the wireless network can be a wireless local area network (WLAN), local area network (LAN), cellular network, 2G network, 3G network, 4G network, 5G network, etc. Additionally, different terminals can also use their own Bluetooth network or hotspot network to connect to other terminals or to the server, etc.
[0028] Among them, the computer device can obtain at least one target virtual scene model from a preset virtual scene space. The target virtual scene model is composed of multiple polygon meshes. Then, based on a preset decimation parameter, decimation processing is performed on the polygon meshes of the target virtual scene model to obtain a processed virtual scene model. Next, based on preset physical attribute parameters and the processed virtual scene model, a target physical resource with a target physical function is generated. Finally, the target physical resource is mounted on the target virtual scene model to obtain a target virtual scene model with the target physical function. The embodiments of the present application can perform decimation processing on the polygon meshes of the target virtual scene model to obtain one or more decimated virtual scene models that can be used for physical resource production. Then, based on the decimated virtual scene models, physical resources with target physical functions are generated and output to the game engine where the target virtual scene model is located for physical resource reference, thereby realizing the automated batch generation of corresponding physical resources for multiple virtual scene models, saving labor costs, and improving the physical resource generation efficiency of virtual scene models.
[0029] It should be noted that Figure 1 The scene schematic diagram of the processing system for the virtual scene model shown is only an example. The processing system and scene of the virtual scene model described in the embodiments of the present application are for more clearly explaining the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art know that with the evolution of the processing system for virtual scene models and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
[0030] The method for processing a virtual scene model provided by an embodiment of the present application can use model-making application software. For example, 3D MAX (3D Studio MAX) can be used. 3D MAX is a three-dimensional animation rendering and production software based on a PC system and can be applied to the animation production of computer games and the special effect production of feature films, etc. Game producers can preset the size and shape of the model and create a virtual scene model in 3D MAX based on the preset model size and shape. Further, the method for processing a virtual scene model provided by an embodiment of the present application can also be used in DCC software. DCC software refers to "Digital Content Creation" software, which is a tool for creating, editing, and processing digital content. DCC software is usually used in fields such as film, animation, game development, virtual reality, and architectural visualization and can provide various functions, including modeling, animation, rendering, special effects, material editing, particle simulation, character animation, scene layout, etc., to help artists and designers create high-quality digital content. Common DCC software includes Autodesk Maya, Autodesk 3ds Max, Cinema 4D, Blender, Houdini, etc.
[0031] An embodiment of the present application provides a method, device, computer device, and storage medium for processing a virtual scene model. The method for processing the virtual scene model can be used in cooperation with a terminal, such as a smart phone, a tablet computer, a notebook computer, or a personal computer, etc. The following will detail the method, device, computer device, and storage medium for processing the virtual scene model. It should be noted that the description order of the following embodiments does not limit the preferred order of the embodiments.
[0032] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of a method for processing a virtual scene model provided by an embodiment of the present application. The specific process can be as follows: steps 101 to 104:
[0033] 101. Obtain at least one target virtual scene model from a preset virtual scene space, where the target virtual scene model is composed of a plurality of polygon meshes.
[0034] In an embodiment of the present application, after the step of "obtaining at least one target virtual scene model from a preset virtual scene space", it further includes:
[0035] Export the target virtual scene model from the virtual scene space through a file export interface corresponding to a first file format to obtain a model file in the first file format corresponding to the target virtual scene model.
[0036] Specifically, all virtual scene models in the preset virtual scene space can be exported through the file export interface (FBX API) corresponding to the first file format, that is, all virtual scene models are exported from the virtual scene space to obtain model files (i.e., FBX files) in the first file format corresponding to multiple virtual scene models.
[0037] Among them, the file export interface corresponding to the first file format can be FBX API. FBX API is a set of interfaces provided by Autodesk for modifying FBX properties. Specifically, FBX API is a set of application programming interfaces (APIs) for processing the FBX (Filmbox) file format. Further, FBX is a file format for exchanging and storing 3D models, animations, and related data, developed and maintained by Autodesk. FBX API allows developers to access and operate on the content of FBX files in applications. By using FBX API, developers can read, write, and modify various elements such as objects, materials, textures, animations, and skeletons of virtual scene models in FBX files. At the same time, custom tools and scripts can also be created to automate the processing of FBX files, such as importing and exporting models, converting animations, and editing materials. FBX API also provides access and parsing functions for the FBX file structure so that developers can understand and operate on the hierarchical structure and data relationships of the file.
[0038] 102. Perform decimation processing on the polygon mesh of the target virtual scene model based on the preset decimation parameters to obtain the processed virtual scene model.
[0039] In the embodiment of the present application, for the step of "performing decimation processing on the polygon mesh of the target virtual scene model based on the preset decimation parameters to obtain the processed virtual scene model", the method may include:
[0040] Call the decimation function interface to perform decimation processing on the polygon mesh of the target virtual scene model corresponding to the model file to obtain the processed virtual scene model and the model file in the second file format corresponding to the processed virtual scene model.
[0041] Specifically, the decimation function interface (python api provided by Simplygon) can be called to perform decimation processing on the polygon mesh of the virtual scene model corresponding to the model file (i.e., FBX file) in the first file format corresponding to multiple virtual scene models to obtain the processed virtual scene model and the model file in the second file format corresponding to the processed virtual scene model. Among them, by using the python api provided by Simplygon, the local fbx file can be converted into two decimated physical resources as input resources.
[0042] In order to maximize the preservation of the original shape of the virtual scene model while keeping the original scene model unchanged, in the embodiments of the present application, the decimation rate of the local fbx can be adjusted to 80% and 50% by using the Simplygon API. The Simplygon API is the application programming interface (API) of Simplygon. Simplygon is a software tool for 3D content optimization, and the Simplygon API allows developers to integrate and use the functions of Simplygon in their applications. Specifically, through the Simplygon API, developers can automate operations such as polygon reduction, LOD (Level of Detail) generation, texture compression, and optimization of 3D models. Code can also be written to call the Simplygon API to process and optimize complex 3D models, thereby improving real-time rendering performance, reducing bandwidth requirements, and increasing loading speed. The Simplygon API provides various functions and options, enabling developers to customize according to their needs and application scenarios. The Simplygon API can be integrated with various development environments and programming languages, such as C++, C#, Python, etc., enabling developers to use the functions of Simplygon in different platforms and environments. By using the Simplygon API, developers can easily integrate 3D content optimization functions into their applications to improve performance and optimize the user experience.
[0043] In one embodiment, for the step of "performing decimation processing on the polygon mesh of the target virtual scene model based on the preset decimation parameters to obtain the processed virtual scene model", the method may include:
[0044] Obtain the shape constraint parameters and the decimation ratio parameters;
[0045] Based on the shape constraint parameters and the decimation ratio parameters, perform decimation processing on the polygon mesh of the target virtual scene model to obtain the processed virtual scene model.
[0046] Further, for the step of "performing decimation processing on the polygon mesh of the target virtual scene model based on the shape constraint parameters and the decimation ratio parameters to obtain the processed virtual scene model", the method may include:
[0047] Based on the shape constraint parameters, perform constraint processing on the model shape of the target virtual scene model, and based on the decimation ratio parameters, process the number of meshes of the polygon mesh of the target virtual scene model to obtain the processed virtual scene model.
[0048] Among them, the decimation ratio parameter can be 80% or 50%. The decimated scene model generated when the decimation ratio parameter is 80% can be used to produce physical resources for detecting the walking of virtual characters. The decimated scene model generated when the decimation ratio parameter is 50% can be used to produce physical resources for detecting scene interaction. Specifically, when the decimation ratio parameter is 80%, it means that the number of polygon meshes to be retained is 80% of the total number of original polygon meshes. When the decimation ratio parameter is 50%, it means that the number of polygon meshes to be retained is 50% of the total number of original polygon meshes. It should be noted that the decimation ratio parameter can also be other values, such as 20%, 30% or 70%, etc. This is only for illustrative purposes and is not restrictive.
[0049] Specifically, the shape constraint parameters can include a deviation ratio, the first module parameters corresponding to the first functional module (Geometry Approximation Settings), and the second module parameters corresponding to the second functional module (Opmization Settings). Among them, the deviation ratio is used to switch the global clipping distance ratio on which the effect preview depends. Since physical resources need to be produced, the deviation ratio should be as small as possible. Geometry ApproximationSettings is used to select to maintain the shape of the object, which can be achieved by setting different geometric approximation levels. Generally, using a higher approximation level can better retain the shape of the virtual object, but it will also increase the number of polygons of the model. The Opmization Settings function can be in the optimization settings of Simplygon. You can choose not to apply any shape optimization options, which will ensure that the shape and topology of the virtual object will not be modified, thus maintaining its original shape.
[0050] Optionally, the obtaining of the shape constraint parameters and the decimation ratio parameter includes:
[0051] Obtaining the first decimation ratio parameter corresponding to the first physical function, the second decimation ratio parameter corresponding to the second physical function, and the shape constraint parameters;
[0052] Based on the shape constraint parameters and the first decimation ratio parameter, perform decimation processing on the polygon meshes of the target virtual scene model to obtain a first processed virtual scene model, where the first processed virtual scene model is used to generate a target virtual scene model with a first target physical function;
[0053] Based on the shape constraint parameter and the second face reduction ratio parameter, perform face reduction processing on the polygon mesh of the target virtual scene model to obtain a second processed virtual scene model, where the second processed virtual scene model is used to generate a target virtual scene model with a second target physical function.
[0054] Optionally, two or more face reduction ratio parameters can be obtained, so as to generate multiple virtual scene models with different physical functions.
[0055] In the embodiment of the present application, the target virtual scene model selected in the preset virtual scene space can be exported through the file export interface (FBX API) corresponding to the first file format to obtain a model file in the first file format corresponding to the target virtual scene model (i.e., FBX file). Then, obtain the first face reduction ratio parameter 80% corresponding to the first physical function, the second face reduction ratio parameter 50% corresponding to the second physical function, and the shape constraint parameter. The face reduction scene model generated when the face reduction ratio parameter is 80% can be used to produce physical resources for detecting the walking of virtual characters, and the face reduction scene model generated when the face reduction ratio parameter is 50% can be used to produce physical resources for detecting scene interaction. Next, based on the shape constraint parameter and the first face reduction ratio parameter 80%, perform face reduction processing on the polygon mesh of the target virtual scene model to obtain a first processed virtual scene model, which is used to produce physical resources for detecting the walking of virtual characters; based on the shape constraint parameter and the second face reduction ratio parameter 50%, perform face reduction processing on the polygon mesh of the target virtual scene model to obtain a second processed virtual scene model, which is used to produce physical resources for detecting scene interaction.
[0056] 103. Based on the preset physical attribute parameters and the processed virtual scene model, generate target physical resources with target physical functions.
[0057] In the embodiment of the present application, corresponding physical resources can be generated according to the virtual scene model. The physical resources include a target bounding box, and also have physical attributes, physical materials, and physical interaction information. For example, some physical resources can interact with other virtual objects (such as bullets) in the virtual scene, and some physical resources can be used for virtual characters to walk in the virtual scene.
[0058] Specifically, the physical resources in the embodiments of the present application may further include collision attributes, rigid body types, collision judgments, and physical material settings in addition to the bounding box. Among them, the physical center point of the model and the coordinates of the bounding box relative to the model can be found to generate a target bounding box; the collision attributes can be set for the model for collision testing; the type of the rigid body can also be set; angular offset and maximum angular velocity determination can also be performed, and a callback method after physical collision can also be set to determine whether it is affected by gravity.
[0059] In a specific embodiment, a target bounding box with target physical functions can be generated based on preset bounding box parameters and the model shape of the processed virtual scene model; then, the target bounding box is mounted on the target virtual scene model to obtain a target virtual scene model with the target physical functions.
[0060] Specifically, the method further includes:
[0061] Import the model file in the second file format corresponding to the processed virtual scene model into the game engine where the target virtual scene model is located, and call the game engine to perform physical resource generation processing on the model file in the second file format to obtain a target bounding box with target physical functions corresponding to the processed virtual scene model and a physical resource file corresponding to the target bounding box.
[0062] In the embodiments of the present application, for the step of "generating a target bounding box with target physical functions based on preset bounding box parameters and the model shape of the processed virtual scene model", the method may include:
[0063] Obtain preset bounding box parameters, where the preset bounding box parameters include bounding box size parameters and bounding box shape parameters;
[0064] Based on the model shape of the processed virtual scene model, determine the position of the center point of the model shape;
[0065] Based on the position of the center point, the bounding box size parameters, and the bounding box shape parameters, generate a target bounding box with target physical functions.
[0066] For example, please refer to Figure 3, obtain preset bounding box parameters, where the preset bounding box parameters include bounding box size parameters and bounding box shape parameters. At this time, the bounding box size parameters can be determined based on the model size of the processed virtual scene model to ensure that the target bounding box can completely enclose the processed virtual scene model. The bounding box shape parameters can be spherical parameters. At the same time, obtain the model shape of the processed virtual scene model, determine the center point position of the model center point of the model shape based on the model shape of the processed virtual scene model, and then generate a target bounding box with target physical functions based on the center point position, the bounding box size parameters, and the bounding box shape parameters.
[0067] To generate a physical resource that fits the target virtual scene model, before the step of "obtaining preset bounding box parameters", the method may include:
[0068] Obtain the model shape and model size of the processed virtual scene model;
[0069] Determine the bounding box shape parameters based on the model shape;
[0070] Determine the bounding box size parameters based on the model size.
[0071] For example, please refer to Figure 4 , obtain the model shape and model size of the processed virtual scene model, determine the bounding box shape parameters based on the model shape, determine the bounding box size parameters based on the model size, determine the center point position of the model center point of the model shape based on the model shape of the processed virtual scene model, and then generate a target bounding box with target physical functions based on the center point position, the bounding box size parameters, and the bounding box shape parameters.
[0072] It should be noted that the center point of the model shape can be a position determined by the computer device itself, or a position set by the developer within the model shape. The shape of the bounding box can be a regular shape, such as a rectangle, a sphere, or other polygons, or the same as the model shape of the virtual scene model, or can be defined by the developer. Further, the shape of the bounding box can also be determined according to the physical functions required by the virtual scene model. For example, when the virtual scene model is a virtual house model, the bounding box of the virtual house model can be consistent with the model shape of the virtual house model; when the virtual scene model is a virtual bonfire, in order to simulate the distance between a person and the bonfire in real situations, a circular spherical bounding box can be generated based on the center point of the virtual bonfire, so that there is a certain distance between the virtual character and the virtual bonfire, so that the distance between the virtual character and the virtual bonfire in the game scene can simulate the distance between a person and the bonfire in real situations; when the virtual scene model is a virtual vehicle, such as a virtual car, an elliptical spherical bounding box that just wraps the virtual car can be drawn, so that the distance between the virtual character and the virtual car can simulate the distance between a person and a car in real situations.
[0073] In order to enable developers to customize the bounding box, before the step of "obtaining the preset bounding box parameters", the method may include:
[0074] Display a graphical user interface, where the graphical user interface displays a parameter setting page, and at least one parameter input interface is included on the parameter setting page;
[0075] In response to the submission operation of the parameter information input to the parameter input interface, obtain the input parameter information as the preset bounding box parameters.
[0076] For example, the computer device can display a graphical user interface, where the graphical user interface displays a parameter setting page, and at least one parameter input interface is included on the parameter setting page. The at least one parameter input interface includes a shape parameter input interface, a size parameter input interface, and a bounding box attribute parameter input interface. The developer can input the bounding box shape parameters through the shape parameter input interface, input the bounding box size parameters through the size parameter input interface, and also input the bounding box attribute parameters configured for the bounding box through the bounding box attribute parameter input interface. The computer device can obtain the input bounding box shape parameters, bounding box size parameters, and bounding box attribute parameters as the preset bounding box parameters in response to the submission operation of the parameter information for the shape parameter input interface, the size parameter input interface, and the bounding box attribute parameter input interface.
[0077] 104. Mount the target physical resource onto the target virtual scene model to obtain a target virtual scene model with the target physical function.
[0078] In the embodiments of the present application, the physical characteristics corresponding to the target physical resource can be enabled for the target virtual scene model by mounting the link of the target physical resource onto the target virtual scene model. Specifically, the link of the target physical resource can be attached under the physical attribute information corresponding to the attribute information of the target virtual scene model, so that the target virtual scene model has the physical characteristics corresponding to the target physical resource.
[0079] In the embodiments of the present application, the method further includes:
[0080] Obtain the target file path of the physical resource file;
[0081] Associate the target file path with the model description file of the target virtual scene model, so as to mount the target bounding box onto the target virtual scene model to obtain a target virtual scene model with the target physical function.
[0082] Specifically, in the embodiments of the present application, a virtual scene model can be selected in a virtual scene (Messiah scene) in a game engine, and a file in fbx format (the.fbx under mesh) of the mesh model corresponding to the virtual scene can be obtained. Then, the Simplygon API is called to perform face reduction processing on the virtual scene model to obtain a model file (the.fbx after face reduction) of the virtual scene model after face reduction. Next, the model file (the.fbx after face reduction) is imported into max, and then the model file (the.fbx after face reduction) is imported into the game engine through max, so as to obtain the data of the virtual scene model after face reduction in max. Further, the model file (the.fbx after face reduction) is written in batches, specifically, the model file (the.fbx after face reduction) is batch-converted into a binary engine physical resource (through the function of the game engine itself), and finally a physical description file is generated according to the above physical resource to obtain a virtual scene model with physical functions.
[0083] To further illustrate the method for processing a virtual scene model provided in the embodiments of the present application, the following will take the application of the method for processing a virtual scene model in a specific implementation scenario as an example for illustration. The specific scenario is as follows:
[0084] (1) It is possible to batch export all virtual scene models in the virtual space in fbx format. Specifically, developers can use the fbx api to export the resources of static virtual scene models in an entire virtual space as fbx files back to the local space, and then use the fbx api to batch convert and rename the fbx files imported back to the local to a file format that conforms to Simplygon. For example, all virtual scene models in a preset virtual scene space can be exported through the file export interface (FBX API) corresponding to the first file format, that is, all virtual scene models are exported from the virtual scene space to obtain model files (i.e., FBX files) in the first file format corresponding to multiple virtual scene models.
[0085] Among them, developers can use the fbx interface provided by AutoDesk to import the fbx files of static virtual scene models in the virtual space to the local. Then, use the fbx api to batch modify the node names of the fbx files and encapsulate them into a user interface for convenient batch operation by artists. At this time, it is necessary to first create a connection between the game engine and the fbx api, and batch export the resources of static virtual scene models in the virtual space referenced by the scene in the form of a queue. The specific implementation code is as follows:
[0086] do query
[0087] fbx_files = os.listdir_("D:\TEST"+" / / "+"high_export"+" / / "+"fbx")
[0088] for fbx in fbx_files:
[0089] gWatting = True
[0090] fbx_api.query_fbx_(fbx_file+" / / "+fbx,repo path,package_path)
[0091] fbx_ref.path = fbx_file+" / / "+fbx
[0092] while gWatting:
[0093] time.sleep_(0.01)
[0094] / / Load the FBX file
[0095] FbxImporter* pImporter = FbxImporter::Create(pManager,"");
[0096] if (!pImporter->Initialize("test.fbx", -1, pManager->GetIOSettings()))
[0097] {
[0098] cerr << "Failed to load FBX file." << endl;
[0099] exit(0);
[0100] }
[0101] pImporter->Import(pScene);
[0102] pImporter->Destroy();
[0103] / / Modify Mesh node name
[0104] FbxNode* pRootNode = pScene->GetRootNode();
[0105] ChangeNodeName(pRootNode, "newMeshName");
[0106] / / Save FBX file
[0107] FbxExporter* pExporter = FbxExporter::Create(pManager, "");
[0108] if (!pExporter->Initialize("new_fbx_file.fbx", -1, pManager->GetIOSettings()))
[0109] {
[0110] cerr << "Failed to create FBX exporter." << endl;
[0111] exit(0);
[0112] }
[0113] pExporter->Export(pScene);
[0114] pExporter->Destroy();
[0115] (2) In the embodiments of the present application, physical decimation of the virtual scene model can be performed through the Simplygon module, that is, decimation processing is performed on the model files in the first file format corresponding to the virtual scene models in the previous step to obtain the processed virtual scene models corresponding to the multiple virtual scene models. Specifically, the python api provided by the Simplygon module can be used to convert the local fbx file into two decimated physical resources as input resources. Specifically, it is necessary to initialize simplygon and obtain the Simplygon object. After that, a processing object can be created and the parameters for generating decimation can be set. After processing, the result can be exported as an FBX file, and then gc is called to manually destroy it. The specific implementation code is as follows:
[0116] Def clear_sg(self,sg):
[0117] :param sg:
[0118] :return: Clean-up operation
[0119] sg = None
[0120] gc.collect()
[0121] processor = sg.CreateReductionProcessor()
[0122] processor.SetScene(scene)
[0123] setting = processor.GetReductionSettings()
[0124] setting.SetReductionTargets(Simplygon.EStopCondition_All,True,False,False,False)
[0125] setting.SetReductionTargetTriangleRatio(0.01)
[0126] processor.RunProcessing()
[0127] (3) In the embodiments of the present application, it is possible to perform the scene physical resource rollback and physical generation of the processed virtual scene models corresponding to multiple virtual scene models. Specifically, the storage form of the files of each virtual scene model in the virtual space is mainly xml files. The method of attaching physical resources to the static virtual scene model is equivalent to generating Rigidbody resources under the physical tags of the scene static model. Then, for the resource content of the Rigidbody resources, the physical writing of the static virtual scene model is realized by using the ElmentTree method.
[0128] In summary, the embodiments of the present application provide a method for processing a virtual scene model. By obtaining at least one target virtual scene model from a preset virtual scene space, where the target virtual scene model is composed of multiple polygon meshes; then, performing a decimation process on the polygon meshes of the target virtual scene model based on a preset decimation parameter to obtain a processed virtual scene model; then, generating target physical resources with target physical functions based on the preset physical attribute parameters and the processed virtual scene model; finally, mounting the target physical resources onto the target virtual scene model to obtain a target virtual scene model with the target physical functions. The embodiments of the present application can perform a decimation process on the polygon meshes of the target virtual scene model to obtain one or more decimated virtual scene models that can be used for physical resource production. Then, physical resources with target physical functions are generated according to the decimated virtual scene models and output to the game engine where the target virtual scene model is located for physical resource reference, thereby realizing the automatic batch generation of corresponding physical resources for multiple virtual scene models, saving labor costs, and improving the physical resource generation efficiency of the virtual scene model.
[0129] To better implement the above method, the embodiments of the present application can also provide a processing device for a virtual scene model. The processing device for the virtual scene model can be specifically integrated in a computer device, such as a terminal or other computer devices.
[0130] Please refer to Figure 5 , Figure 5 which is a schematic structural diagram of a processing device for a virtual scene model provided by the embodiments of the present application. The device includes:
[0131] An obtaining unit 201, configured to obtain at least one target virtual scene model from a preset virtual scene space, where the target virtual scene model is composed of multiple polygon meshes;
[0132] A first processing unit 202, configured to perform a decimation process on the polygon meshes of the target virtual scene model based on a preset decimation parameter to obtain a processed virtual scene model;
[0133] A generating unit 203, configured to generate a target physical resource with a target physical function based on preset physical property parameters and the processed virtual scene model;
[0134] A second processing unit 204, configured to mount the target physical resource on the target virtual scene model to obtain a target virtual scene model with the target physical function.
[0135] In some embodiments, the processing device for the virtual scene model includes:
[0136] A first obtaining subunit, configured to obtain a shape constraint parameter and a decimation ratio parameter;
[0137] A first processing subunit, configured to perform decimation processing on the polygon mesh of the target virtual scene model based on the shape constraint parameter and the decimation ratio parameter to obtain a processed virtual scene model.
[0138] In some embodiments, the processing device for the virtual scene model includes:
[0139] A second processing subunit, configured to perform constraint processing on the model shape of the target virtual scene model based on the shape constraint parameter, and perform processing on the number of meshes of the polygon mesh of the target virtual scene model based on the decimation ratio parameter to obtain a processed virtual scene model.
[0140] In some embodiments, the processing device for the virtual scene model includes:
[0141] A second obtaining subunit, configured to obtain a first decimation ratio parameter corresponding to a first physical function, a second decimation ratio parameter corresponding to a second physical function, and a shape constraint parameter;
[0142] A third processing subunit, configured to perform decimation processing on the polygon mesh of the target virtual scene model based on the shape constraint parameter and the first decimation ratio parameter to obtain a first processed virtual scene model, where the first processed virtual scene model is used to generate a target virtual scene model with a first target physical function;
[0143] The third processing subunit is further configured to perform decimation processing on the polygon mesh of the target virtual scene model based on the shape constraint parameter and the second decimation ratio parameter to obtain a second processed virtual scene model, where the second processed virtual scene model is used to generate a target virtual scene model with a second target physical function.
[0144] In some embodiments, the processing device for the virtual scene model includes:
[0145] The first generation subunit is configured to generate a target bounding box with a target physical function based on preset bounding box parameters and the model shape of the processed virtual scene model.
[0146] In some embodiments, the processing device of the virtual scene model includes:
[0147] The fourth processing subunit is configured to mount the target bounding box onto the target virtual scene model to obtain a target virtual scene model with the target physical function.
[0148] In some embodiments, the processing device of the virtual scene model includes:
[0149] The third acquisition subunit is configured to acquire preset bounding box parameters, where the preset bounding box parameters include bounding box size parameters and bounding box shape parameters;
[0150] The first determination subunit is configured to determine the center point position of the model shape based on the model shape of the processed virtual scene model;
[0151] The second generation subunit is configured to generate a target bounding box with a target physical function based on the center point position, the bounding box size parameters, and the bounding box shape parameters.
[0152] In some embodiments, the processing device of the virtual scene model includes:
[0153] The fourth acquisition subunit is configured to acquire the model shape and model size of the processed virtual scene model;
[0154] The second determination subunit is configured to determine the bounding box shape parameters based on the model shape;
[0155] The second determination subunit is further configured to determine the bounding box size parameters based on the model size.
[0156] In some embodiments, the processing device of the virtual scene model includes:
[0157] The display subunit is configured to display a graphical user interface, and the graphical user interface displays a parameter setting page, where at least one parameter input interface is included on the parameter setting page;
[0158] The fifth acquisition subunit is configured to acquire the input parameter information as preset bounding box parameters in response to a submission operation of parameter information input to the parameter input interface.
[0159] In some embodiments, the processing device of the virtual scene model includes:
[0160] An export subunit, configured to export the target virtual scene model from the virtual scene space through a file export interface corresponding to a first file format, to obtain a model file in the first file format corresponding to the target virtual scene model.
[0161] In some embodiments, the processing device for the virtual scene model includes:
[0162] A first call subunit, configured to call a decimation function interface to perform decimation processing on the polygon mesh of the target virtual scene model corresponding to the model file, to obtain a processed virtual scene model and a model file in a second file format corresponding to the processed virtual scene model.
[0163] In some embodiments, the processing device for the virtual scene model includes:
[0164] A second call subunit, configured to import the model file in the second file format corresponding to the processed virtual scene model into the game engine where the target virtual scene model is located, and call the game engine to perform physical resource generation processing on the model file in the second file format, to obtain a target bounding box with target physical functions corresponding to the processed virtual scene model, and a physical resource file corresponding to the target bounding box.
[0165] In some embodiments, the processing device for the virtual scene model includes:
[0166] A sixth acquisition subunit, configured to acquire a target file path of the physical resource file;
[0167] A fifth processing subunit, configured to associate the target file path with a model description file of the target virtual scene model, so as to mount the target bounding box onto the target virtual scene model, to obtain a target virtual scene model with the target physical functions.
[0168] An embodiment of the present application discloses a processing device for a virtual scene model. The device can obtain at least one target virtual scene model from a preset virtual scene space through an acquisition unit 201, where the target virtual scene model is composed of multiple polygon meshes; a first processing unit 202 performs decimation processing on the polygon meshes of the target virtual scene model based on preset decimation parameters to obtain a processed virtual scene model; a generation unit 203 generates a target physical resource with a target physical function based on preset physical attribute parameters and the processed virtual scene model; a second processing unit 204 mounts the target physical resource on the target virtual scene model to obtain a target virtual scene model with the target physical function. The embodiment of the present application can perform decimation processing on the polygon meshes of the target virtual scene model to obtain one or more decimated virtual scene models that can be used for physical resource production. Then, based on the decimated virtual scene models, physical resources with target physical functions are generated and output to the game engine where the target virtual scene model is located for physical resource reference, thereby realizing the automated batch generation of physical resources for multiple virtual scene models, saving labor costs, and improving the physical resource generation efficiency of virtual scene models.
[0169] Correspondingly, an embodiment of the present application further provides a computer device, which can be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC), a personal digital assistant (PDA), etc. As Figure 6 shown, Figure 6 is a schematic structural diagram of the computer device provided by the embodiment of the present application. The computer device 300 includes a processor 301 with one or more processing cores, a memory 302 with one or more computer-readable storage media, and a computer program stored on the memory 302 and executable on the processor. Among them, the processor 301 is electrically connected to the memory 302. Those skilled in the art can understand that the structural diagram of the computer device shown in the figure does not constitute a limitation on the computer device, and it may include more or fewer components than shown in the figure, or combine some components, or arrange different components.
[0170] The processor 301 is the control center of the computer device 300, connecting various parts of the entire computer device 300 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, the processor 301 executes various functions of the computer device 300 and processes data, thereby monitoring the entire computer device 300.
[0171] In an embodiment of the present application, the processor 301 in the computer device 300 will load the instructions corresponding to the processes of one or more application programs into the memory 302 according to the following steps, and the processor 301 will run the application programs stored in the memory 302 to implement various functions:
[0172] Obtain at least one target virtual scene model from a preset virtual scene space, where the target virtual scene model is composed of a plurality of polygon meshes;
[0173] Perform decimation processing on the polygon meshes of the target virtual scene model based on preset decimation parameters to obtain a processed virtual scene model;
[0174] Generate a target physical resource with a target physical function based on preset physical attribute parameters and the processed virtual scene model;
[0175] Mount the target physical resource on the target virtual scene model to obtain a target virtual scene model with the target physical function.
[0176] In one embodiment, the performing decimation processing on the polygon meshes of the target virtual scene model based on preset decimation parameters to obtain a processed virtual scene model includes:
[0177] Obtain a shape constraint parameter and a decimation ratio parameter;
[0178] Perform decimation processing on the polygon meshes of the target virtual scene model based on the shape constraint parameter and the decimation ratio parameter to obtain a processed virtual scene model.
[0179] In one embodiment, the performing decimation processing on the polygon meshes of the target virtual scene model based on the shape constraint parameter and the decimation ratio parameter to obtain a processed virtual scene model includes:
[0180] Perform shape constraint processing on the model shape of the target virtual scene model based on the shape constraint parameter, and perform processing on the number of meshes of the polygon meshes of the target virtual scene model based on the decimation ratio parameter to obtain a processed virtual scene model.
[0181] In one embodiment, the obtaining a shape constraint parameter and a decimation ratio parameter includes:
[0182] Obtain a first decimation ratio parameter corresponding to a first physical function, a second decimation ratio parameter corresponding to a second physical function, and a shape constraint parameter;
[0183] Perform decimation on the polygon mesh of the target virtual scene model based on the shape constraint parameter and the first decimation ratio parameter to obtain a first processed virtual scene model, where the first processed virtual scene model is used to generate a target virtual scene model with a first target physical function;
[0184] Perform decimation on the polygon mesh of the target virtual scene model based on the shape constraint parameter and the second decimation ratio parameter to obtain a second processed virtual scene model, where the second processed virtual scene model is used to generate a target virtual scene model with a second target physical function.
[0185] In one embodiment, generating a target physical resource with a target physical function based on the preset physical property parameters and the processed virtual scene model includes:
[0186] Generate a target bounding box with a target physical function based on the preset bounding box parameters and the model shape of the processed virtual scene model;
[0187] The step of mounting the target physical resource onto the target virtual scene model to obtain a target virtual scene model with the target physical function includes:
[0188] Mount the target bounding box onto the target virtual scene model to obtain a target virtual scene model with the target physical function.
[0189] In one embodiment, generating a target bounding box with a target physical function based on the preset bounding box parameters and the model shape of the processed virtual scene model includes:
[0190] Obtain the preset bounding box parameters, where the preset bounding box parameters include a bounding box size parameter and a bounding box shape parameter;
[0191] Determine the center point position of the model shape based on the model shape of the processed virtual scene model;
[0192] Generate a target bounding box with a target physical function based on the center point position, the bounding box size parameter, and the bounding box shape parameter.
[0193] In one embodiment, before obtaining the preset bounding box parameters, it further includes:
[0194] Obtain the model shape and model size of the processed virtual scene model;
[0195] Determine the bounding box shape parameter based on the model shape;
[0196] Determine the bounding box size parameters based on the model size.
[0197] In one embodiment, before obtaining the preset bounding box parameters, it further includes:
[0198] Display a graphical user interface, where the graphical user interface displays a parameter setting page, and at least one parameter input interface is included on the parameter setting page;
[0199] In response to the submission operation of the parameter information input to the parameter input interface, obtain the input parameter information as the preset bounding box parameters.
[0200] In one embodiment, after obtaining at least one target virtual scene model from the preset virtual scene space, it further includes:
[0201] Export the target virtual scene model from the virtual scene space through the file export interface corresponding to the first file format to obtain a model file in the first file format corresponding to the target virtual scene model.
[0202] In one embodiment, the decimation processing of the polygon mesh of the target virtual scene model based on the preset decimation parameters to obtain the processed virtual scene model includes:
[0203] Call the decimation function interface to perform decimation processing on the polygon mesh of the target virtual scene model corresponding to the model file to obtain the processed virtual scene model and the model file in the second file format corresponding to the processed virtual scene model.
[0204] In one embodiment, the method further includes:
[0205] Import the model file in the second file format corresponding to the processed virtual scene model into the game engine where the target virtual scene model is located, and call the game engine to perform physical resource generation processing on the model file in the second file format to obtain the target bounding box with the target physical function corresponding to the processed virtual scene model and the physical resource file corresponding to the target bounding box.
[0206] In one embodiment, the method further includes:
[0207] Obtain the target file path of the physical resource file;
[0208] Associate the target file path with the model description file of the target virtual scene model to mount the target bounding box to the target virtual scene model to obtain the target virtual scene model with the target physical function.
[0209] For the specific implementation of each of the above operations, reference may be made to the foregoing embodiments, which will not be elaborated herein.
[0210] Optionally, as Figure 6 shown, the computer device 300 further includes: a touch display screen 303, a radio frequency circuit 304, an audio circuit 305, an input unit 306, and a power supply 307. Among them, the processor 301 is electrically connected to the touch display screen 303, the radio frequency circuit 304, the audio circuit 305, the input unit 306, and the power supply 307 respectively. Those skilled in the art can understand that Figure 6 the computer device structure shown in
[0211] does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0212] In an embodiment of the present application, a graphical interface is generated on the touch display screen 303 by the processor 301 executing an application. The touch display screen 303 is used to present the graphical interface and receive operation instructions generated by a user acting on the graphical interface.
[0213] The radio frequency circuit 304 can be used to receive and transmit radio frequency signals to establish wireless communication with a network device or other computer devices through wireless communication, and to receive and transmit signals between the network device or other computer devices.
[0214] The audio circuit 305 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 305 can transmit the electrical signal converted from the received audio data to the speaker, and the speaker converts it into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 305 and then converted into audio data. After the audio data is output to the processor 301 for processing, it is transmitted through the radio frequency circuit 304 to, for example, another computer device, or the audio data is output to the memory 302 for further processing. The audio circuit 305 may also include an earphone jack to provide communication between a peripheral earphone and the computer device.
[0215] The input unit 306 can be used to receive input digital, character information or user characteristic information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0216] The power supply 307 is used to supply power to each component of the computer device 300. Optionally, the power supply 307 can be logically connected to the processor 301 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 307 may also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
[0217] Although Figure 6 not shown in the figure, the computer device 300 may also include a camera, a sensor, a Wi-Fi module, a Bluetooth module, etc., which will not be elaborated here.
[0218] In the above embodiments, the descriptions of each embodiment have their own focuses. For parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0219] As can be seen from the above, the computer device provided in this embodiment obtains at least one target virtual scene model from a preset virtual scene space, where the target virtual scene model is composed of multiple polygon meshes; then, based on preset decimation parameters, decimation processing is performed on the polygon meshes of the target virtual scene model to obtain a processed virtual scene model; next, based on the preset physical property parameters and the processed virtual scene model, a target physical resource with target physical functions is generated; finally, the target physical resource is mounted on the target virtual scene model to obtain a target virtual scene model with the target physical functions. In the embodiments of the present application, by performing decimation processing on the polygon meshes of the target virtual scene model, one or more decimated virtual scene models that can be used for physical resource production can be obtained. Then, according to the decimated virtual scene model, a physical resource with target physical functions is generated and output to the game engine where the target virtual scene model is located for reference of the physical resource, thereby realizing the automatic batch generation of corresponding physical resources for multiple virtual scene models, saving labor costs, and improving the physical resource generation efficiency of the virtual scene model.
[0220] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions or by controlling related hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0221] Therefore, the embodiments of the present application provide a computer-readable storage medium, which stores multiple computer programs that can be loaded by a processor to execute the steps in any of the processing methods of the virtual scene model provided by the embodiments of the present application. For example, the computer program can execute the following steps:
[0222] Obtain at least one target virtual scene model from a preset virtual scene space, where the target virtual scene model is composed of multiple polygon meshes;
[0223] Based on preset decimation parameters, perform decimation processing on the polygon meshes of the target virtual scene model to obtain a processed virtual scene model;
[0224] Based on the preset physical property parameters and the processed virtual scene model, generate a target physical resource with target physical functions;
[0225] Mount the target physical resource on the target virtual scene model to obtain a target virtual scene model with the target physical functions.
[0226] In one embodiment, performing decimation processing on the polygon mesh of the target virtual scene model based on preset decimation parameters to obtain a processed virtual scene model includes:
[0227] Obtaining a shape constraint parameter and a decimation ratio parameter;
[0228] Based on the shape constraint parameter and the decimation ratio parameter, performing decimation processing on the polygon mesh of the target virtual scene model to obtain a processed virtual scene model.
[0229] In one embodiment, based on the shape constraint parameter and the decimation ratio parameter, performing decimation processing on the polygon mesh of the target virtual scene model to obtain a processed virtual scene model includes:
[0230] Constraining the model shape of the target virtual scene model based on the shape constraint parameter, and processing the number of meshes of the polygon mesh of the target virtual scene model based on the decimation ratio parameter to obtain a processed virtual scene model.
[0231] In one embodiment, obtaining a shape constraint parameter and a decimation ratio parameter includes:
[0232] Obtaining a first decimation ratio parameter corresponding to a first physical function, a second decimation ratio parameter corresponding to a second physical function, and a shape constraint parameter;
[0233] Based on the shape constraint parameter and the first decimation ratio parameter, performing decimation processing on the polygon mesh of the target virtual scene model to obtain a first processed virtual scene model, where the first processed virtual scene model is used to generate a target virtual scene model with a first target physical function;
[0234] Based on the shape constraint parameter and the second decimation ratio parameter, performing decimation processing on the polygon mesh of the target virtual scene model to obtain a second processed virtual scene model, where the second processed virtual scene model is used to generate a target virtual scene model with a second target physical function.
[0235] In one embodiment, generating a target physical resource with a target physical function based on preset physical attribute parameters and the processed virtual scene model includes:
[0236] Generating a target bounding box with a target physical function based on preset bounding box parameters and the model shape of the processed virtual scene model;
[0237] Mounting the target physical resource onto the target virtual scene model to obtain a target virtual scene model with the target physical function includes:
[0238] Mounting the target bounding box onto the target virtual scene model to obtain a target virtual scene model with the target physical function.
[0239] In one embodiment, generating a target bounding box with a target physical function based on preset bounding box parameters and the model shape of the processed virtual scene model includes:
[0240] Obtaining preset bounding box parameters, where the preset bounding box parameters include bounding box size parameters and bounding box shape parameters;
[0241] Determining the center point position of the model shape based on the model shape of the processed virtual scene model;
[0242] Generating a target bounding box with a target physical function based on the center point position, the bounding box size parameters, and the bounding box shape parameters.
[0243] In one embodiment, before obtaining the preset bounding box parameters, it further includes:
[0244] Obtaining the model shape and model size of the processed virtual scene model;
[0245] Determining the bounding box shape parameters based on the model shape;
[0246] Determining the bounding box size parameters based on the model size.
[0247] In one embodiment, before obtaining the preset bounding box parameters, it further includes:
[0248] Displaying a graphical user interface, where the graphical user interface displays a parameter setting page, and at least one parameter input interface is included on the parameter setting page;
[0249] In response to a submission operation of parameter information input to the parameter input interface, obtaining the input parameter information as the preset bounding box parameters.
[0250] In one embodiment, after obtaining at least one target virtual scene model from a preset virtual scene space, it further includes:
[0251] Exporting the target virtual scene model from the virtual scene space through a file export interface corresponding to a first file format to obtain a model file in the first file format corresponding to the target virtual scene model.
[0252] In one embodiment, performing decimation processing on the polygon mesh of the target virtual scene model based on preset decimation parameters to obtain a processed virtual scene model, includes:
[0253] Invoking a decimation function interface to perform decimation processing on the polygon mesh of the target virtual scene model corresponding to the model file, to obtain a processed virtual scene model and a model file in a second file format corresponding to the processed virtual scene model.
[0254] In one embodiment, the method further includes:
[0255] Importing the model file in the second file format corresponding to the processed virtual scene model into the game engine where the target virtual scene model is located, and invoking the game engine to perform physical resource generation processing on the model file in the second file format, to obtain a target bounding box with target physical functions corresponding to the processed virtual scene model, and a physical resource file corresponding to the target bounding box.
[0256] In one embodiment, the method further includes:
[0257] Obtaining a target file path of the physical resource file;
[0258] Associating the target file path with the model description file of the target virtual scene model, to mount the target bounding box onto the target virtual scene model, to obtain a target virtual scene model with the target physical functions.
[0259] For the specific implementation of each of the above operations, reference may be made to the previous embodiments, which will not be elaborated herein.
[0260] Wherein, the storage medium may include: read only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc.
[0261] Since the computer program stored in the storage medium can execute the steps in any of the processing methods of the virtual scene model provided by the embodiments of the present application, by obtaining at least one target virtual scene model from a preset virtual scene space, where the target virtual scene model is composed of multiple polygon meshes; then, performing decimation processing on the polygon meshes of the target virtual scene model based on preset decimation parameters to obtain a processed virtual scene model; then, generating a target physical resource with a target physical function based on the preset physical attribute parameters and the processed virtual scene model; finally, mounting the target physical resource on the target virtual scene model to obtain a target virtual scene model with the target physical function. The embodiments of the present application can perform decimation processing on the polygon meshes of the target virtual scene model to obtain one or more decimated virtual scene models that can be used for physical resource production. Then, physical resources with target physical functions are generated according to the decimated virtual scene models and output to the game engine where the target virtual scene model is located for reference of physical resources, thereby realizing automatic batch generation of corresponding physical resources for multiple virtual scene models, saving labor costs, and improving the physical resource generation efficiency of virtual scene models.
[0262] In the above embodiments, the descriptions of the various embodiments have their own emphases. For parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0263] The above has introduced in detail a processing method, device, computer device, and storage medium for a virtual scene model provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the technical solution and its core idea of the present application; those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for processing a virtual scene model, characterized in that, comprising: obtaining at least one target virtual scene model from a preset virtual scene space, wherein the target virtual scene model is composed of a plurality of polygon meshes; performing decimation processing on the polygon meshes of the target virtual scene model based on preset decimation parameters to obtain a processed virtual scene model; generating a target physical resource with a target physical function based on preset physical property parameters and the processed virtual scene model; mounting the target physical resource on the target virtual scene model to obtain a target virtual scene model with the target physical function.
2. The method for processing a virtual scene model according to claim 1, characterized in that, the performing decimation processing on the polygon meshes of the target virtual scene model based on preset decimation parameters to obtain a processed virtual scene model includes: obtaining a shape constraint parameter and a decimation ratio parameter; performing decimation processing on the polygon meshes of the target virtual scene model based on the shape constraint parameter and the decimation ratio parameter to obtain a processed virtual scene model.
3. The method for processing a virtual scene model according to claim 2, characterized in that, the performing decimation processing on the polygon meshes of the target virtual scene model based on the shape constraint parameter and the decimation ratio parameter to obtain a processed virtual scene model includes: performing constraint processing on the model shape of the target virtual scene model based on the shape constraint parameter, and performing processing on the number of meshes of the polygon meshes of the target virtual scene model based on the decimation ratio parameter to obtain a processed virtual scene model.
4. The method for processing a virtual scene model according to claim 1, characterized in that, the obtaining a shape constraint parameter and a decimation ratio parameter includes: obtaining a first decimation ratio parameter corresponding to a first physical function, a second decimation ratio parameter corresponding to a second physical function, and a shape constraint parameter; performing decimation processing on the polygon meshes of the target virtual scene model based on the shape constraint parameter and the first decimation ratio parameter to obtain a first processed virtual scene model, wherein the first processed virtual scene model is used to generate a target virtual scene model with a first target physical function; performing decimation processing on the polygon meshes of the target virtual scene model based on the shape constraint parameter and the second decimation ratio parameter to obtain a second processed virtual scene model, wherein the second processed virtual scene model is used to generate a target virtual scene model with a second target physical function.
5. The method for processing a virtual scene model according to claim 1, characterized in that, the generating a target physical resource with a target physical function based on preset physical property parameters and the processed virtual scene model includes: generating a target bounding box with a target physical function based on preset bounding box parameters and the model shape of the processed virtual scene model; Mounting the target physical resource onto the target virtual scene model to obtain a target virtual scene model with the target physical function includes: Mounting the target bounding box onto the target virtual scene model to obtain a target virtual scene model with the target physical function.
6. The method for processing a virtual scene model according to claim 5, wherein, generating a target bounding box with a target physical function based on preset bounding box parameters and the model shape of the processed virtual scene model includes: Obtaining preset bounding box parameters, where the preset bounding box parameters include bounding box size parameters and bounding box shape parameters; Determining the center point position of the model shape based on the model shape of the processed virtual scene model; Generating a target bounding box with a target physical function based on the center point position, the bounding box size parameters, and the bounding box shape parameters.
7. The method for processing a virtual scene model according to claim 6, wherein, before obtaining the preset bounding box parameters, further includes: Obtaining the model shape and model size of the processed virtual scene model; Determining the bounding box shape parameters based on the model shape; Determining the bounding box size parameters based on the model size.
8. The method for processing a virtual scene model according to claim 6, wherein, before obtaining the preset bounding box parameters, further includes: Displaying a graphical user interface, where the graphical user interface displays a parameter setting page, and at least one parameter input interface is included on the parameter setting page; Responding to a submission operation of parameter information input to the parameter input interface, and obtaining the input parameter information as the preset bounding box parameters.
9. The method for processing a virtual scene model according to claim 5, wherein, after obtaining at least one target virtual scene model from a preset virtual scene space, further includes: Exporting the target virtual scene model from the virtual scene space through a file export interface corresponding to a first file format to obtain a model file in the first file format corresponding to the target virtual scene model.
10. The method for processing a virtual scene model according to claim 9, wherein, performing decimation processing on the polygon mesh of the target virtual scene model based on preset decimation parameters to obtain a processed virtual scene model includes: Invoking a decimation function interface to perform decimation processing on the polygon mesh of the target virtual scene model corresponding to the model file to obtain a processed virtual scene model and a model file in a second file format corresponding to the processed virtual scene model.
11. The method for processing a virtual scene model according to claim 10, wherein, the method further includes: Import the model file in the second file format corresponding to the processed virtual scene model into the game engine where the target virtual scene model is located, and call the game engine to perform physical resource generation processing on the model file in the second file format, to obtain a target bounding box with target physical functions corresponding to the processed virtual scene model, and a physical resource file corresponding to the target bounding box.
12. The method for processing a virtual scene model according to claim 11, wherein, the method further includes: obtaining a target file path of the physical resource file; associating the target file path with the model description file of the target virtual scene model, so as to mount the target bounding box onto the target virtual scene model, to obtain a target virtual scene model with the target physical functions.
13. A device for processing a virtual scene model, wherein, it includes: an obtaining unit, configured to obtain at least one target virtual scene model from a preset virtual scene space, wherein the target virtual scene model is composed of a plurality of polygon meshes; a first processing unit, configured to perform decimation processing on the polygon meshes of the target virtual scene model based on preset decimation parameters, to obtain a processed virtual scene model; a generating unit, configured to generate a target physical resource with target physical functions based on preset physical attribute parameters and the processed virtual scene model; a second processing unit, configured to mount the target physical resource onto the target virtual scene model, so as to obtain a target virtual scene model with the target physical functions.
14. A computer device, wherein, it includes a processor, a memory, and a computer program stored on the memory and capable of running on the processor, and when the computer program is executed by the processor, it implements the method for processing a virtual scene model according to any one of claims 1 to 12.
15. A computer-readable storage medium, wherein, a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the method for processing a virtual scene model according to any one of claims 1 to 12.
Citation Information
Patent Citations
Scene rendering method and device, computer readable storage medium and computer equipment
CN111105491A
Method for segmenting medical images and detecting surface anomalies in anatomical structures
US6246784B1