Method, device, storage medium, equipment and program product for scaling three-dimensional model

By scaling the model with its centroid as the origin in the model coordinate system and adjusting the centroid position in the world coordinate system, the inefficiency of scaling distorted 3D characters in game production is solved. This enables synchronous adjustment of the 3D model with other elements in the scene, improving processing efficiency.

CN122115808APending Publication Date: 2026-05-29NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2025-10-29
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In game development, current technology requires manually adjusting the height of 3D characters in the scene to avoid scaling distortion, resulting in low efficiency.

Method used

By scaling the model in the model coordinate system with the centroid as the origin and adjusting the position coordinates of the centroid in the world coordinate system, the centroid height of the scaled 3D model is ensured to be consistent. The overall size and relative position of the model are simultaneously adjusted in the world coordinate system using a preset scaling ratio.

Benefits of technology

This method achieves a reasonable relative position of the 3D model with other elements in the scene after scaling, avoiding clipping or hanging problems caused by unsynchronized heights in traditional methods, reducing the workload of manual adjustments, and improving processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122115808A_ABST
    Figure CN122115808A_ABST
Patent Text Reader

Abstract

The application discloses a scaling method and device of a three-dimensional model, a storage medium, equipment and a program product, and comprises the following steps: scaling a three-dimensional model in a model coordinate system at a preset scaling ratio, wherein the origin of the model coordinate system is located at the centroid of the three-dimensional model; determining a first position coordinate of the centroid in a world coordinate system, wherein the first position coordinate comprises a first coordinate, and the first coordinate is used to represent the height of the centroid in the world coordinate system; scaling the first coordinate based on the preset scaling ratio to obtain a second coordinate; and adjusting a third coordinate of a second position coordinate of the scaled three-dimensional model in the world coordinate system based on the difference between the second coordinate and the first coordinate to obtain a target three-dimensional model, wherein the third coordinate is used to represent the height of the scaled three-dimensional model in the world coordinate system. The effect that the height of the centroid of the scaled three-dimensional model in the world coordinate system is consistent with that before scaling can be achieved, and the scaling processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of game technology, specifically to a method, apparatus, storage medium, device, and program product for scaling three-dimensional models. Background Technology

[0002] In the game development process, it is often necessary to scale existing 3D character assets as a whole to adapt to projects with different resolutions or specifications. To avoid scaling distortion, traditional methods require manually adjusting the height of each 3D character in the scene, which is inefficient. Summary of the Invention

[0003] This application provides a method, apparatus, storage medium, device, and program product for scaling a three-dimensional model. By adjusting the second position coordinate of the scaled three-dimensional model in the world coordinate system based on the difference between the first coordinate of the centroid in the world coordinate system and the scaled second coordinate, the height of the centroid of the scaled three-dimensional model in the world coordinate system is made consistent with that before scaling, thereby improving processing efficiency.

[0004] On one hand, embodiments of this application provide a method for scaling a three-dimensional model, the method comprising: The three-dimensional model is scaled in the model coordinate system with a preset scaling ratio, wherein the origin of the model coordinate system is located at the centroid of the three-dimensional model. Determine the first position coordinates of the centroid in the world coordinate system. The first position coordinates include a first coordinate, which is used to characterize the height of the centroid in the world coordinate system. Based on the preset scaling ratio, the first coordinate is scaled to obtain the second coordinate; Based on the difference between the second coordinate and the first coordinate, the third coordinate of the scaled 3D model in the world coordinate system is adjusted to obtain the target 3D model. The third coordinate is used to characterize the height of the scaled 3D model in the world coordinate system.

[0005] On the other hand, embodiments of this application provide a scaling device for a three-dimensional model, the device comprising: The first scaling module is used to scale the three-dimensional model in the model coordinate system by a preset scaling ratio, wherein the origin of the model coordinate system is located at the centroid of the three-dimensional model. A determination module is used to determine the first position coordinates of the centroid in the world coordinate system, the first position coordinates including a first coordinate, the first coordinate being used to characterize the height of the centroid in the world coordinate system; The second scaling module is used to scale the first coordinate based on the preset scaling ratio to obtain the second coordinate; An adjustment module is used to adjust the third coordinate of the second position coordinate of the scaled 3D model in the world coordinate system based on the difference between the second coordinate and the first coordinate, so as to obtain the target 3D model. The third coordinate is used to characterize the height of the scaled 3D model in the world coordinate system.

[0006] On the other hand, embodiments of this application provide a computer-readable storage medium storing a computer program adapted for loading by a processor to execute the scaling method for a three-dimensional model as described in any of the above embodiments.

[0007] On the other hand, embodiments of this application provide a computer device, the computer device including a processor and a memory, the memory storing a computer program, the processor executing the scaling method of the three-dimensional model as described in any of the above embodiments by calling the computer program stored in the memory.

[0008] On the other hand, embodiments of this application provide a computer program product, including computer instructions, which, when executed by a processor, implement the scaling method for a three-dimensional model as described in any of the above embodiments.

[0009] The scaling method for 3D models provided in this application embodiment scales the 3D model in the model coordinate system by a preset scaling ratio. The origin of the model coordinate system is located at the centroid of the 3D model, ensuring that the structural proportions of each part of the 3D model remain consistent and avoiding problems such as skeletal object offset. The method determines the first position coordinates of the centroid in the world coordinate system. The first position coordinates include a first coordinate, which represents the height of the centroid in the world coordinate system. This maps the position information of the centroid from the local coordinate system of the model to the global frame, preventing the loss of the centroid's position relative to the global scene due to subsequent model scaling operations and ensuring that the original global position of the centroid can be accurately recovered after scaling. Then, based on the preset scaling ratio, the first coordinate is scaled to obtain a second coordinate, ensuring that the height of the centroid in the world coordinate system is scaled at the same preset scaling ratio as the overall size of the 3D model, ensuring that the scaled 3D model... The model's relative position to other elements in the scene (such as the ground and props) in the height direction is reasonable, avoiding clipping (such as the model's feet penetrating the ground) or hanging problems caused by "the model being scaled as a whole but its height not synchronized" in the traditional process, and reducing the workload of manually adjusting the height. Finally, based on the difference between the second coordinate and the first coordinate, the third coordinate of the scaled 3D model in the world coordinate system is adjusted to obtain the target 3D model. The target 3D model and the world coordinate system are matched, and the third coordinate is used to represent the height of the scaled 3D model in the world coordinate system. The target animation layer is a newly created animation layer, which not only ensures that the height of the scaled 3D model in the world coordinate system is completely synchronized with the overall scaling ratio of the 3D model, but also avoids animation logic errors caused by height offset (such as the character's feet not touching the ground when walking, or abnormal jumping height), eliminating the need for subsequent manual adjustments. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a schematic diagram of an example game system provided in an embodiment of this application.

[0012] Figure 2 This is a flowchart illustrating the scaling method for a three-dimensional model provided in an embodiment of this application.

[0013] Figure 3 This is a schematic diagram of a first application scenario of the scaling method for a three-dimensional model provided in the embodiments of this application.

[0014] Figure 4This is a schematic diagram of a second application scenario for the scaling method of a three-dimensional model provided in the embodiments of this application.

[0015] Figure 5 This is a schematic diagram of the scaling device for a three-dimensional model provided in an embodiment of this application.

[0016] Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0017] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0018] First, some of the nouns or terms that appear in the description of the embodiments of this application are explained as follows: 3ds Max: A three-dimensional (3D) modeling, animation, and rendering software widely used in games, film and television, architectural design, and other fields. Users can create 3D models using 3ds Max, such as polygon modeling and surface modeling.

[0019] Before detailing the implementation methods of this application, related technologies will be further introduced.

[0020] In the game development process, it is often necessary to scale existing 3D character assets to fit projects with different resolutions or specifications. Traditional methods involve reskinning, re-importing animations, and re-matching effects, which is time-consuming and prone to errors.

[0021] For example, in one skeletal object scaling scheme, after scaling the game character's skeletal objects according to the scaling factor, the original skin vertices and the skin weights of the skeletal objects (i.e., the association strength parameters between skin vertices and skeletal objects) become completely invalid. For instance, before scaling, the thigh skeletal object was associated with 500 skin vertices in the thigh area. After scaling, due to the positional shift of the skeletal objects, these vertices might be incorrectly assigned to the calf skeletal objects, causing stretching and clipping issues with the character's skin. In this case, the user needs to manually select each skeletal object, redetermine the corresponding skin vertices, and manually correct the skin weights. This process involves large amounts of data, is time-consuming, and has low efficiency.

[0022] This application provides a method, apparatus, storage medium, device, and program product for scaling three-dimensional models. Specifically, the scaling method for three-dimensional models in this application can be executed by a computer device, which can be a terminal or a server. The terminal can be a smartphone, tablet, laptop, smart TV, wearable smart device, smart vehicle terminal, etc. The terminal can also include a client, which can be a game client, browser client, instant messaging client, or mini-program, etc. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0023] For example, when the scaling method for the 3D model is implemented on a terminal device, the terminal device may include a display screen and a processor. The display screen is used to display the 3D model and receive user commands generated by the processing screen. The processor is used to control the display and scaling of the 3D model, respond to commands, and control the generation of animation layers. The display screen may also display a graphical user interface for the scaling of the 3D model, and the processor responds to input from this interface. For example, the user can input or modify a preset scaling ratio through this interface. The terminal device can provide the graphical user interface to the player in various ways, such as rendering it on the terminal device's display screen or presenting the graphical user interface through holographic projection.

[0024] For example, when the scaling method for the 3D model runs on a server, it can be implemented and executed based on a cloud scaling system. A cloud scaling system refers to a processing method based on cloud computing. A cloud scaling system includes a server and client devices. The scaling and other processing of the 3D model are separate from the display of the 3D model. The storage and execution of the scaling method are completed on the server. The displayed image is displayed on the client, which is mainly used to receive and confirm preset scaling ratios and to display the 3D model. For example, the client can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, PDA, personal digital assistant, or head-mounted display device. However, the terminal device performing the scaling processing of the 3D model is the server in the cloud. During scaling, the user operates the client to send commands to the server. The server controls the scaling of the 3D model according to the commands, encodes and compresses the scaled image data, returns it to the client via the network, and finally, the client decodes and outputs the final image.

[0025] It should be noted that, in this embodiment, the entity executing the scaling method for the 3D model can be a terminal device or a server. The terminal device can be a local terminal device or a client device in the aforementioned cloud gaming. This embodiment does not limit the type of the entity executing the method.

[0026] For example, in conjunction with the above description, Figure 1 This application illustrates a scaling system 1000 for implementing a scaling method for 3D models. The scaling system 1000 may include at least one terminal 1001, at least one server 1002, at least one database 1003, and a network. The user-held terminal 1001 can connect to different servers via the network. The terminal can be any device with computing hardware capable of supporting and executing software applications corresponding to games. For ease of explanation, the scaling method for 3D models provided in this application is illustrated using scaling processing software (3ds Max as an example in this application). Implementation methods relying on other software are similar to those in this application, and this application does not impose limitations on them.

[0027] In the aforementioned scaling system 1000, terminal 1001 is used to install and run 3ds Max. In some cases, 3ds Max may not need to be installed in advance on terminal 1001, and users can directly access the 3ds Max interface through a browser or other client.

[0028] In possible application scenarios, different terminals 1001 may be served by different servers 1002. Therefore, in order to distinguish the servers 1002 corresponding to different terminals 1001, the embodiments of this application will use the terms "first" and "second" to describe them. In fact, the servers 1002 corresponding to different terminals 1001 can be the same server 1002. Therefore, without distinguishing between "first" and "second", it can be understood that the terminals 1001 corresponding to the 3D models located in the same scaling processing scene are served by the same server 1002.

[0029] Furthermore, when system 1000 includes multiple terminals, multiple servers, and multiple networks, different terminals can connect to each other through different networks and servers. The network can be a wireless network or a wired network; for example, wireless networks include wireless local area networks (WLAN), local area networks (LAN), cellular networks, 2G networks, 3G networks, 4G networks, 5G networks, etc. Additionally, different terminals can also connect to other terminals or servers using their own Bluetooth networks or hotspot networks. Furthermore, system 100 can include multiple databases coupled to different servers, and can continuously store information related to the 3D model in the databases while different users are processing it online in a multi-user environment.

[0030] It should be noted that in this embodiment, the same scaling processing software runs on multiple terminal devices. Therefore, data interaction between the multiple terminal devices can be achieved through a server. Thus, sending data from terminal device 1 to terminal device 2 can be understood as: terminal device 1 sends data to the server, and the server sends the data to terminal device 2. Receiving data from terminal device 2 can be understood as: terminal device 1 receives data sent by the server, which is the same data sent by terminal device 2 to the server. Alternatively, a server may not exist, and terminal device 1 can directly send the 3D model and scaling processing related data to terminal device 2.

[0031] It should be noted that, Figure 1 The system diagram shown is merely an example. The system 1000 described in this application embodiment is intended to more clearly illustrate the technical solutions of this application embodiment and does not constitute a limitation on the technical solutions provided in this application embodiment. As those skilled in the art will know, with the evolution of scaling processing systems and the emergence of new business scenarios, the technical solutions provided in this application embodiment are also applicable to similar technical problems.

[0032] It should be noted that the triggering operations mentioned in the subsequent detailed description of the scaling method for the 3D model provided in the embodiments of this application can all be regarded as triggering operations performed by the player through a finger or by controlling a medium such as a mouse, keyboard, or stylus. The specific medium used can be determined according to the type of computer device. For example, when the computer device is a touchscreen device such as a mobile phone, tablet, or game console, the player can operate on the touchscreen using any suitable object or accessory such as a finger or stylus. When the terminal device is a non-touchscreen terminal device such as a desktop computer or laptop, the player can operate using external devices such as a mouse or keyboard.

[0033] The technical solution of this application will be described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0034] In this embodiment of the application, a graphical user interface is provided through a terminal device, and the graphical user interface includes at least a partial three-dimensional model.

[0035] The 3D model can be an element that constitutes the game scene, and may include, but is not limited to, at least one of the following: a 3D model of a virtual character (game character model) corresponding to a virtual character element, a 3D model of a virtual item corresponding to a virtual item element, a 3D model of a virtual building corresponding to a virtual building element, a 3D model of a virtual terrain element corresponding to a virtual terrain element, a 3D model of a virtual vegetation element corresponding to a virtual vegetation element, etc. The virtual terrain element may include, but is not limited to, natural landform elements such as land, ocean, lakes, and rivers. The virtual scene is the scene in which the player controls the virtual character to complete the game logic.

[0036] As can be understood, a virtual character is a game character controlled by the player in a game. The player manipulates this virtual character to perform various game activities within the game environment, such as picking up items, engaging in combat, exploring, or solving puzzles. This virtual character can represent the player's image, and each virtual character can be implemented using a 3D or 2D virtual model; this embodiment does not specifically limit this. Virtual characters include, but are not limited to, at least one of the following: virtual human, virtual animal, and virtual machine.

[0037] Please see Figure 2 , Figure 2 The flowchart illustrating the scaling method for a 3D model provided in this application embodiment may show steps executed in a different logical order than those shown in the flowchart. The method may include the following steps: Step 011: Scale the 3D model in the model coordinate system with a preset scaling ratio. The origin of the model coordinate system is located at the centroid of the 3D model.

[0038] The preset scaling ratio includes a magnification parameter that is set by the user or the system before scaling the 3D model, and the overall size of the 3D model is adjusted based on this magnification parameter.

[0039] The model coordinate system can be a coordinate system established with the reference point (centroid) of the 3D model itself as the origin. The coordinate axes of the model coordinate system are related to the structure of the model itself and can be used to describe the relative positions of elements such as vertices and skeletal objects within the 3D model. Each 3D model has its own corresponding model coordinate system.

[0040] The three-dimensional model may include a skeletal chain, which includes at least one skeletal object. The centroid of the three-dimensional model may be the center of mass of the skeletal object in the skeletal chain, and may serve as the central reference point for the mass distribution of the three-dimensional model.

[0041] Specifically, a model coordinate system can be constructed with the centroid of the 3D model as the origin. Within this coordinate system, using the origin as a reference point, the overall size of the 3D model is adjusted according to a preset scaling ratio. This scaling operation revolves around the centroid of the 3D model, and the skeletal chains and bone objects included in the 3D model are scaled proportionally. For example, the length of bone objects and the spacing between them are linearly adjusted according to the preset scaling ratio, ensuring that the structural proportions of all parts of the 3D model remain consistent and avoiding problems such as bone object offset.

[0042] Step 012: Determine the first position coordinates of the centroid in the world coordinate system. The first position coordinates include the first coordinate, which is used to characterize the height of the centroid in the world coordinate system.

[0043] The world coordinate system can be a global coordinate system in a 3D scene that includes all 3D models. The world coordinate system can be used to describe the absolute position of all elements in the scene (e.g., including 3D models, cameras, etc.) and can serve as a unified position reference for all elements in the scene.

[0044] The first position coordinate can be the recorded position data of the centroid in the world coordinate system, which can include the coordinate information of the centroid's position in the three directions of the world coordinate system: the X-axis, Y-axis, and Z-axis. The coordinate value of the first coordinate can include position data representing the centroid's position along the height direction (Z-axis of the world coordinate system) in the world coordinate system.

[0045] Specifically, the world coordinate system serves as a unified position reference for all elements within the scene. By recording the first position coordinates of the centroid in this coordinate system, the position information of the centroid can be mapped from the local coordinate system of the model to the global frame. This avoids the loss of the centroid's position relative to the global scene due to subsequent model scaling operations, ensuring that the original global position of the centroid can be accurately retrieved after scaling. In other words, the first position coordinates are the global position anchor point of the centroid.

[0046] Step 013: Scale the first coordinate based on the preset scaling ratio to obtain the second coordinate.

[0047] The second coordinate can be a new coordinate obtained by linearly calculating the first coordinate using a preset scaling ratio. The coordinate value of the second coordinate corresponds to the position data in the height direction of the world coordinate system after scaling the centroid. The coordinate value of the second coordinate is equal to the coordinate value of the first coordinate. Preset scaling ratio.

[0048] Specifically, for example, please see Figure 3 Taking a game character model in a game scene corresponding to a 3D model as an example, assuming the game character model is standing on the "ground" of the game scene, and the preset scaling ratio is 0.5, after scaling the game character model with the centroid as the reference, as shown... Figure 3 As shown in (c) and (d), Figure 3 (c) is the original 3D model without scaling. Figure 3 (c) The game character model shown has been scaled down, as follows: Figure 3 As shown in (d), because the overall height of the game character model is shortened, the game character model may appear to be detached from the ground, with a distance H from the ground. Therefore, as Figure 3 As shown in (a) and (b), Figure 3 (a) is the original 3D model without scaling. The height of the game character model can be adjusted by scaling the first coordinate representing the height in the first position coordinate of the centroid in the world coordinate system according to a preset scaling ratio, so that the game character model appears as... Figure 3 (b) shows the model standing on the ground of the game scene again. By processing the first coordinate with a preset scaling ratio to obtain the second coordinate, the height of the centroid in the world coordinate system is scaled with the overall size of the 3D model by the same preset scaling ratio. This ensures that the relative position of the 3D model in the height direction with other elements in the scene (such as the ground and props) is reasonable after scaling, avoiding clipping (such as the model's feet penetrating the ground) or suspension problems caused by "the model is scaled as a whole but the height is not synchronized" in the traditional process, and reducing the workload of manually adjusting the height.

[0049] Step 014: Based on the difference between the second coordinate and the first coordinate, adjust the third coordinate of the second position coordinate of the scaled 3D model in the world coordinate system to obtain the target 3D model. The third coordinate is used to characterize the height of the scaled 3D model in the world coordinate system.

[0050] Optionally, step 014: Based on the difference between the second coordinate and the first coordinate, adjust the third coordinate of the second position coordinate of the scaled 3D model in the world coordinate system to obtain the target 3D model. The third coordinate is used to characterize the height of the scaled 3D model in the world coordinate system, including: Step 0141: On the target animation layer, based on the difference between the second coordinate and the first coordinate, adjust the third coordinate of the second position coordinate of the scaled 3D model in the world coordinate system to obtain the target 3D model. The target animation layer is the newly created animation layer.

[0051] The target animation layer can be a newly created animation layer that is independent of the original animation layer. This can be achieved by creating a new animation layer that is independent of the original animation layer. Let's assume it is named BipPositionLayer. BipPositionLayer is independent of the original animation layer and only carries the relevant adjustment data for adjusting the second position coordinates of the 3D model in the world coordinate system.

[0052] The second position coordinate can be the positioning reference point of the scaled 3D model in the world coordinate system, used to define the position of the 3D model in the world coordinate system.

[0053] The coordinates of the third coordinate can be used to characterize the position data of the 3D model along the height direction in the world coordinate system after scaling.

[0054] Specifically, the second coordinate is the reasonable coordinate of the relative position of the scaled 3D model with other elements in the scene (such as the ground and props) in the height direction of the world coordinate system. The first coordinate is the coordinate of the scaled 3D model in the height direction of the world coordinate system. The difference between the first and second coordinates reflects the centroid height offset caused by scaling. Based on the centroid height offset, the third coordinate of the second position coordinate of the 3D model in the world coordinate system is adjusted to a height that logically matches the original scene height, thereby ensuring that the height of the 3D model is synchronized with the scaling ratio and avoiding issues such as the model being shrunk overall but its height remaining unchanged, which could lead to floating or clipping.

[0055] In other words, based on the difference between the first and second coordinates, the third coordinate of the second position coordinate is adjusted and calibrated to ensure that the height of the scaled 3D model in the world coordinate system is completely synchronized with the overall scaling ratio of the 3D model, avoiding animation logic errors caused by height offset (such as the character's feet not touching the ground when walking, abnormal jumping height), eliminating the need for subsequent manual adjustments, and ensuring that the animation distortion is significantly reduced after scaling.

[0056] Since the adjustment of the third coordinate is performed in a newly created target animation layer that is independent of the original animation layer, that is, the relevant data for adjusting the height of the 3D model in the world coordinate system is encapsulated in the newly created target animation layer. There is no need to modify the data of the 3D model in the original animation layer. This avoids the interference of the height adjustment on the animation (such as limb movements and joint rotation) after the animation is generated based on the 3D model. At the same time, it is convenient to edit or roll back the height compensation operation separately later (for example, if a deviation in the height of the 3D model is found, only the target animation layer needs to be modified, without reprocessing the entire animation).

[0057] Furthermore, it should be noted that when batch processing multiple 3D models, only the first and second coordinates of each 3D model need to be retrieved to calculate and write the corresponding third coordinates of each 3D model without manual intervention. In actual operation, the scaling process of a single character model can be compressed from 0.5 hours to 0.2 minutes, improving the overall batch processing efficiency.

[0058] Thus, by scaling the 3D model in the model coordinate system with a preset scaling ratio, the origin of the model coordinate system is located at the centroid of the 3D model, ensuring that the structural proportions of all parts of the 3D model remain consistent and avoiding issues such as skeletal object offset. The first position coordinates of the centroid in the world coordinate system are determined. These first position coordinates represent the height of the centroid in the world coordinate system, mapping the centroid's position information from the model's local coordinate system to the global frame. This prevents the centroid's position relative to the global scene from being lost due to subsequent model scaling operations, ensuring that the original global position of the centroid can be accurately recovered after scaling. Then, based on the preset scaling ratio, the first coordinate is scaled to obtain the second coordinate, ensuring that the height of the centroid in the world coordinate system is scaled at the same preset scaling ratio as the overall size of the 3D model, ensuring that the 3D model remains consistent in the height direction after scaling. The relative positions of the model with other elements in the scene (such as the ground and props) are reasonable, avoiding clipping (such as the model's feet penetrating the ground) or hanging problems caused by the overall scaling of the model but the height not being synchronized in the traditional process, and reducing the workload of manually adjusting the height. Finally, based on the difference between the second coordinate and the first coordinate, the third coordinate of the second position coordinate of the scaled 3D model in the world coordinate system is adjusted to obtain the target 3D model. The target 3D model and the world coordinate system are matched. The third coordinate is used to represent the height of the scaled 3D model in the world coordinate system. The target animation layer is a newly created animation layer, which can not only ensure that the height of the scaled 3D model in the world coordinate system is completely synchronized with the overall scaling ratio of the 3D model, but also avoid animation logic errors caused by height offset (such as the character's feet not touching the ground when walking, abnormal jumping height), but also eliminates the need for subsequent manual adjustments.

[0059] Furthermore, since the adjustment of the third coordinate is performed in a newly created target animation layer, independent of the original animation layer, it is not necessary to modify the data of the 3D model in the original animation layer. This avoids interference from height adjustments (such as limb movements and joint rotations) in the animation after rendering the animation based on the 3D model. It also facilitates subsequent individual editing or rollback of height compensation operations (for example, if a deviation in the height direction of the 3D model is found, only the target animation layer needs to be modified, without reprocessing the entire animation). Adjusting the third coordinate by the difference between the first and second coordinates can also improve the overall batch processing efficiency.

[0060] In some implementations, please refer to Figure 4 The methods also include: Step 015: In response to the user's first input operation on the editing interface, determine the 3D model and the preset scaling ratio.

[0061] The editing interface includes scaling controls and add controls. Step 015: In response to user input on the editing interface, determine the 3D model and preset scaling ratio, including: Step 0151: In response to the second input operation received by the zoom control, determine the preset zoom ratio; Step 0152: In response to the trigger operation received by the added control, obtain the 3D model.

[0062] The editing interface can be a visual operation interface provided by the system for users, through which users can input preset scaling ratios, select 3D models, etc.

[0063] The first input operation, the second input operation, and the trigger operation can be operations performed by the user on the editing interface, such as dragging, clicking, double-clicking, etc.

[0064] The scaling control can be a functional component in the editing interface used to receive user input of a preset scaling ratio. For example, it can include a numeric input box, a slider, a preset ratio button, etc.

[0065] The added controls can be functional components in the editing interface used to receive user model selection instructions. For example, they can include an add model button, a model file drag and drop component, etc.

[0066] Specifically, the system can display a visual editing interface to the user, where the user can perform the initial input operation. In response to the user's operation, the 3D model and preset scaling ratio are determined. The editing interface includes scaling controls and add controls. The user can input the preset scaling ratio using the scaling controls and add model files using the add controls. In response to the user's operation, the preset scaling ratio can be determined, or the model file can be read to define the 3D model.

[0067] Optionally, the editing interface also includes scaling the current control, batch scaling the control, and removing the control. Users can trigger scaling the current control by clicking, double-clicking, or dragging to read the currently selected target model file and scale the 3D model included in the target model file. Users can also trigger batch scaling the control by clicking, double-clicking, or dragging to batch process at least one model file in the editing interface. Users can also trigger removing the control by clicking, double-clicking, or dragging to remove model files.

[0068] Optionally, the editing interface also includes a progress display control, such as a progress bar. When scaling multiple model files, including 3D models, in response to a trigger operation received by the batch scaling control, the progress display control can show the user the processing progress in real time.

[0069] Optionally, the add control may also include an add folder control and an add file control. Users can import a folder containing at least one model file by triggering the add folder control, or import any model file by triggering the add file control.

[0070] For example, taking the scaling method of the 3D model implemented in this application embodiment based on 3ds Max as an example, suppose the user drags a folder containing multiple ".max" format files into the add control and enters a value of 0.5 in the scaling control. In response to the user's input, the preset scaling ratio is determined to be 0.5. By reading each file in the folder and reading the object type parameters of each element in the file (for example, the reading code is: bone_objs = [obj for obj inrt.objects if str(rt.classOf(obj)) == "BoneGeometry"]), the 3D model and the various bone objects included in the 3D model are filtered out. Furthermore, after the 3D model has completed the scaling process provided in this application embodiment, the scaled file can be saved to the rescaled subdirectory and a log file can be generated. In addition, if an error occurs during the scaling process, the undo and redo function (pymxs.undo) will be triggered to maintain the original scene and cancel the scaling operation.

[0071] Optionally, step 011: Scaling the 3D model in the model coordinate system by a preset scaling ratio, including: Step 0111: In the model coordinate system, scale the fourth, fifth, and sixth coordinates of the 3D model according to the preset scaling ratio to obtain the scaled 3D model.

[0072] Optionally, the coordinates of the 3D model in the model coordinate system include a fourth coordinate, a fifth coordinate, and a sixth coordinate. The fourth coordinate is used to characterize the height of the 3D model in the model coordinate system. The model coordinate system has its origin O at the centroid and includes the x-axis, y-axis, and z-axis. The fourth coordinate is the specific coordinate value corresponding to the z-axis, the fifth coordinate is either the specific coordinate value corresponding to the x-axis or the specific coordinate value corresponding to the y-axis, and the sixth coordinate is either the specific coordinate value corresponding to the x-axis or the specific coordinate value corresponding to the y-axis.

[0073] Specifically, the fourth, fifth, and sixth coordinates of the 3D model can also be calculated according to a preset scaling ratio, that is, the x-axis values ​​can be calculated. Preset scaling ratio, y-axis value Preset scaling ratio and z-axis value After calculating the preset scaling ratio, the scaled 3D model can be obtained.

[0074] Optionally, the coordinates of the 3D model in the model coordinate system include a fourth coordinate, a fifth coordinate, and a sixth coordinate. The fourth coordinate is used to characterize the height of the 3D model in the model coordinate system. The method also includes: Step 016: Call the preset interface to scale the fourth coordinate of the 3D model according to the preset scaling ratio in the model coordinate system to obtain the scaled model; Step 011: Scale the 3D model in the model coordinate system using a preset scaling ratio, including: Step 0112: In the model coordinate system, scale the fifth and sixth coordinates of the scaled model according to the preset scaling ratio to obtain the scaled 3D model.

[0075] Specifically, the preset interface can be a standardized programming interface compatible with 3ds Max for performing scaling operations. When scaling a 3D model, the preset interface can directly reuse the optimized scaling logic of 3ds Max, eliminating the need for users to manually write the underlying logic and improving scaling efficiency. That is, the fourth coordinate of the 3D model can be scaled according to a preset scaling ratio to obtain the scaled model, and then the fifth and sixth coordinates of the scaled model can be scaled according to the preset scaling ratio to obtain the scaled 3D model.

[0076] For example, taking the process of processing a 3D model to obtain a scaled model by calling a preset interface that matches 3ds Max as an example, after obtaining the 3D model from the model file and filtering out the skeletal objects to be processed, a list of skeletal objects can be generated based on these objects. Next, the bone object controllers (used to manage the motion state of skeletal objects) of each skeletal object in the list are obtained, and the original overall movement mode (MoveALLmode) of each bone object controller is recorded using the getattr function. MoveALLmode includes a movable mode (True) and a non-movable mode (False). Then, the MoveALLmode of each bone object controller is set to True mode. This is because in True mode, updating the position coordinates of a single skeletal object will synchronously affect all its associated child skeletal objects, ensuring the integrity of the skeletal objects. Then, by calculating the fifth and sixth coordinates of each skeletal object in the scaled model using a preset scaling ratio, the scaled 3D model composed of the individual skeletal objects can be obtained. Finally, the MoveALLmode of each bone object controller is restored to complete the scaling process.

[0077] In some implementations, the method further includes: Step 017: Traverse each bone object of the 3D model to determine the leaf bone object. The leaf bone object is the bone object located at the end of the bone chain of the 3D model. Step 018: At the third position coordinate of the leaf bone object in the model coordinate system, create a virtual bone object and set the leaf bone object as the parent bone object of the virtual bone object; Step 011: Scale the 3D model in the model coordinate system using a preset scaling ratio, including: Step 0113: Scale each bone object and virtual bone object in the model coordinate system using a preset scaling ratio.

[0078] Optionally, the method further includes: Step 024: Delete the virtual skeleton object after scaling is complete.

[0079] Among them, the skeleton object can be a three-dimensional model including independent units, multiple skeleton objects form a skeleton chain, and the skeleton chain then forms a three-dimensional model.

[0080] Leaf bone objects can be bone objects located at the end of a bone chain in a 3D model. In a bone chain, there is a parent and child relationship between two adjacent bone objects. Leaf bone objects can be terminal bone objects in a bone chain that have no child bone objects (for example, they can be fingertip bone objects, toe tip bone objects, head top bone objects, etc. in a game character's 3D model).

[0081] The virtual bone object can be an auxiliary bone object created at the third position coordinate of the leaf bone object. The virtual bone object can be a bone object without an actual geometric mesh, used only to fix the relative position of the leaf bone object, and the parent-child hierarchy includes the leaf bone object as the parent and the virtual bone object as the child.

[0082] The third position coordinate can be the end position coordinate of the leaf bone object in the model coordinate system (i.e., the position of the leaf bone object away from the parent bone object), which serves as the position reference for the establishment of the virtual bone object, ensuring that the virtual bone object and the end of the leaf bone object are accurately aligned.

[0083] Specifically, in 3ds Max's resetBoneStretch() (3ds When scaling bone objects using the bone object stretching function in Max, leaf bone objects, lacking downstream reference points, are prone to issues such as retaining incorrect local scaling or length, or ineffective or unstable resets. Therefore, a virtual bone object is created at the third coordinate of the leaf bone object, and the leaf bone object is set as the parent bone object of the virtual bone object. This provides the leaf bone object with parent-child hierarchical direction and length references, allowing `resetBoneStretch()` to correctly reconstruct the bone length / scaling baseline after unit scaling. This indirectly locks the position of the leaf bone object during scaling, preventing end-point drift. The virtual bone object is then deleted after scaling. When the virtual bone object scales synchronously with all other bone objects at a preset ratio, the relative position of the virtual bone object and the leaf bone object is fixed (aligned at the third coordinate in the model coordinate system), ensuring consistent scaling ratios and maintaining the positional association between the leaf bone object's end and the virtual bone object. This prevents the leaf bone object from stretching during scaling. Deleting the virtual bone object after scaling does not change the original binding topology, avoiding temporary auxiliary elements consuming system resources and not affecting the normal animation movement of the scaled bone chain, thus reducing animation repair workload.

[0084] In some implementations, the method further includes: Step 025: Write the target animation layer into a keyframe, and in the keyframe, adjust the third coordinate of the second position coordinate of the scaled 3D model in the world coordinate system based on the difference between the second coordinate and the first coordinate to obtain the target 3D model.

[0085] Keyframes are specific time-point data used in 3D animation production to record key states (e.g., model position, model height, etc.) of skeletal objects or 3D models, and are the core components of animation motion trajectories.

[0086] Specifically, by adjusting the third coordinate of the second position coordinate of the 3D model in the world coordinate system in the newly created target animation layer, the target 3D model is obtained. Then, the target animation layer is written into keyframes. For example, by using the automatic keyframe function of 3ds Max, the adjustment result of the third coordinate is solidified into a keyframe, ensuring that the adjustment of the third coordinate continues to take effect throughout the entire animation frame. This ensures that during animation playback, the coordinates of each position of the 3D model always remain at the corresponding position after the third coordinate adjustment, and there will be no height drift due to changes in the frame sequence. This ensures the high stability of the entire animation process and avoids animation logic errors caused by height offset, thereby completely eliminating animation distortion in the height direction. It also achieves the effect of not needing manual frame trimming by utilizing the characteristic that keyframes take effect on the entire animation sequence.

[0087] In some implementations, the first position coordinates include a seventh coordinate and an eighth coordinate, and the method further includes: Step 019: Scale the seventh coordinate based on the preset scaling ratio to obtain the ninth coordinate; Step 020: Scale the eighth coordinate based on the preset scaling ratio to obtain the tenth coordinate; Step 014: Based on the difference between the second and first coordinates, adjust the third coordinate of the scaled 3D model in the world coordinate system to obtain the target 3D model, including: Step 0142: Based on any one of the differences between the second and first coordinates, the seventh and ninth coordinates, or the eighth and tenth coordinates, adjust the coordinates of the second position coordinate of the scaled 3D model in the world coordinate system to obtain the target 3D model.

[0088] In the world coordinate system, there are X-axis, Y-axis and Z-axis. The first position coordinates include the first coordinate, the seventh coordinate and the eighth coordinate. The first coordinate corresponds to the coordinate value of the Z-axis, the seventh coordinate corresponds to the coordinate value of either the X-axis or the Y-axis, and the eighth coordinate corresponds to the coordinate value of either the X-axis or the Y-axis.

[0089] Specifically, the seventh coordinate is scaled according to a preset scaling ratio to obtain the ninth coordinate, and the eighth coordinate is scaled according to a preset scaling ratio to obtain the tenth coordinate. Then, based on any one of the differences between the second and first coordinates, the seventh and ninth coordinates, and the eighth and tenth coordinates, the coordinates of the scaled 3D model in the second position coordinate of the world coordinate system are adjusted to obtain the target 3D model.

[0090] For example, the bone object to which the centroid belongs corresponds to the root bone object of the 3D model. With each root bone object obtained, a new animation layer named BipPositionLayer can be created, with the animation level being the current layer plus 1. The current operation is then switched to the newly created target animation layer, and the position coordinates of each root bone object in the world coordinate system before scaling are obtained, i.e., the corresponding first position coordinates are obtained. Then, according to the preset scaling ratio, the first, seventh, and eighth coordinates of the first position coordinates are calculated accordingly (or, the difference between the first and second coordinates is calculated first, and the seventh and eighth coordinates are calculated accordingly based on the difference) to obtain the coordinates of the second position coordinates of the scaled 3D model in the world coordinate system. Next, the original state of the automatic keyframe is recorded (old_autokey = rt.animButtonState), and automatic keyframe is enabled (rt.animButtonState = True). The calculated new positions are applied to the root bones and simultaneously recorded in the keyframes of the new animation layer. Finally, the original state of the automatic keyframe is restored, without the need for reskinning or manual frame adjustment.

[0091] Optionally, the method further includes: Step 021: Read the initial visual pose of the visual unit in the world coordinate system. The visual unit includes the mounting point and the camera. The initial visual pose includes the initial visual coordinates and the initial orientation. Step 022: Based on the difference, adjust the initial visual coordinates corresponding to the hanging point to determine the position coordinates of the hanging point in the world coordinate system, and adjust the attitude of the hanging point to the initial attitude corresponding to the hanging point. Step 023: Adjust the camera's pose in the world coordinate system to the camera's initial visual pose.

[0092] The visual unit includes anchor points and cameras. Anchor points are used to bind special effects resources (such as flame effects on the hands of game characters, halo effects on the heads, etc.), and cameras are used to determine the framing angle of the animation. Together, they form the basic framework for the visual presentation of the animation.

[0093] The initial visual pose includes initial visual coordinates and initial posture. The initial visual coordinates include the original position data of the attachment point or camera in the world coordinate system (including X-axis, Y-axis and Z-axis coordinates); the initial posture may include the original orientation and / or angle data of the attachment point or camera (e.g., the camera lens orientation, the orientation reference of the attachment point, etc.) to ensure that the spatial posture of the visual unit matches the original animation scene.

[0094] Specifically, as mentioned earlier, the world coordinate system is a unified reference framework for all elements in the scene. By reading the initial visual poses of the anchor points and the camera, an original state reference for the anchor points and the camera is established. When the spatial relationship changes due to subsequent scaling of the 3D model, adjustments can be made in reverse based on this reference to avoid the loss of the relative position between the visual unit and the model. Since the position of the anchor point is strongly related to the height of the model's centroid and the position of the skeleton (e.g., the head anchor point needs to move synchronously with the head skeleton), after the 3D model is scaled, the first position coordinate of the centroid of the 3D model in the world coordinate system will deviate (the deviation is determined based on the difference between the first and second coordinates). If the anchor point still uses the initial visual coordinates, it will cause a misalignment between the 3D model and the anchor point. The initial visual coordinates of the anchor point are adjusted according to the difference between the first and second coordinates, so that the anchor point shifts synchronously with the centroid deviation of the 3D model, ensuring that the relative position of the anchor point and the 3D model is consistent with that before scaling. At the same time, the initial pose of the anchor point is retained because the orientation of the anchor point (e.g., the direction of the special effect) is related to the model's pose and does not need to be changed with scaling, thus achieving the effect of zero change in special effects and direct reuse of AE special effects.

[0095] The camera's function is to fix the framing range (such as a full-body shot of a character), and its pose (position and angle) matches the overall size of the model, rather than being directly related to the model's center of gravity deviation. After scaling the model, it is only necessary to restore the camera's initial visual pose to ensure that the scaled model remains completely within the original framing (such as a shot that originally captured the character's full body; after scaling, the character will not exceed the frame), avoiding the tedious operation of readjusting the camera's focus and angle in the traditional process and reducing multiple back-and-forth steps.

[0096] To facilitate better implementation of the 3D model scaling method of this application embodiment, this application embodiment also provides a 3D model scaling device. Please refer to... Figure 5 , Figure 5 This is a schematic diagram of the structure of a scaling device for a three-dimensional model provided in an embodiment of this application. The scaling device 200 for the three-dimensional model may include: The first scaling module 201 is used to scale the three-dimensional model in the model coordinate system with a preset scaling ratio, wherein the origin of the model coordinate system is located at the centroid of the three-dimensional model. The determination module 202 is used to determine the first position coordinates of the centroid in the world coordinate system. The first position coordinates include a first coordinate, which is used to characterize the height of the centroid in the world coordinate system. The second scaling module 203 is used to scale the first coordinate based on a preset scaling ratio to obtain the second coordinate; The adjustment module 204 is used to adjust the third coordinate of the second position coordinate of the scaled 3D model in the world coordinate system based on the difference between the second coordinate and the first coordinate, so as to obtain the target 3D model. The third coordinate is used to characterize the height of the scaled 3D model in the world coordinate system.

[0097] Each unit in the scaling device for the aforementioned 3D model can be implemented entirely or partially through software, hardware, or a combination thereof. These units can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each unit.

[0098] The scaling device 200 for the three-dimensional model can be integrated into a terminal or server that has storage and a processor and thus computing power, or the scaling device 200 for the three-dimensional model can be the terminal or server.

[0099] Optionally, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0100] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device may be a terminal or a server. Figure 6 As shown, the computer device 300 includes a processor 301 with one or more processing cores, a memory 302 with one or more computer-readable storage media, and a computer program stored in the memory 302 and executable on the processor. The processor 301 is electrically connected to the memory 302. Those skilled in the art will understand that the computer device structure shown in the figures does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0101] The processor 301 is the control center of the computer device 300. It connects various parts of the computer device 300 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, it performs various functions of the computer device 300 and processes data, thereby performing overall processing of the computer device 300.

[0102] In this embodiment, the processor 301 in the computer device 300 loads the instructions corresponding to the processes of one or more computer programs into the memory 302 according to the following steps, and the processor 301 runs the computer programs stored in the memory 302 to realize various functions: The three-dimensional model is scaled in the model coordinate system with a preset scaling ratio, wherein the origin of the model coordinate system is located at the centroid of the three-dimensional model. Determine the first position coordinates of the centroid in the world coordinate system. The first position coordinates include a first coordinate, which is used to characterize the height of the centroid in the world coordinate system. Based on the preset scaling ratio, the first coordinate is scaled to obtain the second coordinate; Based on the difference between the second coordinate and the first coordinate, the third coordinate of the scaled 3D model in the world coordinate system is adjusted to obtain the target 3D model. The third coordinate is used to characterize the height of the scaled 3D model in the world coordinate system.

[0103] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0104] Optional, such as Figure 6 As shown, the computer device 300 also includes: a display screen 303, a radio frequency circuit 304, an audio circuit 305, an input unit 306, and a power supply 307. The processor 301 is electrically connected to the display screen 303, the radio frequency circuit 304, the audio circuit 305, the input unit 306, and the power supply 307. Those skilled in the art will understand that... Figure 6 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0105] The display screen 303 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The display screen 303 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the computer device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program. Optionally, the touch panel may include a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, and transmits the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to the processor 301, and can receive and execute commands from the processor 301. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 301 to determine the type of touch event. Subsequently, the processor 301 provides corresponding visual output on the display panel according to the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into the display screen 303 to achieve input and output functions. However, in some embodiments, the touch panel and the display screen 303 can be implemented as two independent components to achieve input and output functions. That is, the display screen 303 can also be used as part of the input unit 306 to achieve input functions.

[0106] The radio frequency circuit 304 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other computer devices, and to transmit and receive signals with network devices or other computer devices.

[0107] Audio circuitry 305 can be used to provide an audio interface between a user and a computer device via a speaker and a microphone. Audio circuitry 305 converts received audio data into electrical signals, transmits them to the speaker, and the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 305, converted back into audio data, and output to processor 301 for processing. The audio data is then transmitted via radio frequency circuitry 304 to, for example, another computer device, or output to memory 302 for further processing. Audio circuitry 305 may also include an earphone jack to facilitate communication between peripheral headphones and the computer device.

[0108] The input unit 306 can be used to receive input numbers, characters, or object feature information (such as fingerprints, irises, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.

[0109] Power supply 307 is used to supply power to various components of computer device 300. Optionally, power supply 307 can be logically connected to processor 301 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 307 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0110] although Figure 6 As not shown in the diagram, computer equipment 300 may also include a camera, sensor, wireless fidelity module, Bluetooth module, etc., which will not be described in detail here.

[0111] This application also provides a computer-readable storage medium for storing a computer program. This computer-readable storage medium can be applied to a computer device, and the computer program causes the computer device to execute the corresponding processes in the scaling method for the three-dimensional model in the embodiments of this application; for brevity, these will not be elaborated further here.

[0112] This application also provides a computer program product including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the corresponding process in the scaling method for the three-dimensional model in the embodiments of this application. For simplicity, further details are omitted here.

[0113] This application also provides a computer program comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the corresponding process in the scaling method for the three-dimensional model of this application; for brevity, this will not be elaborated further.

[0114] It should be understood that the processor in this application may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0115] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0116] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0117] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0118] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0119] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0120] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0121] In addition, the functional units in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0122] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer or a server) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0123] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A scaling method for a three-dimensional model, characterized in that, include: The three-dimensional model is scaled in the model coordinate system with a preset scaling ratio, wherein the origin of the model coordinate system is located at the centroid of the three-dimensional model. Determine the first position coordinates of the centroid in the world coordinate system. The first position coordinates include a first coordinate, which is used to characterize the height of the centroid in the world coordinate system. Based on the preset scaling ratio, the first coordinate is scaled to obtain the second coordinate; Based on the difference between the second coordinate and the first coordinate, the third coordinate of the scaled 3D model in the world coordinate system is adjusted to obtain the target 3D model. The third coordinate is used to characterize the height of the scaled 3D model in the world coordinate system.

2. The scaling method for a three-dimensional model according to claim 1, characterized in that, The coordinates of the 3D model in the model coordinate system include a fourth coordinate, a fifth coordinate, and a sixth coordinate. The fourth coordinate is used to characterize the height of the 3D model in the model coordinate system. Scaling the 3D model in the model coordinate system by a preset scaling ratio includes: In the model coordinate system, the fourth, fifth, and sixth coordinates of the three-dimensional model are scaled according to the preset scaling ratio to obtain the scaled three-dimensional model.

3. The scaling method for a three-dimensional model according to claim 1 or 2, characterized in that, The method further includes: Traverse each bone object of the 3D model to determine the leaf bone object, wherein the leaf bone object is the bone object located at the end of the bone chain of the 3D model among the bone objects; At the third position coordinate of the leaf bone object in the model coordinate system, a virtual bone object is created, and the leaf bone object is set as the parent bone object of the virtual bone object. The scaling of the 3D model in the model coordinate system by a preset scaling ratio includes: The individual bone objects and the virtual bone objects are scaled in the model coordinate system using a preset scaling ratio.

4. The scaling method for a three-dimensional model according to claim 3, characterized in that, The method further includes: After scaling is complete, delete the virtual skeleton object.

5. The scaling method for a three-dimensional model according to claim 1, characterized in that, The step of adjusting the third coordinate of the scaled 3D model in the world coordinate system based on the difference between the second coordinate and the first coordinate to obtain the target 3D model includes: On the target animation layer, based on the difference between the second coordinate and the first coordinate, the third coordinate of the scaled 3D model in the world coordinate system is adjusted to obtain the target 3D model. The target animation layer is a newly created animation layer.

6. The scaling method for a three-dimensional model according to claim 5, characterized in that, On the target animation layer, based on the difference between the second coordinate and the first coordinate, the third coordinate of the scaled 3D model in the world coordinate system is adjusted to obtain the target 3D model, including: The target animation layer is written into a keyframe, and in the keyframe, the third coordinate of the scaled 3D model in the second position coordinate of the world coordinate system is adjusted based on the difference between the second coordinate and the first coordinate to obtain the target 3D model.

7. The scaling method for a three-dimensional model according to claim 1, characterized in that, The first position coordinates include a seventh coordinate and an eighth coordinate, and the method further includes: Based on the preset scaling ratio, the seventh coordinate is scaled to obtain the ninth coordinate; Based on the preset scaling ratio, the eighth coordinate is scaled to obtain the tenth coordinate; The step of adjusting the third coordinate of the scaled 3D model in the world coordinate system based on the difference between the second coordinate and the first coordinate to obtain the target 3D model includes: Based on any one of the differences between the second coordinate and the first coordinate, the seventh coordinate and the ninth coordinate, and the eighth coordinate and the tenth coordinate, the coordinates contained in the second position coordinate of the scaled 3D model in the world coordinate system are adjusted to obtain the target 3D model.

8. The scaling method for a three-dimensional model according to claim 1 or 7, characterized in that, The method further includes: The initial visual pose of the vision unit in the world coordinate system is read. The vision unit includes a mounting point and a camera. The initial visual pose includes initial visual coordinates and initial posture. Based on the difference, the initial visual coordinates corresponding to the hanging point are adjusted to determine the position coordinates of the hanging point in the world coordinate system, and the posture of the hanging point is adjusted to the initial posture corresponding to the hanging point. The pose of the camera in the world coordinate system is adjusted to the initial visual pose corresponding to the camera.

9. The scaling method for a three-dimensional model according to claim 1, characterized in that, The method further includes: In response to the user's first input operation on the editing interface, the 3D model and the preset scaling ratio are determined.

10. The scaling method for a three-dimensional model according to claim 9, characterized in that, The editing interface includes zoom controls and add controls. The step of responding to user input on the editing interface and determining the 3D model and the preset zoom ratio includes: In response to a second input operation received by the scaling control, the preset scaling ratio is determined; In response to the trigger operation received by the added control, the 3D model is obtained.

11. A scaling device for a three-dimensional model, characterized in that, include: The first scaling module is used to scale the three-dimensional model in the model coordinate system by a preset scaling ratio, wherein the origin of the model coordinate system is located at the centroid of the three-dimensional model. A determination module is used to determine the first position coordinates of the centroid in the world coordinate system, the first position coordinates including a first coordinate, the first coordinate being used to characterize the height of the centroid in the world coordinate system; The second scaling module is used to scale the first coordinate based on the preset scaling ratio to obtain the second coordinate; An adjustment module is used to adjust the third coordinate of the second position coordinate of the scaled 3D model in the world coordinate system based on the difference between the second coordinate and the first coordinate, so as to obtain the target 3D model. The third coordinate is used to characterize the height of the scaled 3D model in the world coordinate system.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted for loading by a processor to perform the scaling method for a three-dimensional model as described in any one of claims 1-10.

13. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program, and the processor executing the scaling method of the three-dimensional model according to any one of claims 1-10 by calling the computer program stored in the memory.

14. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the scaling method of the three-dimensional model according to any one of claims 1-10.