Model adjustment method and device, equipment and storage medium
By detecting the camera's top viewing conditions and adjusting the direction and offset of the grass model, the problem of players seeing the cross-sheet structure of the grass model from the top viewing angle is solved, which improves the realism of the game experience.
Patent Information
- Application Number
- CN202311397656.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-25
- Publication Date
- 2025-01-10
AI Technical Summary
In the game, when the player observes the grass model from a downward perspective, he will clearly see its cross-sheet structure, resulting in a reduced sense of realism in the game experience.
By detecting the camera's top viewing conditions, determine the adjustment direction and offset of the target model, and adjust the target model along the adjustment direction to avoid players from observing the cross-sheet structure. The specific steps include obtaining the camera's coordinates in the world space, determining the adjustment direction, calculating the offset based on the camera's z-axis component, and adjusting according to the weight coefficient of the vertex.
It improves the realism of the game experience, ensures that the grass model seen by players from a downward perspective is more natural, and avoids the appearance of cross-sheet structures.
Smart Images

Figure CN119280809A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a model adjustment method, device, equipment and storage medium. Background Art
[0002] In the design of game models, some object models can be designed to have a cross-shaped structure, such as a grass model. The game screen observed by the player user is related to the position of the virtual camera in the game. When the camera is set to observe from a horizontal or upward perspective, the grass model has a normal shape, and when the camera is set to observe from a top-down perspective, the cross-shaped structure of the grass model can be clearly observed. The grass in real life should be needle-shaped when viewed from the top, which is obviously very different from the shape observed by the camera from a top-down perspective. Therefore, if the player user observes the grass model from a top-down perspective and sees a cross-shaped structure, the realism of the game experience will be greatly reduced. Summary of the invention
[0003] The embodiments of the present invention provide a model adjustment method, device, equipment and storage medium, so as to improve the realism of game experience.
[0004] In a first aspect, an embodiment of the present invention provides a model adjustment method, the method comprising:
[0005] When the preset camera overlooking condition is detected, a target model with a cross-shaped structure in the current game field of view is determined;
[0006] Get the x-axis coordinate and y-axis coordinate of the camera in the world space;
[0007] Get the z-axis coordinate of the main character in the world space;
[0008] Determine the direction from the origin in the world space to the target point as the adjustment direction of the target model, wherein the position coordinates of the target point are the x-axis coordinate, the y-axis coordinate, and the z-axis coordinate;
[0009] Determining an offset of the target model based on a z-axis component of the camera in camera space;
[0010] Adjust the offset of the target model along the adjustment direction;
[0011] Display the adjusted target model.
[0012] Optionally, determining the offset of the target model based on the z-axis component of the camera in the camera space includes:
[0013] Obtain the z-axis component of the camera in the camera space;
[0014] The z-axis component is multiplied by -1 to obtain the offset of the target model.
[0015] Optionally, the target model includes a plurality of vertices, and the method further includes:
[0016] Obtaining preset weight coefficients corresponding to each vertex, wherein the weight coefficient is a value between 0 and 1, and the weight coefficient corresponding to the bottom vertex in the target model gradually increases to the weight coefficient corresponding to the top vertex;
[0017] The offsets are multiplied by the weight coefficients corresponding to the vertices to obtain adjusted offsets corresponding to the vertices.
[0018] Optionally, the weight coefficient of each vertex is stored in the b channel of the vertex color corresponding to each vertex.
[0019] Optionally, adjusting the offset of the target model along the adjustment direction includes:
[0020] For any vertex included in the target model, the offset corresponding to the vertex is adjusted along the adjustment direction.
[0021] Optionally, the step of determining a target model having a cross-shaped sheet structure in the current game field of view upon detecting that a preset camera overhead condition is satisfied includes:
[0022] If it is detected that the z-axis component of the camera in the camera space is less than 0, a target model having a cross-shaped structure in the current game field of view is determined.
[0023] Optionally, the target model is a ground vegetation model.
[0024] In a second aspect, an embodiment of the present invention provides a model adjustment device, including:
[0025] A determination module, used to determine a target model with a cross-shaped structure in the current game field of view when a preset camera overlooking condition is detected;
[0026] An acquisition module is used to acquire the x-axis coordinate and the y-axis coordinate of the camera in the world space; and to acquire the z-axis coordinate of the protagonist character in the world space;
[0027] The determination module is used to determine the direction from the origin in the world space to the target point as the adjustment direction of the target model, wherein the position coordinates of the target point are the x-axis coordinate, the y-axis coordinate and the z-axis coordinate; and determine the offset of the target model based on the z-axis component of the camera in the camera space;
[0028] An adjustment module, used for adjusting the offset of the target model along the adjustment direction;
[0029] The display module is used to display the adjusted target model.
[0030] Optionally, the determining module is used to:
[0031] Obtain the z-axis component of the camera in the camera space;
[0032] The z-axis component is multiplied by -1 to obtain the offset of the target model.
[0033] Optionally, the target model includes a plurality of vertices, and the adjustment module is further used for:
[0034] Obtaining preset weight coefficients corresponding to each vertex, wherein the weight coefficient is a value between 0 and 1, and the weight coefficient corresponding to the bottom vertex in the target model gradually increases to the weight coefficient corresponding to the top vertex;
[0035] The offsets are multiplied by the weight coefficients corresponding to the vertices to obtain adjusted offsets corresponding to the vertices.
[0036] Optionally, the weight coefficient of each vertex is stored in the b channel of the vertex color corresponding to each vertex.
[0037] Optionally, the adjustment module is used to:
[0038] For any vertex included in the target model, the offset corresponding to the vertex is adjusted along the adjustment direction.
[0039] Optionally, the determining module is used to:
[0040] If it is detected that the z-axis component of the camera in the camera space is less than 0, a target model having a cross-shaped structure in the current game field of view is determined.
[0041] Optionally, the target model is a ground vegetation model.
[0042] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor and a memory, wherein the memory stores executable code, and when the executable code is executed by the processor, the processor can at least implement the model adjustment method in the first aspect.
[0043] In a fourth aspect, an embodiment of the present invention provides a non-temporary machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor can at least implement the model adjustment method in the first aspect.
[0044] By adopting the present invention, when it is detected that the camera's viewing angle is a top-down view, the target model with a cross-shaped sheet structure within the current game field of view can be determined. In addition, the adjustment direction and offset for adjusting the target model can be determined, and then the target model is adjusted along the adjustment direction by the offset, and finally the adjusted result is displayed to the player user. In this way, when the player user observes the target model using a top-down view, the player user can avoid observing the cross-shaped sheet structure of the target model, making the picture effect presented to the player user more natural and more realistic, thereby improving the realism of the game experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0046] Figure 1 A schematic diagram of a flow chart of a model adjustment method provided by an embodiment of the present invention;
[0047] Figure 2 A schematic diagram of the display effect of a grass model before adjustment provided by an embodiment of the present invention;
[0048] Figure 3 A schematic diagram of the display effect of an adjusted grass model provided by an embodiment of the present invention;
[0049] Figure 4 A schematic diagram of the structure of a model adjustment device provided by an embodiment of the present invention;
[0050] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two.
[0053] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0054] In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.
[0055] Figure 1 The present invention provides a flow chart of a model adjustment method, which can be applied to electronic devices. Figure 1 As shown, the method comprises the following steps:
[0056] 101. When it is detected that a preset camera overhead condition is met, a target model having a cross-shaped structure in the current game field of view is determined.
[0057] 102. Obtain the x-axis coordinate and y-axis coordinate of the camera in the world space, and obtain the z-axis coordinate of the protagonist character in the world space.
[0058] 103. The direction from the origin in the world space to the target point is determined as the adjustment direction of the target model, wherein the position coordinates of the target point are the x-axis coordinate, the y-axis coordinate, and the z-axis coordinate.
[0059] 104. Determine an offset of the target model based on the z-axis component of the camera in the camera space.
[0060] 105. Adjust the offset of the target model along the adjustment direction.
[0061] 106. Display the adjusted target model.
[0062] When the player controls the main character to play the game, the player can adjust the game perspective through preset operations. For the device, adjusting the game perspective is equivalent to adjusting the position and rotation angle of the camera in the camera space.
[0063] It is worth noting that the value of the z-axis component of the camera in the camera space is between -1 and 1. Among them, when the value of the z-axis component is less than 0 and greater than or equal to -1, the camera's viewing angle is an upward viewing angle; when the value of the z-axis component is equal to 0, the camera's viewing angle is a horizontal viewing angle; when the value of the z-axis component is greater than 0 and less than or equal to 1, the camera's viewing angle is a downward viewing angle. Based on this, optionally, the camera's viewing angle can be judged according to the z-axis component of the camera in the camera space. In this way, when it is detected that the preset camera downward viewing condition is met, the target model with a cross-shaped structure in the current game field of view can be determined.
[0064] Optionally, the above process of determining the target model with a cross-shaped sheet structure in the current game field of view when the preset camera overhead condition is detected can be implemented as follows: if it is detected that the z-axis component of the camera in the camera space is less than 0, then the target model with a cross-shaped sheet structure in the current game field of view is determined. In other words, if it is detected that the viewing angle of the camera is an overhead view, the target model with a cross-shaped sheet structure in the current game field of view can be determined.
[0065] It is worth noting that since the final adjustment result of the target model is used to display to the player user, the model with a cross-shaped structure in the game scene that is not within the current game field of view may not be adjusted, because the player user cannot see those models that are not within the current game field of view.
[0066] Optionally, the target model with the cross-shaped structure may be a ground vegetation model, such as a grass model, a flower model, a rice ear model, a reed model, etc. Since the plants corresponding to these models belong to densely growing plants, the cross-shaped structure may be used to construct the corresponding models in the game scene.
[0067] When the camera's perspective is a bird's-eye view, if the target model within the current game field of view is not adjusted, the player user can observe the cross-shaped sheet structure of the target model, which will affect the realism of the game experience. Therefore, it is necessary to adjust the target model. Specifically, the adjustment direction and offset of the target model can be determined, so that after the target model is adjusted along the adjustment direction according to the offset, the player user can avoid observing the cross-shaped sheet structure of the target model, thereby increasing the realism of the game experience.
[0068] The following will introduce the specific implementation method of determining the adjustment direction and offset of the adjustment target model.
[0069] (1) Adjust direction
[0070] First, you can get the x-axis coordinate and y-axis coordinate of the camera in the world space. In addition, you can also get the z-axis coordinate of the protagonist in the world space. The world space is the space established by the game scene.
[0071] It should be noted that the adjustment direction of the target model needs to point to the position of the camera in the horizontal plane of the ground, so that the x-axis coordinate and y-axis coordinate of the camera in the world space can be obtained. In addition, since the camera is bound behind the protagonist, the z-axis coordinate of the protagonist in the world space is the height of the camera, which is also the height of the ground.
[0072] After obtaining the x-axis coordinate and y-axis coordinate of the camera in the world space and the z-axis coordinate of the protagonist in the world space, these coordinates can be combined, that is, (x-axis coordinate of the camera in the world space, y-axis coordinate of the camera in the world space, z-axis coordinate of the protagonist in the world space). The point corresponding to the newly obtained position coordinates in the world space after the combination can be called the target point, so that the direction from the origin to the target point in the world space can be determined, and this direction is determined as the adjustment direction of the target model.
[0073] In one example, the code for combining the x-axis coordinate and y-axis coordinate of the camera in the world space and the z-axis coordinate of the protagonist character in the world space in the above process can be expressed as:
[0074] float3offfsetVector=float3(AbsoluteWorldPosition.xyz)-float3(Camera.xy,Playerlocation.Z)
[0075] In some optional embodiments, after obtaining the newly obtained position coordinates after the combination, the position coordinates may also be normalized to generate a unit vector. In one example, the code of the normalization process may be expressed as:
[0076] offsetVector=Normalize(offsetVector)
[0077] (2) Offset
[0078] In summary, the offset of the target model can be determined based on the z-axis component of the camera in the camera space. In some optional embodiments, the process of calculating the offset can be implemented as follows: obtaining the z-axis component of the camera in the camera space; multiplying the z-axis component by -1 to obtain the offset of the target model.
[0079] From the previous introduction, we can know that the positive or negative value of the z-axis component of the camera in the camera space indicates whether the camera's perspective is looking down or looking up, and the absolute value of the z-axis component can indicate the angle of looking down or looking up. When the absolute value of the z-axis component is larger, the angle of looking down or looking up is larger, and when the absolute value of the z-axis component is smaller, the angle of looking down or looking up is smaller.
[0080] When the camera's viewing angle is a bird's-eye view, the value of the z-axis component is less than 0 and greater than or equal to -1. When the viewing angle is larger, the value of the z-axis component is closer to -1, and the absolute value of the z-axis component is larger. Based on this, when the camera's viewing angle is a bird's-eye view, if the z-axis component is multiplied by -1, the larger the value of the z-axis component, the larger the result. Conversely, the smaller the value of the z-axis component, the smaller the result. The result of multiplying the z-axis component by -1 is the offset. Therefore, using this calculation method, when the viewing angle is larger, the offset is larger, and when the viewing angle is smaller, the offset is smaller. The value of the result of multiplying the z-axis component by -1 is greater than 0 and less than or equal to 1.
[0081] In some optional embodiments, the target model as a whole may be adjusted using the same offset. In another optional embodiment, since the target model includes multiple vertices, the offset may be adjusted for each vertex, and then the corresponding vertex may be adjusted using the adjusted offset. It should be noted that if the target model as a whole is adjusted using the same offset, the bottom of the target model will be offset, similar to the root of the grass model being moved.
[0082] In order to further optimize the adjustment process, it is also possible to obtain the preset weight coefficients corresponding to each vertex, where the weight coefficient is a value between 0 and 1, and the weight coefficient corresponding to the bottom vertex in the target model gradually increases to the weight coefficient corresponding to the top vertex; the offset is multiplied by the weight coefficient corresponding to each vertex to obtain the adjusted offset corresponding to each vertex.
[0083] It is understandable that the bottom of the target model is the part close to the ground, and the top of the target model is the part farthest from the ground. In the target model, vertices are distributed from bottom to top, so there is a high-low position relationship between the vertices in the target model. Based on this, the weight coefficients corresponding to each vertex included in the target model can be set. The smaller the weight coefficient corresponding to the vertex closer to the bottom of the target model, the larger the weight coefficient corresponding to the vertex closer to the top of the target model. All weight coefficients can be set to gradually change between 0 and 1, and the weight coefficient corresponding to the vertex at the highest position in the target model is 1, and the weight coefficient corresponding to the vertex at the lowest position in the target model is 0.
[0084] After determining the weight coefficient corresponding to each vertex, the weight coefficient corresponding to each vertex can be multiplied by the offset to obtain the adjusted offset corresponding to each vertex. It should be noted that, since the weight coefficient corresponding to the vertex closer to the bottom of the target model is smaller, and the weight coefficient corresponding to the vertex closer to the top of the target model is larger, when the weight coefficient corresponding to the vertex at the bottom of the target model is multiplied by the offset, it is equivalent to multiplying the offset by a value close to 0, and the result is close to 0, which is the adjusted offset. When the vertex at the bottom of the target model is offset using the adjusted offset, the vertex at the bottom of the target model moves a small distance or even does not move. It can be seen that the offset is adjusted by the method provided in the embodiment of the present invention, so that the adjusted offset used by the vertex at the bottom of the target model is smaller, which has the effect of almost not moving the bottom of the target model.
[0085] In some optional embodiments, the weight coefficient of each vertex can be stored in the b channel of the vertex color corresponding to each vertex. In this way, after calculating the offset of the entire target model, the overall offset can be multiplied by the b channel of the vertex color corresponding to each vertex.
[0086] In an example, the code for the above process of calculating the offset corresponding to each vertex can be expressed as:
[0087] floatoffsetScala=saturate([float3(0,0,1)ViewToAbsoluteWorld].z*-1)*vertexColor.z
[0088] After determining the adjustment direction of the target model and the offset corresponding to each vertex, for any vertex P included in the target model, adjust the offset corresponding to any vertex P along the adjustment direction. In an example, the code of the adjustment process can be expressed as:
[0089] offfsetVector*=offsetScala
[0090] The meaning of the above code is to multiply the adjustment direction by the offset, then apply the result to the corresponding vertex, and finally display the adjusted target model.
[0091] The method provided by the embodiment of the present invention not only has good processing effects on general ground vegetation models, but also has good processing effects on single ground vegetation models with large areas and multiple ground vegetation models processed in batches, and is compatible with single ground vegetation models with large areas and multiple ground vegetation models processed in batches. At the same time, the method provided by the embodiment of the present invention has low computational complexity and fast computational speed in the process of processing the above-mentioned ground vegetation models.
[0092] Among them, it needs to be explained that the above-mentioned batch processing refers to merging multiple models that need to be rendered into one batch. The central processing unit uses a drawCall instruction to send the multiple models after batch processing to the image processor at one time, and the image processor renders them uniformly without calling the drawCall instruction once for each model.
[0093] In addition to the above-mentioned improvement in the compatibility of model adjustment by using the embodiments of the present invention, a more natural adjustment effect can be obtained by using the embodiments of the present invention. Specifically, the adjusted lodging effect is more natural. Figure 2 and Figure 3 As shown in the figure, the display effect of the grass model before adjustment and the display effect of the grass model after adjustment using the embodiment of the present invention are shown in sequence when the camera's perspective is a top view. By comparing the two figures, it can be seen that the cross-shaped structure of the grass model can be clearly observed before adjustment, while the grass model observed after adjustment is closer to nature and more realistic.
[0094] By adopting the present invention, when it is detected that the camera's viewing angle is a top-down view, the target model with a cross-shaped sheet structure within the current game field of view can be determined. In addition, the adjustment direction and offset for adjusting the target model can be determined, and then the target model is adjusted along the adjustment direction by the offset, and finally the adjusted result is displayed to the player user. In this way, when the player user observes the target model using a top-down view, the player user can avoid observing the cross-shaped sheet structure of the target model, making the picture effect presented to the player user more natural and more realistic, thereby improving the realism of the game experience.
[0095] The model adjustment device of one or more embodiments of the present invention will be described in detail below. Those skilled in the art will appreciate that these model adjustment devices can be configured using commercially available hardware components through the steps taught in this solution.
[0096] Figure 4 A schematic diagram of a model adjustment device provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, the device comprises:
[0097] A determination module 41 is used to determine a target model with a cross-shaped structure in the current game field of view when a preset camera overlooking condition is detected;
[0098] The acquisition module 42 is used to acquire the x-axis coordinate and the y-axis coordinate of the camera in the world space; and acquire the z-axis coordinate of the protagonist character in the world space;
[0099] The determination module 41 is used to determine the direction from the origin in the world space to the target point as the adjustment direction of the target model, wherein the position coordinates of the target point are the x-axis coordinate, the y-axis coordinate and the z-axis coordinate; and determine the offset of the target model based on the z-axis component of the camera in the camera space;
[0100] An adjustment module 43, configured to adjust the offset of the target model along the adjustment direction;
[0101] The display module 44 is used to display the adjusted target model.
[0102] Optionally, the determining module 41 is used to:
[0103] Obtain the z-axis component of the camera in the camera space;
[0104] The z-axis component is multiplied by -1 to obtain the offset of the target model.
[0105] Optionally, the target model includes a plurality of vertices, and the adjustment module 43 is further used for:
[0106] Obtaining preset weight coefficients corresponding to each vertex, wherein the weight coefficient is a value between 0 and 1, and the weight coefficient corresponding to the bottom vertex in the target model gradually increases to the weight coefficient corresponding to the top vertex;
[0107] The offsets are multiplied by the weight coefficients corresponding to the vertices to obtain adjusted offsets corresponding to the vertices.
[0108] Optionally, the weight coefficient of each vertex is stored in the b channel of the vertex color corresponding to each vertex.
[0109] Optionally, the adjustment module 43 is used to:
[0110] For any vertex included in the target model, the offset corresponding to the vertex is adjusted along the adjustment direction.
[0111] Optionally, the determining module 41 is used to:
[0112] If it is detected that the z-axis component of the camera in the camera space is less than 0, a target model having a cross-shaped structure in the current game field of view is determined.
[0113] Optionally, the target model is a ground vegetation model.
[0114] Figure 4 The device shown can perform the aforementioned Figures 1 to 3 The model adjustment method provided in the illustrated embodiment, the detailed execution process and technical effects can be found in the description of the aforementioned embodiment, which will not be repeated here.
[0115] In one possible design, the above Figure 4 The structure of the model adjustment device shown can be implemented as an electronic device, such as Figure 5 As shown, the electronic device may include: a processor 51 and a memory 52. The memory 52 stores executable code, and when the executable code is executed by the processor 51, the processor 51 can at least implement the above-mentioned Figures 1 to 3 The model adjustment method provided in the illustrated embodiment.
[0116] Optionally, the electronic device may further include a communication interface 53 for communicating with other devices.
[0117] In addition, an embodiment of the present invention provides a non-transitory machine-readable storage medium, wherein an executable code is stored on the non-transitory machine-readable storage medium. When the executable code is executed by a processor of an electronic device, the processor can at least implement the above-mentioned Figures 1 to 3 The model adjustment method provided in the illustrated embodiment.
[0118] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Those of ordinary skill in the art may understand and implement the present invention without creative effort.
[0119] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a computer product, and the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0120] The model adjustment method provided in the embodiment of the present invention can be executed by a certain program / software, and the program / software can be provided by the network side. The electronic device mentioned in the above embodiment can download the program / software to a local non-volatile storage medium, and when it needs to execute the above model adjustment method, the program / software is read into the memory by the CPU, and then the CPU executes the program / software to implement the model adjustment method provided in the above embodiment. The execution process can refer to the above Figures 1 to 3 Instructions in .
[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A model adjustment method, characterized in that: include: When the preset camera overlooking condition is detected, a target model with a cross-shaped structure in the current game field of view is determined; Get the x-axis coordinate and y-axis coordinate of the camera in the world space; Get the z-axis coordinate of the main character in the world space; Determine the direction from the origin in the world space to the target point as the adjustment direction of the target model, wherein the position coordinates of the target point are the x-axis coordinate, the y-axis coordinate, and the z-axis coordinate; Determining an offset of the target model based on a z-axis component of the camera in camera space; Adjust the offset of the target model along the adjustment direction; Display the adjusted target model.
2. The method according to claim 1, characterized in that The determining the offset of the target model based on the z-axis component of the camera in the camera space includes: Obtain the z-axis component of the camera in the camera space; The z-axis component is multiplied by -1 to obtain the offset of the target model.
3. The method according to claim 2, characterized in that The target model includes a plurality of vertices, and the method further includes: Obtaining preset weight coefficients corresponding to each vertex, wherein the weight coefficient is a value between 0 and 1, and the weight coefficient corresponding to the bottom vertex in the target model gradually increases to the weight coefficient corresponding to the top vertex; The offsets are multiplied by the weight coefficients corresponding to the vertices to obtain adjusted offsets corresponding to the vertices.
4. The method according to claim 3, characterized in that The weight coefficient of each vertex is stored in the b channel of the vertex color corresponding to each vertex.
5. The method according to claim 3, characterized in that: The step of adjusting the offset of the target model along the adjustment direction includes: For any vertex included in the target model, the offset corresponding to the vertex is adjusted along the adjustment direction.
6. The method according to claim 1, characterized in that The step of determining a target model having a cross-shaped structure in the current game field of view upon detecting that a preset camera overlooking condition is met includes: If it is detected that the z-axis component of the camera in the camera space is less than 0, a target model having a cross-shaped structure in the current game field of view is determined.
7. The method according to any one of claims 1 to 6, characterized in that The target model is a ground vegetation model.
8. A model adjustment device, characterized in that: include: A determination module, used to determine a target model with a cross-shaped structure in the current game field of view when a preset camera overlooking condition is detected; The acquisition module is used to obtain the x-axis coordinate and y-axis coordinate of the camera in the world space; Get the z-axis coordinate of the main character in the world space; The determination module is used to determine the direction from the origin in the world space to the target point as the adjustment direction of the target model, wherein the position coordinates of the target point are the x-axis coordinate, the y-axis coordinate and the z-axis coordinate; and determine the offset of the target model based on the z-axis component of the camera in the camera space; An adjustment module, used for adjusting the offset of the target model along the adjustment direction; The display module is used to display the adjusted target model.
9. An electronic device, characterized in that: include: A memory and a processor; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the model adjustment method as described in any one of claims 1 to 7.
10. A non-transitory machine-readable storage medium, characterized in that: The non-transitory machine-readable storage medium stores executable code, and when the executable code is executed by a processor of an electronic device, the processor is caused to execute the model adjustment method according to any one of claims 1 to 7.