Game scene processing method and device, electronic equipment and storage medium
By determining the target model and model parameters in the game scene, building and cutting the bounding box to generate a preview volume box, the problems of inefficiency and poor accuracy during the game scene processing are solved, and efficient and accurate game content is achieved and the expansion is achieved. The application scope of model editing.
Patent Information
- Application Number
- CN202411303642.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2024-12-06
AI Technical Summary
The problems of inefficiency and poor accuracy during game scene processing, especially when manually adjusting the volume box and drawing the bounding box, it is easy to have the problem of missing or multiple packs, and the accuracy of judgment of the naked eye is poor.
By determining the target model and model parameters, the overall bounding box is built and cut into a preview volume box, the transformation information is obtained to create a scene volume box, and the game content is automatically added to improve processing efficiency and accuracy.
It realizes the rapid generation of accurate and tight preview volume boxes, improves processing efficiency and accuracy, expands the application scope of model editing, and meets different game needs.
Smart Images

Figure CN119075306A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method for processing a game scene, a device for processing a game scene, an electronic device, and a computer-readable storage medium. Background Art
[0002] In the process of building game scenes, special effects can usually be added to the game scenes, for example, to adjust the lens exposure when the player enters a bright or dim scene, or to improve the lighting rendering quality of the corresponding area. However, due to the irregularity of the game scenes, repeated manual adjustments are required, which not only consumes a lot of manpower, but also has the problem that the naked eye cannot judge the accuracy. Summary of the invention
[0003] The embodiments of the present invention provide a method, device, electronic device and computer-readable storage medium for processing a game scene, so as to solve or partially solve the problems of low efficiency and poor accuracy in the processing of the game scene.
[0004] The embodiment of the present invention discloses a method for processing a game scene, comprising:
[0005] Determine a target model located in a game scene and model parameters of the target model, wherein the target model is located in a target area in the game scene;
[0006] Constructing an overall bounding box corresponding to the target model according to the model parameters;
[0007] Cutting the overall bounding box to obtain a plurality of preview volume boxes corresponding to the overall bounding box;
[0008] The transformation information of the preview volume box is obtained, and a scene volume box corresponding to the transformation information is created to wrap the target area, and game content is added to the target area through the scene volume box.
[0009] The embodiment of the present invention further discloses a device for processing a game scene, comprising:
[0010] A model determination module, used to determine a target model located in a game scene and model parameters of the target model, wherein the target model is located in a target area in the game scene;
[0011] A bounding box construction module, used to construct an overall bounding box corresponding to the target model according to the model parameters;
[0012] A cutting module, used for cutting the overall bounding box to obtain a plurality of preview volume boxes corresponding to the overall bounding box;
[0013] The model processing module is used to obtain the transformation information of the preview volume box, and create a scene volume box corresponding to the transformation information to wrap the target area, and add game content to the target area through the scene volume box.
[0014] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0015] The memory is used to store computer programs;
[0016] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.
[0017] The embodiment of the present invention further discloses a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, enables the processors to execute the method described in the embodiment of the present invention.
[0018] The embodiments of the present invention include the following advantages:
[0019] In an embodiment of the present invention, in the process of processing the game scene, the target model of the target area located in the game scene and the model parameters of the target model can be determined first, and then an overall bounding box corresponding to the target model is constructed according to the model parameters, and then the overall bounding box is cut to obtain a number of preview volume boxes corresponding to the overall bounding box, and then the transformation information of the preview volume box is obtained, and a scene volume box corresponding to the transformation information is created to wrap the target area, and game content is added to the target area through the scene volume box. Therefore, in the process of processing the game scene, the user only needs to determine the game scene to be processed and the target model in the game scene, and can quickly generate an accurate and compact preview volume box based on the corresponding parameters, which not only improves the processing efficiency but also ensures the accuracy. At the same time, after generating the preview volume box, a corresponding scene volume box can be created for the target model based on the transformation information of the preview volume box, so as to add corresponding game content to the model, expand the application surface of model editing, and meet different game requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a flowchart of a method for processing a game scene provided in an embodiment of the present invention;
[0021] Figure 2 is a schematic diagram of a rectangular block area provided in an embodiment of the present invention;
[0022] Figure 3 is a schematic diagram of a rectangular bounding box provided in an embodiment of the present invention;
[0023] Figure 4 is a schematic diagram of a preview volume box provided in an embodiment of the present invention;
[0024] Figure 5 is a structural block diagram of a device for processing a game scene provided in an embodiment of the present invention;
[0025] Figure 6 It is a block diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0027] As an example, when building a game scene in a game engine, it is often necessary to use a volume box to select a specific area in the game scene in order to achieve corresponding special effects in the selected target area. For example, for performance reasons, during the selection process, usually only the area where the virtual character controlled by the player can move freely in the game scene is considered, rather than the entire game scene area. Among them, the area where the virtual character can move freely is an irregular area, and the volume box is a cube. In order not to frame too many non-free action areas, many volume boxes can only be used to piece them together. However, when using a volume box to wrap the free action area, on the one hand, manual adjustment can be used to manually copy the bounding box multiple times and piece together the package using the translation, scaling, rotation tools, etc. provided by the engine. This process is inefficient and has poor results. It is necessary to adjust the position, scaling, rotation, etc. of each volume box one by one, which is time-consuming and requires the user to estimate the accuracy of the encirclement with the naked eye. It is easy to have problems such as missing or multiple packages, and it takes a long time to adjust. On the other hand, the top view can be drawn using the drawing tools provided by the engine to draw a rough area with a polyline on the top view to generate a bounding box. This process can only be drawn on the top view and cannot adapt to the height information of the scene. The generated volume box is fixed on a plane with a height of 0, and the height needs to be manually adjusted to match the actual play area. If the area is a slope, manual adjustment cannot be adapted. In addition, if the play area is more complex (such as an urban road network), drawing with polylines is extremely time-consuming and laborious, and there is also the problem of poor accuracy in judging the encirclement by the naked eye.
[0028] In this regard, in the present invention, in the process of processing the game scene, the target model located in the target area of the game scene and the model parameters of the target model can be determined first, and then an overall bounding box corresponding to the target model is constructed according to the model parameters, and then the overall bounding box is cut to obtain a number of preview volume boxes corresponding to the overall bounding box, and then the transformation information of the preview volume box is obtained, and a scene volume box corresponding to the transformation information is created to wrap the target area, and game content is added to the target area through the scene volume box. Therefore, in the process of processing the game scene, the user only needs to determine the game scene to be processed and the target model in the game scene, and can quickly generate an accurate and compact preview volume box based on the corresponding parameters, which not only improves the processing efficiency but also ensures the accuracy. At the same time, after generating the preview volume box, a corresponding scene volume box can be created for the target model based on the transformation information of the preview volume box, so as to add corresponding game content to the model, expand the application surface of model editing, and meet different game needs.
[0029] Reference Figure 1 , shows a flowchart of a method for processing a game scene provided in an embodiment of the present invention, which may specifically include the following steps:
[0030] Step 101, determining a target model located in a game scene and model parameters of the target model, wherein the target model is located in a target area in the game scene;
[0031] In the embodiment of the present invention, the game scene may be the environment and background presented to the player in the game client, which may include terrain, buildings, vegetation, sky, lighting, weather effects, and other visual effects and auditory elements, etc. The game scene may include corresponding models, and the user may add corresponding special effects to the model of the game scene, thereby presenting a complex and realistic game scene to the player.
[0032] Among them, the target model can be a model that provides support for the movement of virtual objects in the game, which can be located in the target area in the game scene, for example, it is a ground model of the corresponding area in the game scene, that is, the ground model can be basically equal to the area where the virtual object can move freely in the game scene. By providing this part of the ground model to the game scene processing tool, and the game scene processing tool processes the ground model, a corresponding preview volume box can be obtained, and then the preview volume box is used to add corresponding special effects to the target area where the ground model is located. For example, for the track area in the game scene, the corresponding track model can be included in the track area, and then a preview volume box corresponding to the track model is constructed, and then corresponding special effects are added to the track area based on the preview volume box.
[0033] It should be noted that for the automated processing of game scenes, it can be done through corresponding scripts or plug-ins. By running the scripts or plug-ins in the game engine and inputting the game data to be processed into the game engine, the scripts or plug-ins can automatically process the game data according to the corresponding processing logic to achieve automatic placement of the preview volume box of the target model in the game scene. Based on the automatically placed preview volume box, the user can further add corresponding special effects, thereby quickly generating accurate and compact preview volume boxes through an automated process, which not only improves processing efficiency but also ensures accuracy.
[0034] In actual use, this execution process is a "black box" processing process for users. Users usually only feel a short pause, and then the automatically generated preview volume box appears in the game scene. Based on this, in the embodiment of the present invention, the specific processing process is exemplified, and it can be understood that the present invention does not limit this.
[0035] In the process of processing the game scene, the user can run the corresponding game engine on the terminal, open the relevant game scene in the game engine, and present the relevant model in the game scene. Then, the game scene processing tool can be run in the game engine. After the game scene processing tool is started, the model in the shape of the corresponding icon can exist in the game scene. Then, the user can enter the corresponding initialization instruction to set the world coordinates of the icon model to 0. Since the preview volume box generated by the game scene processing tool can be mounted as a sub-item of the game scene processing tool under the game scene processing tool, by setting the world coordinates to 0, it can be ensured that the icon model itself has no position transformation. Then, the target model (the target model in the embodiment of the present application can be a ground model in the game scene) can be fully selected and specified as the input of the game scene processing tool, and the game scene processing tool will analyze and cut it. For each piece cut out, a rectangular block matching its size is used to wrap it. Finally, these rectangular blocks of different sizes are replaced one-to-one with the actual volume boxes in the engine, and the preview volume box placement of the play area can be quickly completed.
[0036] Step 102, constructing an overall bounding box corresponding to the target model according to the model parameters;
[0037] In the process of automatically placing the preview volume box by the game scene processing tool, the overall bounding box of the target model can be constructed according to the model parameters of the target model, so as to first construct a bounding box that can completely surround the target model, and then perform subsequent segmentation operations, thereby effectively ensuring the integrity of the cutting. Optionally, for the construction of the overall bounding box, it can be constructed based on the world coordinate system. By placing the target model in the world coordinate system, the coordinates of each point on the target model in the world coordinate system can be obtained, so as to perform corresponding calculations based on the obtained coordinates and obtain the model parameters corresponding to the target model.
[0038] In some feasible implementations, the model parameters include at least a first center point coordinate and a model size, the first center point coordinate is a coordinate determined according to the coordinate data of the target model in the world coordinate system, and the model size includes at least a model length, a model width, and a model height of the target model. The model length, the model width, the model height, and the first center point coordinate can be first used for calculation to obtain several vertex coordinates corresponding to the target model, and then the maximum coordinate and the minimum coordinate can be determined from the vertex coordinates, and then the maximum coordinate and the minimum coordinate can be used for calculation to obtain an overall bounding box corresponding to the target model.
[0039] It should be noted that the first center point coordinates and model size of the target model are obtained by executing the two vex language functions getbbox_center and getbbox_size at the Detail level. Among them, getbbox_center can be the center point coordinates of the bounding box used to calculate the geometric body (such as model, point cloud, etc.), and the specific process can be: traverse all points of the ground model, obtain the maximum and minimum values of each point on each coordinate axis, define the boundary of the bounding box based on the coordinates, calculate the center point coordinates of the bounding box based on the boundary value, and return the center point coordinates; getbbox_size can be the size of the bounding box used to calculate the geometric body (such as model, point cloud, etc.), and the specific process can be: traverse all points of the ground model, obtain the maximum and minimum values of each point on each coordinate axis, calculate the size of the bounding box based on the coordinates, and return the obtained size, so that the first center point coordinates and model size of the target model can be accurately obtained based on the corresponding language function, so as to create the overall bounding box corresponding to the target model based on the first center point coordinates and model size.
[0040] In one example, assuming the model dimensions are:
[0041] Model length: 10 units
[0042] Model width: 5 units
[0043] Model height: 3 units
[0044] Center Point Coordinates: (2,3,1)
[0045] First, the 8 vertex coordinates of the model can be calculated based on the size of the model and the center point coordinates. The vertex coordinates can be calculated by adding or subtracting half the size of each dimension from the center point coordinates.
[0046] Compute half the size in each dimension:
[0047] Half Length=Length / 2=10 / 2=5
[0048] Half Width=Width / 2=5 / 2=2.5
[0049] Half Height=Height / 2=3 / 2=1.5
[0050] Calculate the coordinates of the 8 vertices:
[0051] Vertex 1: (2-5, 3-2.5, 1-1.5) = (-3, 0.5, -0.5)
[0052] Vertex 2: (2-5, 3-2.5, 1+1.5) = (-3, 0.5, 2.5)
[0053] Vertex 3: (2-5, 3+2.5, 1-1.5) = (-3, 5.5, -0.5)
[0054] Vertex 4: (2-5, 3+2.5, 1+1.5) = (-3, 5.5, 2.5)
[0055] Vertex 5: (2+5,3-2.5,1-1.5) = (7,0.5,-0.5)
[0056] Vertex 6: (2+5,3-2.5,1+1.5)=(7,0.5,2.5)
[0057] Vertex 7: (2+5,3+2.5,1-1.5) = (7,5.5,-0.5)
[0058] Vertex 8: (2+5,3+2.5,1+1.5) = (7,5.5,2.5)
[0059] Next, we can determine the maximum and minimum coordinates by finding the maximum and minimum values of each dimension from the vertex coordinates: minimum coordinate (Min X, Min Y, Min Z) = (-3, 0.5, -0.5), maximum coordinate (Max X, Max Y, Max Z) = (7, 5.5, 2.5).
[0060] Finally, based on the calculated minimum and maximum coordinates, the overall bounding box corresponding to the target model can be further calculated. Specifically, the center point and size of the overall bounding box can be calculated using the maximum and minimum coordinates:
[0061] Calculate the coordinates of the center point of the bounding box:
[0062] Center X=(Min X+Max X) / 2=(-3+7) / 2=2
[0063] Center Y=(Min Y+Max Y) / 2=(0.5+5.5) / 2=3
[0064] Center Z=(Min Z+Max Z) / 2=(-0.5+2.5) / 2=1
[0065] Therefore, the coordinates of the center point of the bounding box are (2,3,1).
[0066] Calculate the size of the bounding box:
[0067] Size X=Max X-Min X=7-(-3)=10
[0068] Size Y=Max Y-Min Y=5.5-0.5=5
[0069] Size Z=Max Z-Min Z=2.5-(-0.5)=3
[0070] So, the dimensions of the bounding box are (10,5,3).
[0071] Through the above process, after the target model is input, the game scene processing tool can obtain the first center point coordinates and model size of the target model based on the vex language function, and then calculate the overall bounding box corresponding to the target model based on the two, so as to first construct a bounding box that can completely surround the target model, and then perform subsequent segmentation operations, thereby effectively ensuring the integrity of the cutting.
[0072] Step 103, cutting the overall bounding box to obtain a plurality of preview volume boxes corresponding to the overall bounding box;
[0073] After obtaining the overall bounding box, the overall bounding box can be cut equidistantly in two different directions, horizontally and vertically, according to corresponding processing parameters to obtain several preview volume boxes corresponding to the overall bounding box, thereby dividing the overall bounding box into several preview volume boxes with smaller volumes.
[0074] In some feasible implementations, the cutting parameters for the overall bounding box can be obtained first, and then the overall bounding box can be cut according to the cutting parameters to obtain a rectangular bounding box corresponding to the overall bounding box, and then the rectangular bounding box can be converted to obtain a preview volume box corresponding to the target model.
[0075] Among them, both the overall bounding box and the rectangular bounding box can be temporary data processed by the bottom layer of the game scene processing tool, which are invisible to the user, and the preview volume box can be a bounding box displayed in the game scene. The target model can be completely wrapped by several preview volume boxes, so that the user can add corresponding special effects to the target model based on the preview volume box, and the overall bounding box is cut by setting corresponding cutting parameters. After the overall bounding box is cut into several smaller rectangular bounding boxes, the rectangular bounding box can be converted into a preview volume box presented to the user. On the one hand, the processing unit of the bounding box is refined through the cutting method to improve the accuracy of the bounding box processing. On the other hand, the temporary data processed by the game scene processing tool is converted into the game scene through the bounding box conversion, so that the user can add corresponding special effects to the target model in the game scene based on the preview volume box.
[0076] Optionally, the cutting parameters include at least a first cutting parameter and a second cutting parameter, the first cutting parameter is a parameter for cutting the overall bounding box into a first number of segments in a first direction, and the second cutting parameter is a parameter for cutting the overall bounding box into a second number of segments in a second direction. If the first direction is different from the second direction, when cutting the overall bounding box, the overall bounding box can be cut according to the first cutting parameter to obtain a number of segments corresponding to the overall bounding box, and then the first bounding box parameter of the overall bounding box is obtained, and then the segments are cut according to the first bounding box parameter and the second cutting parameter to obtain a rectangular bounding box corresponding to the overall bounding box. The first bounding box parameter may include geometric parameters of the overall bounding box, such as the coordinates of the third center point, the bounding box length, the bounding box width, and the bounding box height.
[0077] In one example, the first cutting parameter may be the number of longitudinal cutting segments, which indicates that the overall bounding box is cut into a number of equidistant segments in the longitudinal direction. For example, the number of longitudinal cutting segments may be 100, which indicates that the overall bounding box is cut into equidistant segments in the longitudinal direction to obtain 100 corresponding segments. The second cutting parameter may be the number of transverse cutting segments, which indicates that the overall bounding box is cut into a number of equidistant segments in the transverse direction. For example, the number of transverse cutting segments may be 100, which indicates that the overall bounding box is cut into equidistant segments in the transverse direction to obtain 100 corresponding segments. It can be understood that when the overall bounding box is first cut into a number of segments according to the first cutting parameter and then cut according to the second cutting parameter, the object of cutting is the segment, that is, each segment is cut equidistantly according to the second cutting parameter to obtain a rectangular bounding box corresponding to the overall bounding box. For example, the overall bounding box may be first cut equidistantly in the longitudinal direction to obtain 100 segments, and then cut equidistantly in the transverse direction to obtain 8,000 rectangular bounding boxes, etc.
[0078] It should be noted that the embodiments of the present invention include but are not limited to the above examples. It can be understood that the first cutting parameter can also be the number of horizontal cutting segments, the second cutting parameter can also be the number of vertical cutting segments, etc. The present invention does not limit this.
[0079] In some feasible implementations, the model parameters include at least the first center point coordinates and the model size. The first center point coordinates, the model size and the first cutting parameters can be used to cut the overall bounding box to obtain a number of segments corresponding to the overall bounding box. Then, the second center point coordinates corresponding to each segment can be obtained, and the segments can be cut based on the first bounding box parameters, the second center point coordinates and the second cutting parameters to obtain a rectangular block area corresponding to the overall bounding box. Then, the height extension parameters for the rectangular block area are obtained, and the rectangular block area is processed with the height extension parameters to obtain a rectangular bounding box corresponding to the overall bounding box. The rectangular block area can be a cubic area obtained by cutting the overall bounding box horizontally and vertically at equal intervals, and the height extension parameter can be a parameter set by the user, which can be used to extend the top surface of the rectangular block area vertically upward on the existing basis. For example, when the height extension parameter is 0, the top and bottom surfaces of the rectangular block area can directly contact the target model, and when the height extension parameter is 10, the top surface of the rectangular block area can be extended by 10 units in the vertically upward direction, such as 10 meters. The coordinates of the second center point may be coordinates determined according to the coordinate data of the segment in the world coordinate system, and the present invention is not limited to this.
[0080] In a specific implementation, the first bounding box parameters include at least the third center point coordinates, the bounding box length, and the bounding box width. After the first cutting to obtain a number of segments, the second center point coordinates corresponding to each segment can be determined. The half-width of a single segment is obtained by using the model length and the number of segments for calculation, and then the first target component is extracted from the third center point coordinates. Then, the first target component, the half-width, and the model width are used for calculation to obtain the second center point coordinates corresponding to each segment. Then, the second target component can be extracted from the second center point coordinates, and the segments are cut according to the model size, each second target component, and the second cutting parameters to obtain the rectangular block area corresponding to the overall bounding box. Among them, the third center point coordinates can be coordinates determined according to the coordinate data of the overall bounding box in the world coordinate system, and the present invention is not limited to this.
[0081] Among them, the model size of the overall bounding box can include the bounding box height and the bounding box width. The above-mentioned second cutting process can first extract the third target component and the fourth target component from the third center point coordinates corresponding to the overall bounding box, and then obtain the slice width of the segment, and then cut the segment according to the second cutting parameter, the second target component, the third target component, the fourth target component, the bounding box height and the bounding box width to obtain the rectangular block area corresponding to the overall bounding box, and then expand the rectangular block area in height according to the height expansion parameter to obtain the rectangular bounding box corresponding to the overall bounding box, so that through two cuttings in different directions, the overall bounding box is cut into several rectangular block areas, and then the height is expanded based on the height expansion parameter to obtain the rectangular bounding box. At this point, the bounding box cutting of the target model is completed, and several rectangular bounding boxes that can completely surround the target model are obtained. Based on these rectangular bounding boxes, a preview volume box that "really" surrounds the target model in the game scene can be obtained, and then the corresponding special effects can be added to the target area where the target model is located.
[0082] It should be noted that the components can be coordinate components on the corresponding coordinate axes. For example, the first target component can be the x component on the coordinates of the third center point, the second target component can be the x component on the coordinates of the second center point, the third target component can be the y component on the coordinates of the third center point, the fourth target component can be the z component on the coordinates of the first center point, and so on. The values of the components can be flexibly adjusted according to the actual cutting direction, and the present invention does not limit this.
[0083] In one example, assuming that the first cutting is to perform longitudinal equidistant cutting, after obtaining the corresponding several segments, the half-width of a single slice can be calculated by dividing the overall bounding box length of the target model by twice the number of slices, and then the x-component of the third center point coordinate of the overall bounding box is subtracted from half of the width of the overall bounding box, and then the half-width of a single slice is added to obtain the x-coordinate of the center point of the first slice on the left. Then, after calculating the center point coordinates corresponding to each slice, move to the center position of the next slice for calculation, calculate the width of a single slice by dividing the length of the bounding box by the number of slices, and based on the x-coordinate of the center point of the first slice at the edge, continuously loop and accumulate the width of a single slice to obtain the x-coordinate of the center points of all slices, and then add the x-components of the center points of all longitudinal segments to the preset z_array group to obtain the corresponding target array. After obtaining the target array, further horizontal cutting can be performed by obtaining the slice number of the current loop, and then extracting the x coordinate of the center point of the slice. Then, based on the number of horizontal cutting segments, the x coordinate of the center point of the slice, the y coordinate of the center point of the overall bounding box, the z coordinate of the center point of the overall bounding box, the width and height of the overall bounding box, and the width of the slice, secondary cutting can be performed. Based on the two vertical and horizontal cutting, the overall bounding box can be cut into several rectangular block areas, and each rectangular block area obtained by cutting can be marked to distinguish them. For example, Figure 2 As shown in FIG. 1 , a schematic diagram of a rectangular block region provided in an embodiment of the present invention is shown. After two cuts in different directions, several rectangular block regions corresponding to the target model can be obtained. Figure 3 As shown, a schematic diagram of a rectangular bounding box provided in an embodiment of the present invention is shown. After obtaining each rectangular block area, the height of each rectangular block area can be extended in the vertical direction according to the height extension parameter set by the user to obtain a rectangular bounding box corresponding to the overall bounding box, thereby refining the processing unit of the bounding box through cutting and improving the accuracy of the bounding box processing.
[0084] After obtaining the rectangular bounding box, you can further obtain the second bounding box parameters corresponding to the rectangular bounding box. The second bounding box parameters may include the fourth center point coordinates of the rectangular bounding box and the bounding box size. Then, you can first match the rectangular bounding box with the preset standard cube according to the bounding box size, and obtain the relative transformation information of each rectangular bounding box relative to the standard cube. Then, locate the target position corresponding to each fourth center point coordinate in the game scene, create a standard cube at the target position, and transform the standard cube according to the relative transformation information to obtain a preview volume box corresponding to the target model.
[0085] It should be noted that the above-mentioned overall bounding box, rectangular block area, and rectangular bounding box, etc., can all be the underlying processing process of the game scene processing tool, which is invisible to the user, that is, "temporary data". The rectangular bounding box finally obtained in the above processing process can be converted into a preview volume box that can be presented to the user. Therefore, the volume box can be replaced by using the center point of the rectangular bounding box, and the relative transformation information of each rectangular bounding box relative to the standard cube with standard units of length, width and height can be calculated, and the transformation information can be recorded at the corresponding point to perform the bounding box conversion.
[0086] For example, refer to Figure 4 , shows a schematic diagram of the preview volume box provided in an embodiment of the present invention. Assuming that the length, width and height of the standard cube are 1m, and assuming that the length, width and height of the original rectangular bounding box are 10m, 5m and 3m respectively, the relative transformation can be (10, 5, 3), that is, the standard cube is exactly the same size as the original rectangular bounding box when the length is multiplied by 10, the height is multiplied by 5 and the width is multiplied by 3. Therefore, after the conversion, the target model can be completely covered by several preview volume boxes, and the user can also be presented with the situation that the target model is covered by the preview volume box, so that the user can make further adjustments.
[0087] In one example, during the conversion process, a string attribute named unreal_instance can be added to the center point corresponding to the rectangular bounding box, and the attribute value can be set to the preview volume box asset (BP_LightmassPreview) path in the game engine. After reading the center point and related data corresponding to each rectangular bounding box, the game engine can add the preview volume box asset (BP_LightmassPreview) specified by the unreal_instance attribute to the game scene at the corresponding position in the game scene, and apply the relative transformation synchronously to show the user the preview volume box corresponding to each rectangular bounding box in the game scene processing tool in the game scene. Based on the above process, on the one hand, the processing unit of the bounding box is refined by cutting to improve the accuracy of the bounding box processing. On the other hand, through the bounding box conversion, the temporary data processed by the game scene processing tool is converted into the game scene, so that the user can add corresponding special effects to the target area where the target model in the game scene is located based on the preview volume box.
[0088] Step 104: Obtain transformation information of the preview volume box, and create a scene volume box corresponding to the transformation information to wrap the target area, and add game content to the target area through the scene volume box.
[0089] For the preview volume box, you can obtain the position, scale and other transformation information of each preview volume box, and then create a scene volume box added by the user to the target model based on the transformation information. By applying the transformation information of the preview volume box to the scene volume box, you can add corresponding game content to the target model through the scene volume box, thereby adding corresponding game content to the area where the model is located, expanding the application surface of model editing to meet different game needs.
[0090] Optionally, the scene volume box includes at least one of a post-processing volume box, a lighting volume box, an audio volume box, a trigger volume box, an environment volume box, a physics volume box, a camera volume box and a special effect volume box.
[0091] Among them, the post-processing volume box is a technology used to apply various visual effects in 3D scenes. These effects include but are not limited to: color correction (Color Grading), depth of field (Depth of Field), motion blur (MotionBlur), ambient occlusion (Ambient Occlusion), glow (Bloom), tone mapping (Tone Mapping), etc. The post-processing volume box is usually an invisible volume that can cover the entire scene or a specific part of the scene. When the camera enters this volume, the specified post-processing effect will be applied to the rendered image. This allows developers to dynamically adjust the visual effects according to the needs of the scene, thereby enhancing immersion and visual appeal.
[0092] Light volume boxes are a technique used to optimize lighting calculations. In 3D rendering, lighting calculations are a computationally intensive process, especially when dealing with dynamic lighting and shadows. Important light volume boxes are used to specify which light sources have an important impact on specific areas of the scene, thereby ensuring that the lighting and shadow calculations of these light sources are prioritized. By using important light volume boxes, developers can ensure that key areas (such as the surroundings of player characters or important game elements) receive high-quality lighting effects, while reducing lighting calculations for unimportant areas, thereby improving rendering performance.
[0093] The Audio Volume box is used to control sound effects in the scene. When the player or camera enters this volume, specific audio effects (such as background music, ambient sounds, or special sound effects) will be activated or changed. This can be used to create a more immersive auditory experience, such as changing the pitch or volume of background music when entering a room.
[0094] The trigger volume box is used to trigger game events or logic. When a player, NPC or other game object enters this volume, specific game events can be triggered, such as starting a plot, activating a mechanism, spawning an enemy, etc. The trigger volume box is usually invisible and is only used to implement game logic.
[0095] The environment volume box is used to change the environment settings of the scene, such as weather, time and lighting conditions. When the player enters this volume, the environment parameters of the scene will change, such as changing from a sunny day to a rainy night, or switching from an indoor environment to an outdoor environment.
[0096] Physics Volumes are used to change physical properties in a scene, such as gravity, buoyancy, or drag. When game objects enter this volume, their physical behavior is adjusted according to the settings of the volume. For example, a physics volume can be set up in an underwater area to simulate buoyancy and drag underwater.
[0097] The Camera Volume box is used to change the parameters and behavior of the camera. When the camera enters this volume, the camera's field of view, focal length, motion path or other properties can be adjusted to suit specific shooting needs or create specific visual effects.
[0098] Effect Volumes are used to apply or alter various visual effects in a scene. This can include particle effects, screen space reflections, volumetric fog, etc. When the player or camera enters this volume, specific effects will be activated or adjusted to enhance the visual appearance of the scene.
[0099] It should be noted that the embodiments of the present invention include but are not limited to the above examples. It is understandable that those skilled in the art can also make settings according to actual needs under the guidance of the ideas of the embodiments of the present invention, and the present invention is not limited to this.
[0100] In an embodiment of the present invention, in the process of processing the game scene, the target model located in the target area of the game scene and the model parameters of the target model can be determined first, and then an overall bounding box corresponding to the target model is constructed according to the model parameters, and then the overall bounding box is cut to obtain a number of preview volume boxes corresponding to the overall bounding box, and then the transformation information of the preview volume box is obtained, and a scene volume box corresponding to the transformation information is created to wrap the target area, and game content is added to the target area through the scene volume box. Therefore, in the process of processing the game scene, the user only needs to determine the game scene to be processed and the target model in the game scene, and can quickly generate an accurate and compact preview volume box based on the corresponding parameters, which not only improves the processing efficiency but also ensures the accuracy. At the same time, after generating the preview volume box, a corresponding scene volume box can be created for the target model based on the transformation information of the preview volume box, so as to add corresponding game content to the model, expand the application surface of model editing, and meet different game requirements.
[0101] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0102] Reference Figure 5 , shows a structural block diagram of a game scene processing device provided in an embodiment of the present invention, which may specifically include the following modules:
[0103] A model determination module 501 is used to determine a target model located in a game scene and model parameters of the target model, wherein the target model is located in a target area in the game scene;
[0104] A bounding box construction module 502 is used to construct an overall bounding box corresponding to the target model according to the model parameters;
[0105] A cutting module 503 is used to cut the overall bounding box to obtain a plurality of preview volume boxes corresponding to the overall bounding box;
[0106] The model processing module 504 is used to obtain the transformation information of the preview volume box, and create a scene volume box corresponding to the transformation information to wrap the target area, and add game content to the target area through the scene volume box.
[0107] In some feasible implementations, the model parameters include at least first center point coordinates and model size, the first center point coordinates are coordinates determined according to coordinate data of the target model in the world coordinate system, the model size includes at least model length, model width and model height of the target model, and the bounding box construction module 502 is specifically used to:
[0108] Calculating using the model length, the model width, the model height, and the first center point coordinates to obtain a plurality of vertex coordinates corresponding to the target model;
[0109] Determining a maximum coordinate and a minimum coordinate from the vertex coordinates;
[0110] The maximum coordinate and the minimum coordinate are used to perform calculations to obtain an overall bounding box corresponding to the target model.
[0111] In some feasible implementations, the cutting module 503 is specifically used for:
[0112] Obtaining cutting parameters for the overall bounding box;
[0113] Cut the overall bounding box according to the cutting parameters to obtain a rectangular bounding box corresponding to the overall bounding box;
[0114] The rectangular bounding box is transformed to obtain a preview volume box corresponding to the target model.
[0115] In some feasible implementations, the cutting parameters include at least a first cutting parameter and a second cutting parameter, the first cutting parameter is a parameter for cutting the overall bounding box into a first number of segments in a first direction, the second cutting parameter is a parameter for cutting the overall bounding box into a second number of segments in a second direction, the first direction is different from the second direction, and the cutting module 503 is specifically used to:
[0116] Cutting the overall bounding box according to the first cutting parameter to obtain a plurality of segments corresponding to the overall bounding box;
[0117] Acquire first bounding box parameters of the overall bounding box, where the first bounding box parameters include geometric parameters of the overall bounding box;
[0118] The segment is cut according to the first bounding box parameter and the second cutting parameter to obtain a rectangular bounding box corresponding to the overall bounding box.
[0119] In some feasible implementations, the model parameters include at least the coordinates of the first center point, and the cutting module 503 is specifically used to:
[0120] The overall bounding box is cut using the first center point coordinates, the model size, and the first cutting parameters to obtain a plurality of segments corresponding to the overall bounding box.
[0121] In some feasible implementations, the cutting module 503 is specifically used for:
[0122] Acquire the second center point coordinates corresponding to each of the segments, where the second center point coordinates are coordinates determined according to the coordinate data of the segment in the world coordinate system;
[0123] Cut the segment based on the first bounding box parameter, the coordinates of each of the second center points, and the second cutting parameter to obtain a rectangular block area corresponding to the overall bounding box;
[0124] Obtaining a height extension parameter for the rectangular block area;
[0125] The rectangular block area is processed with the height expansion parameter to obtain a rectangular bounding box corresponding to the overall bounding box.
[0126] In some feasible implementations, the first bounding box parameters include at least the third center point coordinates, the bounding box length, and the bounding box width, the third center point coordinates are coordinates determined according to the coordinate data of the entire bounding box in the world coordinate system, and the cutting module 503 is specifically used to:
[0127] The length of the bounding box and the number of the segments are used to perform calculation to obtain the half width of a single segment;
[0128] Extracting a first target component from the third center point coordinates;
[0129] The first target component, the half width and the bounding box width are used for calculation to obtain the second center point coordinates corresponding to each of the segments.
[0130] In some feasible implementations, the cutting module 503 is specifically used for:
[0131] Extracting a second target component from the coordinates of the second center point;
[0132] The segment is cut according to the first bounding box parameter, each of the second target components and the second cutting parameter to obtain a rectangular block area corresponding to the overall bounding box.
[0133] In some feasible implementations, the first bounding box parameter further includes a bounding box height, and the cutting module 503 is specifically configured to:
[0134] Extracting a third target component and a fourth target component from the third center point coordinates;
[0135] Get the slice width of the segment;
[0136] The segment is cut according to the second cutting parameter, the second target component, the third target component, the fourth target component, the bounding box height, and the bounding box width to obtain a rectangular block area corresponding to the overall bounding box.
[0137] In some feasible implementations, the cutting module 503 is specifically used for:
[0138] Obtaining second bounding box parameters corresponding to each of the rectangular bounding boxes, where the second bounding box parameters include fourth center point coordinates and bounding box size;
[0139] Matching the rectangular bounding box with a preset standard cube according to the bounding box size to obtain relative transformation information of each rectangular bounding box with respect to the standard cube;
[0140] The target positions corresponding to the coordinates of each of the fourth center points are located in the game scene, and the standard cube is created at the target position. The standard cube is transformed according to the relative transformation information to obtain a preview volume box corresponding to the target model.
[0141] In some feasible implementations, the scene volume box includes at least one of a post-processing volume box, a lighting volume box, an audio volume box, a trigger volume box, an environment volume box, a physics volume box, a camera volume box, and a special effect volume box.
[0142] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0143] In addition, an embodiment of the present invention further provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned game scene processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0144] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned game scene processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0145] Figure 6 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention.
[0146] The electronic device 600 includes but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, a processor 610, and a power supply 611. Those skilled in the art will appreciate that the electronic device structure involved in the embodiments of the present invention does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently. In the embodiments of the present invention, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a wearable device, and a pedometer.
[0147] It should be understood that in the embodiment of the present invention, the radio frequency unit 601 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving downlink data from the base station, it is sent to the processor 610 for processing; in addition, uplink data is sent to the base station. Generally, the radio frequency unit 601 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 601 can also communicate with the network and other devices through a wireless communication system.
[0148] The electronic device provides users with wireless broadband Internet access through the network module 602, such as helping users to send and receive emails, browse web pages, and access streaming media.
[0149] The audio output unit 603 can convert the audio data received by the RF unit 601 or the network module 602 or stored in the memory 609 into an audio signal and output it as sound. Moreover, the audio output unit 603 can also provide audio output related to a specific function performed by the electronic device 600 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 603 includes a speaker, a buzzer, a receiver, etc.
[0150] The input unit 604 is used to receive audio or video signals. The input unit 604 may include a graphics processor (GPU) 6041 and a microphone 6042, and the graphics processor 6041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 606. The image frame processed by the graphics processor 6041 can be stored in the memory 609 (or other storage medium) or sent via the radio frequency unit 601 or the network module 602. The microphone 6042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 601 in the case of a telephone call mode.
[0151] The electronic device 600 also includes at least one sensor 605, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 6061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 6061 and / or the backlight when the electronic device 600 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 605 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.
[0152] The display unit 606 is used to display information input by the user or information provided to the user. The display unit 606 may include a display panel 6061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0153] The user input unit 607 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 607 includes a touch panel 6071 and other input devices 6072. The touch panel 6071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 6071 or near the touch panel 6071 using any suitable object or accessory such as a finger, stylus, etc.). The touch panel 6071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 610, receives the command sent by the processor 610 and executes it. In addition, the touch panel 6071 can be implemented in various types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch panel 6071, the user input unit 607 may also include other input devices 6072. Specifically, other input devices 6072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here.
[0154] Further, the touch panel 6071 may be covered on the display panel 6061. When the touch panel 6071 detects a touch operation on or near it, it is transmitted to the processor 610 to determine the type of the touch event, and then the processor 610 provides a corresponding visual output on the display panel 6061 according to the type of the touch event. It can be understood that in one embodiment, the touch panel 6071 and the display panel 6061 are used as two independent components to implement the input and output functions of the electronic device, but in some embodiments, the touch panel 6071 and the display panel 6061 can be integrated to implement the input and output functions of the electronic device, which is not limited here.
[0155] The interface unit 608 is an interface for connecting an external device to the electronic device 600. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 608 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 600 or may be used to transmit data between the electronic device 600 and an external device.
[0156] The memory 609 can be used to store software programs and various data. The memory 609 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 609 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0157] The processor 610 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 609 and calling data stored in the memory 609, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. The processor 610 may include one or more processing units; preferably, the processor 610 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 610.
[0158] The electronic device 600 may also include a power supply 611 (such as a battery) for supplying power to each component. Preferably, the power supply 611 may be logically connected to the processor 610 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.
[0159] In addition, the electronic device 600 includes some functional modules not shown, which will not be described in detail here.
[0160] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0161] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0162] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
[0163] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0164] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0165] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0166] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0167] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0168] If the functions are implemented in the form of 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 the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.
[0169] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for processing a game scene, characterized in that: include: Determine a target model located in a game scene and model parameters of the target model, wherein the target model is located in a target area in the game scene; Constructing an overall bounding box corresponding to the target model according to the model parameters; Cutting the overall bounding box to obtain a plurality of preview volume boxes corresponding to the overall bounding box; The transformation information of the preview volume box is obtained, and a scene volume box corresponding to the transformation information is created to wrap the target area, and game content is added to the target area through the scene volume box.
2. The method according to claim 1, characterized in that The model parameters include at least first center point coordinates and model size, the first center point coordinates are coordinates determined according to coordinate data of the target model in the world coordinate system, the model size includes at least model length, model width and model height of the target model, and constructing an overall bounding box corresponding to the target model according to the model parameters includes: Calculating using the model length, the model width, the model height, and the first center point coordinates to obtain a plurality of vertex coordinates corresponding to the target model; Determining a maximum coordinate and a minimum coordinate from the vertex coordinates; The maximum coordinate and the minimum coordinate are used to perform calculations to obtain an overall bounding box corresponding to the target model.
3. The method according to claim 1, characterized in that The step of cutting the overall bounding box to obtain a plurality of preview volume boxes corresponding to the overall bounding box includes: Obtaining cutting parameters for the overall bounding box; Cut the overall bounding box according to the cutting parameters to obtain a rectangular bounding box corresponding to the overall bounding box; The rectangular bounding box is transformed to obtain a preview volume box corresponding to the target model.
4. The method according to claim 3, characterized in that The cutting parameters include at least a first cutting parameter and a second cutting parameter, wherein the first cutting parameter is a parameter for cutting the overall bounding box into a first number of segments in a first direction, and the second cutting parameter is a parameter for cutting the overall bounding box into a second number of segments in a second direction, wherein the first direction is different from the second direction, and the cutting of the overall bounding box according to the cutting parameters to obtain a rectangular bounding box corresponding to the overall bounding box includes: Cutting the overall bounding box according to the first cutting parameter to obtain a plurality of segments corresponding to the overall bounding box; Acquire first bounding box parameters of the overall bounding box, where the first bounding box parameters include geometric parameters of the overall bounding box; The segment is cut according to the first bounding box parameter and the second cutting parameter to obtain a rectangular bounding box corresponding to the overall bounding box.
5. The method according to claim 4, characterized in that The model parameters at least include the coordinates of the first center point, and the cutting of the overall bounding box according to the first cutting parameters to obtain a plurality of segments corresponding to the overall bounding box includes: The overall bounding box is cut using the first center point coordinates, the model size, and the first cutting parameters to obtain a plurality of segments corresponding to the overall bounding box.
6. The method according to claim 4, characterized in that The step of cutting the segment according to the first bounding box parameter and the second cutting parameter to obtain a rectangular bounding box corresponding to the overall bounding box includes: Acquire the second center point coordinates corresponding to each of the segments, where the second center point coordinates are coordinates determined according to the coordinate data of the segment in the world coordinate system; Cut the segment based on the first bounding box parameter, the coordinates of each of the second center points, and the second cutting parameter to obtain a rectangular block area corresponding to the overall bounding box; Obtaining a height extension parameter for the rectangular block area; The rectangular block area is processed with the height expansion parameter to obtain a rectangular bounding box corresponding to the overall bounding box.
7. The method according to claim 6, characterized in that The first bounding box parameters include at least the third center point coordinates, the bounding box length, and the bounding box width, the third center point coordinates are coordinates determined according to the coordinate data of the overall bounding box in the world coordinate system, and the obtaining of the second center point coordinates corresponding to each of the segments includes: The length of the bounding box and the number of the segments are used to perform calculation to obtain the half width of a single segment; Extracting a first target component from the third center point coordinates; The first target component, the half width and the bounding box width are used for calculation to obtain the second center point coordinates corresponding to each of the segments.
8. The method according to claim 6 or 7, characterized in that: The step of cutting the segments based on the first bounding box parameters, the coordinates of each of the second center points, and the second cutting parameters to obtain a rectangular block area corresponding to the overall bounding box includes: Extracting a second target component from the coordinates of the second center point; The segment is cut according to the first bounding box parameter, each of the second target components and the second cutting parameter to obtain a rectangular block area corresponding to the overall bounding box.
9. The method according to claim 8, characterized in that The first bounding box parameter also includes a bounding box height, and the segment is cut according to the first bounding box parameter, each of the second target components, and the second cutting parameter to obtain a rectangular block area corresponding to the overall bounding box, including: Extracting a third target component and a fourth target component from the third center point coordinates; Obtaining the slice width of the segment; The segment is cut according to the second cutting parameter, the second target component, the third target component, the fourth target component, the bounding box height, and the bounding box width to obtain a rectangular block area corresponding to the overall bounding box.
10. The method according to claim 3, characterized in that The converting the rectangular bounding box to obtain a preview volume box corresponding to the target model includes: Obtaining second bounding box parameters corresponding to each of the rectangular bounding boxes, where the second bounding box parameters include fourth center point coordinates and bounding box size; Matching the rectangular bounding box with a preset standard cube according to the bounding box size to obtain relative transformation information of each rectangular bounding box with respect to the standard cube; The target positions corresponding to the coordinates of each of the fourth center points are located in the game scene, and the standard cube is created at the target position. The standard cube is transformed according to the relative transformation information to obtain a preview volume box corresponding to the target model.
11. The method according to claim 1, characterized in that: The scene volume box includes at least one of a post-processing volume box, a lighting volume box, an audio volume box, a trigger volume box, an environment volume box, a physics volume box, a camera volume box and a special effect volume box.
12. A device for processing a game scene, characterized in that: include: A model determination module, used to determine a target model located in a game scene and model parameters of the target model, wherein the target model is located in a target area in the game scene; A bounding box construction module, used to construct an overall bounding box corresponding to the target model according to the model parameters; A cutting module, used for cutting the overall bounding box to obtain a plurality of preview volume boxes corresponding to the overall bounding box; The model processing module is used to obtain the transformation information of the preview volume box, and create a scene volume box corresponding to the transformation information to wrap the target area, and add game content to the target area through the scene volume box.
13. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 11 when executing the program stored in the memory.
14. A computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 11.
