Boundary box generation method and device, electronic equipment, storage medium and program product

By responding to the rotation of movable objects in 3D game scenes, a new axis-aligned bounding box is efficiently generated, which solves the problem of excessive CPU computing burden caused by traditional collision detection methods, and improves collision detection efficiency and game fluency.

CN119904476APending Publication Date: 2025-04-29MOORE THREADS TECHNOLOGY (SHANGHAI) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411981777.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

In 3D game scenarios, traditional collision detection methods require the calculation of bounding boxes or surround balls for each model, and each frame needs to be recalculated once, resulting in excessive CPU computing burden and CPU binding problems.

Method used

By obtaining the rotation matrix in response to the rotation of the movable object, and determining the maximum and minimum vertex coordinates of the new axis-aligned bounding box based on the axis-aligned bounding box of the rotation matrix and the initial timestamp, thereby efficiently generating a new bounding box and reducing the CPU calculation burden.

Benefits of technology

In highly dynamic game scenarios, the efficiency of collision detection is improved, the CPU load is reduced, the needs of real-time collision detection are met, and the smoothness of the game and the player's experience is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119904476A_ABST
    Figure CN119904476A_ABST
Patent Text Reader

Abstract

The invention relates to a bounding box generation method and device, electronic equipment, a storage medium and a program product. The method comprises the following steps: for any movable object, responding to rotation of the movable object in a three-dimensional scene from a timestamp t-1 to a timestamp t, and obtaining a rotation matrix of the movable object from the timestamp t-1 to the timestamp t, t being an integer greater than or equal to 1; according to the rotation matrix and the three-dimensional coordinate of the maximum vertex and the three-dimensional coordinate of the minimum vertex of the movable object on the axis alignment bounding box of the timestamp t-1, determining the three-dimensional coordinate of the maximum vertex and the three-dimensional coordinate of the minimum vertex of the movable object on the axis alignment bounding box of the timestamp t; and according to the three-dimensional coordinate of the maximum vertex and the three-dimensional coordinate of the minimum vertex of the movable object in the axis alignment bounding box of the timestamp t, determining the position information of the movable object in the axis alignment bounding box of the timestamp t.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a bounding box generation method, a bounding box generation device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] In the field of computer graphics and game development, model collision detection in 3D (3D) game scenes is a crucial technical link, which directly affects the playability and realism of the game. With the increasing complexity of game scenes and the number of models, traditional collision detection methods face huge challenges. These methods usually need to calculate the bounding box or bounding sphere for each model, and each frame needs to be recalculated, which puts a huge computational burden on the CPU (Central Processing Unit), resulting in the CPU bind problem.

[0003] In 3D game development, CPU computing resources are very valuable because they not only need to handle collision detection, but also graphics rendering, physical simulation and other tasks. Therefore, how to efficiently generate the bounding box of the model, reduce the computing burden of the CPU, and improve the efficiency of collision detection has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The present disclosure provides a technical solution for generating a bounding box.

[0005] According to one aspect of the present disclosure, a method for generating a bounding box is provided, comprising:

[0006] For any movable object in the three-dimensional scene, in response to the movable object rotating from timestamp t-1 to timestamp t, obtaining a rotation matrix of the movable object from timestamp t-1 to timestamp t, where t is an integer greater than or equal to 1;

[0007] According to the rotation matrix, and the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1, the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t are determined; wherein the maximum vertex of the axis-aligned bounding box of the movable object at any timestamp represents the vertex of the movable object with the largest coordinate value in the axis-aligned bounding box of the timestamp; the minimum vertex of the axis-aligned bounding box of the movable object at any timestamp represents the vertex of the movable object with the smallest coordinate value in the axis-aligned bounding box of the timestamp;

[0008] The position information of the axis-aligned bounding box of the movable object at timestamp t is determined according to the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t.

[0009] In a possible implementation, determining the three-dimensional coordinates of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t according to the rotation matrix and the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 includes:

[0010] For any coordinate component in the three-dimensional coordinates of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t, determine the x-axis coordinate, y-axis coordinate, and z-axis coordinate that maximize the coordinate component from the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 according to the positive and negative conditions of the three elements corresponding to the coordinate component in the rotation matrix;

[0011] The coordinate component is determined according to the three elements corresponding to the coordinate component in the rotation matrix, and the x-axis coordinate, y-axis coordinate and z-axis coordinate that maximize the coordinate component.

[0012] In a possible implementation, determining the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t according to the rotation matrix and the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 includes:

[0013] For any coordinate component in the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t, determine the x-axis coordinate, y-axis coordinate, and z-axis coordinate that minimize the coordinate component from the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 according to the positive and negative conditions of the three elements corresponding to the coordinate component in the rotation matrix;

[0014] The coordinate component is determined according to the three elements corresponding to the coordinate component in the rotation matrix, and the x-axis coordinate, y-axis coordinate and z-axis coordinate that minimize the coordinate component.

[0015] In a possible implementation, the method further includes:

[0016] In response to any movable object appearing in the three-dimensional scene for the first time, obtaining a vertex list of the movable object, wherein the vertex list of the movable object includes three-dimensional coordinates of vertices constituting the movable object;

[0017] Searching for a vertex with the largest coordinate value from the vertex list of the movable object, and obtaining an initial value of the three-dimensional coordinate of the largest vertex of the axis-aligned bounding box of the movable object;

[0018] From the vertex list of the movable object, find the vertex with the smallest coordinate value, and obtain the initial value of the three-dimensional coordinate of the smallest vertex of the axis-aligned bounding box of the movable object.

[0019] In a possible implementation, the method further includes:

[0020] performing collision detection on objects in the three-dimensional scene according to position information of axis-aligned bounding boxes of different objects in the three-dimensional scene at timestamp t;

[0021] The object includes a movable object, or the object includes a movable object and an immovable object.

[0022] In a possible implementation, performing collision detection on objects in the three-dimensional scene according to position information of axis-aligned bounding boxes of different objects in the three-dimensional scene at timestamp t includes:

[0023] For a first object and a second object in the three-dimensional scene, in response to an axis-aligned bounding box of the first object at timestamp t overlapping with an axis-aligned bounding box of the second object at timestamp t in an x-axis direction, a y-axis direction, and a z-axis direction, determining that the first object and the second object collide at timestamp t;

[0024] or,

[0025] For a first object and a second object in the three-dimensional scene, in response to the fact that an axis-aligned bounding box of the first object at timestamp t does not overlap with an axis-aligned bounding box of the second object at timestamp t in any one of the x-axis direction, the y-axis direction, and the z-axis direction, it is determined that the first object and the second object did not collide at timestamp t.

[0026] In a possible implementation, the three-dimensional scene includes a three-dimensional game scene.

[0027] According to one aspect of the present disclosure, there is provided a bounding box generating device, comprising:

[0028] A first obtaining module is used for obtaining, for any movable object in the three-dimensional scene, a rotation matrix of the movable object from timestamp t-1 to timestamp t in response to the movable object rotating from timestamp t-1 to timestamp t, wherein t is an integer greater than or equal to 1;

[0029] The first determination module is used to determine the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t according to the rotation matrix and the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1; wherein the maximum vertex of the axis-aligned bounding box of the movable object at any timestamp represents the vertex of the movable object with the largest coordinate value in the axis-aligned bounding box of the timestamp; the minimum vertex of the axis-aligned bounding box of the movable object at any timestamp represents the vertex of the movable object with the smallest coordinate value in the axis-aligned bounding box of the timestamp;

[0030] The second determination module is used to determine the position information of the axis-aligned bounding box of the movable object at timestamp t according to the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t.

[0031] In a possible implementation manner, the first determining module is used to:

[0032] For any coordinate component in the three-dimensional coordinates of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t, determine the x-axis coordinate, y-axis coordinate, and z-axis coordinate that maximize the coordinate component from the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 according to the positive and negative conditions of the three elements corresponding to the coordinate component in the rotation matrix;

[0033] The coordinate component is determined according to the three elements corresponding to the coordinate component in the rotation matrix, and the x-axis coordinate, y-axis coordinate and z-axis coordinate that maximize the coordinate component.

[0034] In a possible implementation manner, the first determining module is used to:

[0035] For any coordinate component in the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t, determine the x-axis coordinate, y-axis coordinate, and z-axis coordinate that minimize the coordinate component from the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 according to the positive and negative conditions of the three elements corresponding to the coordinate component in the rotation matrix;

[0036] The coordinate component is determined according to the three elements corresponding to the coordinate component in the rotation matrix, and the x-axis coordinate, y-axis coordinate and z-axis coordinate that minimize the coordinate component.

[0037] In a possible implementation manner, the device further includes:

[0038] A second obtaining module is used for obtaining a vertex list of any movable object in response to the first appearance of any movable object in the three-dimensional scene, wherein the vertex list of the movable object includes three-dimensional coordinates of vertices constituting the movable object;

[0039] A first search module, configured to search for a vertex with a maximum coordinate value from a vertex list of the movable object, and obtain an initial value of a three-dimensional coordinate of a maximum vertex of an axis-aligned bounding box of the movable object;

[0040] The second search module is used to search for a vertex with the smallest coordinate value from the vertex list of the movable object, and obtain an initial value of the three-dimensional coordinate of the smallest vertex of the axis-aligned bounding box of the movable object.

[0041] In a possible implementation manner, the device further includes:

[0042] A collision detection module, configured to perform collision detection on objects in the three-dimensional scene according to position information of axis-aligned bounding boxes of different objects in the three-dimensional scene at timestamp t;

[0043] The object includes a movable object, or the object includes a movable object and an immovable object.

[0044] In a possible implementation, the collision detection module is used to:

[0045] For a first object and a second object in the three-dimensional scene, in response to an axis-aligned bounding box of the first object at timestamp t overlapping with an axis-aligned bounding box of the second object at timestamp t in an x-axis direction, a y-axis direction, and a z-axis direction, determining that the first object and the second object collide at timestamp t;

[0046] or,

[0047] For a first object and a second object in the three-dimensional scene, in response to the fact that an axis-aligned bounding box of the first object at timestamp t does not overlap with an axis-aligned bounding box of the second object at timestamp t in any one of the x-axis direction, the y-axis direction, and the z-axis direction, it is determined that the first object and the second object did not collide at timestamp t.

[0048] In a possible implementation, the three-dimensional scene includes a three-dimensional game scene.

[0049] According to one aspect of the present disclosure, an electronic device is provided, comprising: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to call the executable instructions stored in the memory to execute the above method.

[0050] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor.

[0051] According to one aspect of the present disclosure, a computer program product is provided, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in an electronic device, a processor in the electronic device executes the above method.

[0052] In the disclosed embodiment, for any movable object in a three-dimensional scene, in response to the movable object rotating from timestamp t-1 to timestamp t, a rotation matrix of the movable object from timestamp t-1 to timestamp t is obtained, and according to the rotation matrix and the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1, the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t are determined, and according to the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t, the position information of the axis-aligned bounding box of the movable object at timestamp t is determined, so that when the movable object in the three-dimensional scene rotates, there is no need to perform rotation calculations on the eight vertices of the axis-aligned bounding box separately, and a new axis-aligned bounding box can be efficiently generated, thereby reducing the calculation load of the CPU, thereby helping to improve the efficiency of collision detection in highly dynamic game scenes, meet the needs of real-time collision detection, and improve the fluency of the game and the player experience.

[0053] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.

[0054] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.

[0056] Figure 1 A flow chart of a bounding box generation method provided by an embodiment of the present disclosure is shown.

[0057] Figure 2 Diagram showing an axis-aligned bounding box.

[0058] Figure 3 A block diagram of a bounding box generating device provided by an embodiment of the present disclosure is shown.

[0059] Figure 4 A block diagram of an electronic device 1900 provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0060] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0061] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0062] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.

[0063] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.

[0064] The disclosed embodiment provides a bounding box generation method. For any movable object in a three-dimensional scene, in response to the movable object rotating from timestamp t-1 to timestamp t, a rotation matrix of the movable object from timestamp t-1 to timestamp t is obtained. According to the rotation matrix and the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1, the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object are determined. According to the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t, the position information of the axis-aligned bounding box of the movable object at timestamp t is determined. Therefore, when the movable object in the three-dimensional scene rotates, there is no need to perform rotation calculations on the eight vertices of the axis-aligned bounding box separately, and a new axis-aligned bounding box can be efficiently generated, thereby reducing the calculation load of the CPU, thereby helping to improve the efficiency of collision detection in highly dynamic game scenes, meet the needs of real-time collision detection, and improve the fluency of the game and the experience of the player.

[0065] The bounding box generation method provided by the embodiment of the present disclosure is described in detail below with reference to the accompanying drawings.

[0066] Figure 1 A flow chart of a bounding box generation method provided by an embodiment of the present disclosure is shown. In one possible implementation, the execution subject of the bounding box generation method may be a bounding box generation device. For example, the bounding box generation method may be executed by a terminal device or a server or other electronic device. The terminal device may be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device or a wearable device. In some possible implementations, the bounding box generation method may be implemented by a processor calling computer-readable instructions stored in a memory. For example Figure 1 As shown, the bounding box generation method includes steps S11 to S13.

[0067] In step S11, for any movable object in the three-dimensional scene, in response to the movable object rotating from timestamp t-1 to timestamp t, a rotation matrix of the movable object from timestamp t-1 to timestamp t is obtained, where t is an integer greater than or equal to 1.

[0068] In step S12, the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t are determined based on the rotation matrix, and the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1; wherein the maximum vertex of the axis-aligned bounding box of the movable object at any timestamp represents the vertex of the movable object with the largest coordinate value in the axis-aligned bounding box of the timestamp; the minimum vertex of the axis-aligned bounding box of the movable object at any timestamp represents the vertex of the movable object with the smallest coordinate value in the axis-aligned bounding box of the timestamp.

[0069] In step S13, the position information of the axis-aligned bounding box of the movable object at timestamp t is determined according to the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t.

[0070] In the embodiments of the present disclosure, a 3D scene may refer to an environment or situation constructed in a 3D space, and a 3D scene may simulate an environment in the real world or a fictional world. 3D scenes are widely used in the fields of computer graphics, game development, virtual reality (VR), augmented reality (AR), etc.

[0071] In a possible implementation, the three-dimensional scene includes a three-dimensional game scene. In electronic games, the three-dimensional scene provides a virtual environment in which players can move, explore and interact.

[0072] In another possible implementation, the three-dimensional scene may include a virtual reality scene. The virtual reality scene may be used to simulate a real environment or create a new imaginary world to give users an immersive experience.

[0073] In another possible implementation, the three-dimensional scene may include a three-dimensional scene used in education and training. For example, the three-dimensional scene may be used to create a simulated training environment, such as a flight simulator, a surgical simulator, etc., to provide a simulated experience of actual operation.

[0074] It should be noted that, although the three-dimensional scene is introduced in the above implementation manner, those skilled in the art will appreciate that the present disclosure should not be limited thereto. The bounding box generation method provided in the embodiment of the present disclosure can be applied to any three-dimensional scene containing movable objects.

[0075] In the embodiment of the present disclosure, in a three-dimensional scene, objects can be divided into two categories according to whether they can move: movable objects and immovable objects.

[0076] Among them, movable objects can refer to objects that can change their positions according to certain conditions or rules in a three-dimensional scene. The position, direction or shape of movable objects can change over time or change when subjected to external forces. Movable objects can have the following characteristics: Dynamicity: The position and state of movable objects are not fixed, and they can be dynamically adjusted according to game logic, physical rules or user input; Interactivity: Users or programs can interact with movable objects, such as pushing, pulling, throwing, etc.; Physical simulation: In many applications, especially games, movable objects need to be physically simulated, such as calculating gravity, collisions, etc. Examples of movable objects can include: player characters, NPCs (Non-Player Characters) in games; items that can be picked up or used by players, such as weapons and props; mechanical devices, such as doors, elevators, and moving platforms.

[0077] Immovable objects can refer to objects whose positions in a three-dimensional scene are fixed and do not change. They constitute the static background or structure of the scene and usually do not change position due to external forces or user interaction. Immovable objects can have the following characteristics: Stability: The position and state of immovable objects are predetermined and do not change over time or interaction; Environmental composition: They are often used to build the environment and layout of the scene, such as buildings, mountains, trees, etc.; No need for physical simulation: Immovable objects usually do not require complex physical simulation because their positions are fixed. Examples of immovable objects can include: buildings, walls, floors; natural environments such as mountains, rivers, vegetation; roads, bridges and other infrastructure.

[0078] In the embodiment of the present disclosure, the bounding box of the object in the three-dimensional scene may adopt an axis-aligned bounding box (AABB). Figure 2 Schematic diagram of an axis-aligned bounding box is shown. The axis-aligned bounding box is a cuboid whose sides are aligned with the coordinate axes (x-axis, y-axis, z-axis). Therefore, each face of the axis-aligned bounding box is parallel to the coordinate plane. The axis-aligned bounding box can be defined by two vertices: a maximum vertex and a minimum vertex. Among them, the maximum vertex has the largest x, y, z coordinate values, and the minimum vertex has the smallest x, y, z coordinate values. The maximum vertex and the minimum vertex determine the size and position of the axis-aligned bounding box.

[0079] In a possible implementation, the method further includes: in response to any movable object appearing for the first time in the three-dimensional scene, obtaining a vertex list of the movable object, wherein the vertex list of the movable object includes the three-dimensional coordinates of the vertices constituting the movable object; searching for the vertex with the largest coordinate value from the vertex list of the movable object to obtain the initial value of the three-dimensional coordinate of the maximum vertex of the axis-aligned bounding box of the movable object; searching for the vertex with the smallest coordinate value from the vertex list of the movable object to obtain the initial value of the three-dimensional coordinate of the minimum vertex of the axis-aligned bounding box of the movable object.

[0080] In this implementation, when a movable object first appears in a three-dimensional scene, a vertex list of the movable object can be obtained. The vertex list can include the three-dimensional coordinates of all vertices constituting the movable object. In three-dimensional modeling and computer graphics, a three-dimensional model of a movable object can be composed of multiple triangular facets, which together define the geometric shape and appearance of the movable object. The vertex list of any movable object can include the vertices of all triangular facets constituting the three-dimensional model of the movable object.

[0081] From the list of vertices of the movable object, the vertex with the maximum coordinate value on each coordinate axis (x, y, z) can be found. This vertex can be used to determine the maximum vertex of the axis-aligned bounding box of the movable object. The maximum vertex of the axis-aligned bounding box is the point whose coordinate value is the maximum on each axis among the 8 vertices of the bounding box.

[0082] Similarly, the vertex with the minimum coordinate value on each coordinate axis can be found. This vertex can be used to determine the minimum vertex of the axis-aligned bounding box of the movable object. The minimum vertex of the axis-aligned bounding box is the point whose coordinate value is the minimum on each axis among the 8 vertices of the bounding box.

[0083] The coordinates of the maximum and minimum vertices found can be used as initial values ​​for the axis-aligned bounding box. This means that when a movable object is first introduced into the 3D scene, its axis-aligned bounding box will be created based on these initial coordinate values ​​to ensure that the movable object is completely contained within the axis-aligned bounding box.

[0084] By adopting this implementation, the axis-aligned bounding boxes of movable objects in a three-dimensional scene can be effectively initialized and managed, thereby facilitating subsequent operations such as collision detection, rendering sorting, and spatial query.

[0085] In the disclosed embodiment, the transformation of the movable object in the three-dimensional scene may include translation transformation, rotation transformation and scaling transformation. Accordingly, the transformation matrix may include translation matrix, rotation matrix and scaling matrix. In practical applications, a movable object may need to apply multiple transformations at the same time, in which case these transformations can be combined by matrix multiplication.

[0086] In a three-dimensional scene, the position and orientation of movable objects change dynamically, and these changes usually occur over time. In order to track and process these changes, we can introduce the concept of timestamps. Among them, a timestamp is a numerical value that marks a specific point in time, and is usually used to represent the state of an object at different points in time. For example, timestamp t can represent the current moment, while timestamp t-1 can represent the previous moment. In computer graphics and physical simulations, timestamps can be used to mark each frame or each simulation step.

[0087] Between timestamp t-1 and timestamp t, the movable object may have undergone a rotation, i.e., a change in direction. A rotation can be a rotation of any angle around any axis, which needs to be described by a rotation matrix. A rotation matrix can be used to represent the rotation state of a movable object in three-dimensional space. A rotation matrix can contain all the necessary information for the rotation of a movable object, including the axis of rotation and the angle of rotation.

[0088] In the related art, the new position of the vertex at the new time stamp t is calculated by multiplying each vertex of the object by the rotation matrix. For example, R is the rotation matrix from t-1 to t, v t-1 is the vertex coordinate of the object at timestamp t-1, then v t =R·v t-1 It is the new coordinate of the vertex at timestamp t. In the related art, it is necessary to perform rotation calculations on the eight vertices of the bounding box respectively, which requires a large amount of calculation and results in a high CPU load.

[0089] In the embodiment of the present disclosure, there is no need to perform rotation calculations on the eight vertices of the bounding box separately. Instead, the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t are determined based on the rotation matrix and the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1.

[0090] In a possible implementation, the three-dimensional coordinates of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t are determined according to the rotation matrix, and the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1, including: for any coordinate component in the three-dimensional coordinates of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t, according to the positive and negative conditions of the three elements corresponding to the coordinate component in the rotation matrix, the x-axis coordinate, the y-axis coordinate, and the z-axis coordinate that maximize the coordinate component from the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1; and the coordinate component is determined according to the three elements corresponding to the coordinate component in the rotation matrix, and the x-axis coordinate, y-axis coordinate, and z-axis coordinate that maximize the coordinate component.

[0091] In this implementation, for the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t, its three-dimensional coordinates are composed of three coordinate components: x, y, and z. For each coordinate component, the value of the coordinate component after rotation can be determined by analyzing the three elements corresponding to the coordinate component in the rotation matrix (i.e., a row of the matrix). Specifically, for any coordinate component in the three-dimensional coordinates of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t, the x-axis coordinates, y-axis coordinates, and z-axis coordinates that will maximize the coordinate component can be selected from the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box at timestamp t-1 according to the positive and negative conditions of the three elements corresponding to the coordinate component in the rotation matrix.

[0092] In this implementation, there is no need to apply the rotation matrix to each vertex of the axis-aligned bounding box of the movable object at timestamp t-1. Instead, the x-axis coordinate, y-axis coordinate, and z-axis coordinate in the three-dimensional coordinates of the maximum vertex and the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 are determined by analyzing the elements of the rotation matrix, thereby greatly reducing the amount of calculation for generating the bounding box.

[0093] In a possible implementation, the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t are determined according to the rotation matrix, and the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1, including: for any coordinate component in the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t, according to the positive and negative conditions of the three elements corresponding to the coordinate component in the rotation matrix, the x-axis coordinate, y-axis coordinate, and z-axis coordinate that minimize the coordinate component from the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1; and the coordinate component is determined according to the three elements corresponding to the coordinate component in the rotation matrix, and the x-axis coordinate, y-axis coordinate, and z-axis coordinate that minimize the coordinate component.

[0094] In this implementation, for the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t, its three-dimensional coordinates are composed of three coordinate components: x, v, and z. For each coordinate component, the value of the coordinate component after rotation can be determined by analyzing the three elements corresponding to the coordinate component in the rotation matrix (i.e., a row of the matrix). Specifically, for any coordinate component in the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t, the x-axis coordinates, y-axis coordinates, and z-axis coordinates that minimize the coordinate component can be selected from the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box at timestamp t-1 according to the positive and negative conditions of the three elements corresponding to the coordinate component in the rotation matrix.

[0095] In this implementation, there is no need to apply the rotation matrix to each vertex of the axis-aligned bounding box of the movable object at timestamp t-1. Instead, the x-axis coordinate, y-axis coordinate, and z-axis coordinate in the three-dimensional coordinates of the maximum vertex and the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 are determined by analyzing the elements of the rotation matrix, thereby greatly reducing the amount of calculation for generating the bounding box.

[0096] For example, the coordinates of the largest vertex of the axis-aligned bounding box of a movable object at time stamp t-1 are (x max ,y max , z max ), the coordinates of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp tl are (x min ,y min , z min ). According to the coordinates of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t-1 (x max ,y max , z max) and the coordinates of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t-1 (x min ,y min , z min ), we can get the coordinates of the 8 vertices of the axis-aligned bounding box of the movable object at timestamp t-1, which are (x min ,y min , z min )、(x min ,y max , z min )、(x max ,y min , z min )、(x max ,y max , z min )、(x min ,y min , z max )、(x min ,y max , z max )、(x max ,y min , z max ) and (x max ,y max , z max ).

[0097] For example, the rotation matrix of the movable object from timestamp t-1 to timestamp t is Among them, m 11 represents the projection component of the x-axis unit vector of the object coordinate system of the movable object at time stamp t on the x-axis of the object coordinate system of the movable object at time stamp t-1, m 12 represents the projection component of the x-axis unit vector of the object coordinate system of the movable object at time stamp t on the y-axis of the object coordinate system of the movable object at time stamp t-1, m 13 represents the projection component of the x-axis unit vector of the object coordinate system of the movable object at time stamp t on the z-axis of the object coordinate system of the movable object at time stamp t-1, m 21 represents the projection component of the y-axis unit vector of the object coordinate system of the movable object at time stamp t on the x-axis of the object coordinate system of the movable object at time stamp t-1, m 22 represents the projection component of the y-axis unit vector of the object coordinate system of the movable object at time stamp t on the y-axis of the object coordinate system of the movable object at time stamp t-1, m 23 represents the projection component of the y-axis unit vector of the object coordinate system of the movable object at time stamp t on the z-axis of the object coordinate system of the movable object at time stamp t-1, m 31represents the projection component of the z-axis unit vector of the object coordinate system of the movable object at time stamp t on the x-axis of the object coordinate system of the movable object at time stamp t-1, m 32 represents the projection component of the z-axis unit vector of the object coordinate system of the movable object at time stamp t on the y-axis of the object coordinate system of the movable object at time stamp t-1, m 33 Represents the projection component of the z-axis unit vector of the object coordinate system of the movable object at timestamp t on the z-axis of the object coordinate system of the movable object at timestamp t-1.

[0098] According to the coordinates of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t-1 (x max ,y max , z max ), the coordinates of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t-1 (x min ,y min , z min ), and the rotation matrix Determine the coordinates (x max ′,y max ′,z max ′) and the coordinates of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t (x min ′,y min ′,z min ′).

[0099] Among them, the transformation formula of vertex coordinates is:

[0100] x′=m 11 ·x+m 21 y+m 31 ·z

[0101] y′=m 12 ·x+m 22 y+m 32 ·z

[0102] z′=m 13 ·x+m 23 y+m 33 ·z

[0103] Specifically, the coordinates of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t (x max ′,y max ′,z max '),in:

[0104] x max ′=m 11 ·xmax_11 +m 21 ·y max_21 +m 31 ·z max_31

[0105] y max ′=m 12 ·x max_12 +m 22 ·y max_22 +m 32 ·z max_32

[0106] z max ′=m 13 ·x max_13 +m 23 ·y max_23 +m 33 ·z max_33

[0107] The coordinates of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t (x min ′,y min ′,z min '),in:

[0108] x min ′=m 11 ·x min_11 +m 21 ·y min_21 +m 31 ·z min_31

[0109] y min ′=m 12 ·x min_12 +m 22 ·y min_22 +m 32 ·z min_32

[0110] z min ′=m 13 ·x min_13 +m 23 ·y min_23 +m 33 ·z min_33

[0111] Among them, for x max ′ and x min ′:

[0112] If m 11 >0, then x max_11 =x max , x min_11 =x min ;

[0113] If m 11 <0, then x max_11 =x min , x min_11 =x max ;

[0114] If m 21 >0, then y max_21 =y max ,y min_21 =y min ;

[0115] If m 21 <0, then y max_21 =y min ,y min_21 =y max ;

[0116] If m 31 >0, then z max_31 =z max , z min_31 =z min ;

[0117] If m 31 <0, then z max_31 =z min , z min_31 =z max .

[0118] That is, if in the rotation matrix of the movable object from timestamp t-1 to timestamp t, the projection component m of the x-axis unit vector of the object coordinate system of the movable object at timestamp t on the x-axis of the object coordinate system of the movable object at timestamp t-1 11 If it is greater than 0, the x-axis coordinate component x of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 can be used. max , determine the x-axis coordinate component x of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t max ′, and can be calculated based on the x-axis coordinate component x of the minimum vertex of the axis-aligned bounding box of the movable object at time stamp t-1 min , determine the x-axis coordinate component x of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t min ′;

[0119] If in the rotation matrix of the movable object from timestamp t-1 to timestamp t, the x-axis unit vector of the movable object at timestamp t is the projection component m of the x-axis of the object coordinate system of the movable object at timestamp t-1 11If it is less than 0, the x-axis coordinate component x of the minimum vertex of the axis-aligned bounding box of the movable object at time stamp t-1 can be used. min , determine the x-axis coordinate component x of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t max ′, and can be based on the x-axis coordinate component x of the maximum vertex of the axis-aligned bounding box of the movable object at time stamp t-1 max , determine the x-axis coordinate component x of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t min ′.

[0120] If in the rotation matrix of the movable object from timestamp t-1 to timestamp t, the projection component m of the y-axis unit vector of the object coordinate system of the movable object at timestamp t on the x-axis of the object coordinate system of the movable object at timestamp t-1 21 If it is greater than 0, the y-axis coordinate component y of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 can be used. max , determine the x-axis coordinate component x of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t max ′, and can be based on the y-axis coordinate component y of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 min , determine the x-axis coordinate component x of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t min ′;

[0121] If in the rotation matrix of the movable object from timestamp t-1 to timestamp t, the projection component m of the y-axis unit vector of the object coordinate system of the movable object at timestamp t on the x-axis of the object coordinate system of the movable object at timestamp t-1 21 If it is less than 0, the y-axis coordinate component y of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 can be used. min , determine the x-axis coordinate component x of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t max ′, and can be based on the y-axis coordinate component y of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 max , determine the x-axis coordinate component x of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t min ′.

[0122] If in the rotation matrix of the movable object from timestamp t-1 to timestamp t, the z-axis unit vector of the movable object at timestamp t in the object coordinate system is the projection component m of the x-axis of the movable object at timestamp t-1 in the object coordinate system 31If it is greater than 0, the z-axis coordinate component z of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 can be used. max , determine the x-axis coordinate component x of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t max ′, and can be calculated based on the z-axis coordinate component z of the minimum vertex of the axis-aligned bounding box of the movable object at time stamp t-1 min , determine the x-axis coordinate component x of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t min ′;

[0123] If in the rotation matrix of the movable object from timestamp t-1 to timestamp t, the z-axis unit vector of the movable object at timestamp t in the object coordinate system is the projection component m of the x-axis of the movable object at timestamp t-1 in the object coordinate system 31 If it is less than 0, the z-axis coordinate component z of the minimum vertex of the axis-aligned bounding box of the movable object at time stamp t-1 can be used. min , determine the x-axis coordinate component x of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t max ′, and can be based on the z-axis coordinate component z of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 max , determine the x-axis coordinate component x of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t min ′.

[0124] For y max ′ and y min ′:

[0125] If m 12 >0, then x max_12 =x max , x min_12 =x min ;

[0126] If m 12 <0, then x max_12 =x min , x min_12 =x max ;

[0127] If m 22 >0, then y max_22 =y max ,y min_22 =y min ;

[0128] If m 22 <0, then y max_22 =y min ,y min_22 =ymax ;

[0129] If m 32 >0, then z max_32 =z max , z min_32 =z min ;

[0130] If m 32 <0, then z max_32 =z min , z min_32 =z max .

[0131] That is, if in the rotation matrix of the movable object from timestamp t-1 to timestamp t, the projection component m of the x-axis unit vector of the object coordinate system of the movable object at timestamp t on the y-axis of the object coordinate system of the movable object at timestamp t-1 12 If it is greater than 0, the x-axis coordinate component x of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 can be used. max , determine the y-axis coordinate component y of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t max ′, and can be calculated based on the x-axis coordinate component x of the minimum vertex of the axis-aligned bounding box of the movable object at time stamp t-1 min , determine the y-axis coordinate component y of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t min ′;

[0132] If in the rotation matrix of the movable object from timestamp t-1 to timestamp t, the x-axis unit vector of the movable object at timestamp t in the object coordinate system is the projection component m of the y-axis of the movable object at timestamp t-1 in the object coordinate system 12 If it is less than 0, the x-axis coordinate component x of the minimum vertex of the axis-aligned bounding box of the movable object at time stamp t-1 can be used. min , determine the y-axis coordinate component y of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t max ′, and can be based on the x-axis coordinate component x of the maximum vertex of the axis-aligned bounding box of the movable object at time stamp t-1 max , determine the y-axis coordinate component y of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t min ′.

[0133] If in the rotation matrix of the movable object from timestamp t-1 to timestamp t, the y-axis unit vector of the movable object in the object coordinate system at timestamp t is the projection component m of the y-axis of the movable object in the object coordinate system at timestamp t-1 22If it is greater than 0, the y-axis coordinate component y of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 can be used. max , determine the y-axis coordinate component y of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t max ′, and can be based on the y-axis coordinate component y of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 min , determine the y-axis coordinate component y of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t min ′;

[0134] If in the rotation matrix of the movable object from timestamp t-1 to timestamp t, the y-axis unit vector of the movable object in the object coordinate system at timestamp t is the projection component m of the y-axis of the movable object in the object coordinate system at timestamp t-1 22 If it is less than 0, the y-axis coordinate component y of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 can be used. min , determine the y-axis coordinate component y of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t max ′, and can be based on the y-axis coordinate component y of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 max , determine the y-axis coordinate component y of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t min ′.

[0135] If in the rotation matrix of the movable object from timestamp t-1 to timestamp t, the z-axis unit vector of the movable object in the object coordinate system at timestamp t is the projection component m of the y-axis of the movable object in the object coordinate system at timestamp t-1 32 If it is greater than 0, the z-axis coordinate component z of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 can be used. max , determine the y-axis coordinate component y of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t max ′, and can be calculated based on the z-axis coordinate component z of the minimum vertex of the axis-aligned bounding box of the movable object at time stamp t-1 min , determine the y-axis coordinate component y of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t min ′;

[0136] If in the rotation matrix of the movable object from timestamp t-1 to timestamp t, the z-axis unit vector of the movable object in the object coordinate system at timestamp t is the projection component m of the y-axis of the movable object in the object coordinate system at timestamp t-1 32If it is less than 0, the z-axis coordinate component z of the minimum vertex of the axis-aligned bounding box of the movable object at time stamp t-1 can be used. min , determine the y-axis coordinate component y of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t max ′, and can be based on the z-axis coordinate component z of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 max , determine the y-axis coordinate component y of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t min ′.

[0137] For z max ′ and z min ′:

[0138] If m 13 >0, then x max_13 =x max , x min_13 =x min ;

[0139] If m 13 <0, then x max_13 =x min , x min_13 =x max ;

[0140] Look at m 23 >0, then y max_23 =y max ,y min_23 =y min ;

[0141] If m 23 <0, then y max_23 =y min ,y min_23 =y max ;

[0142] If m 33 >0, then z max_33 =z max , z min_33 =z min ;

[0143] If m 33 <0, then z max_33 =z min , z min_33 =z max .

[0144] That is, if in the rotation matrix of the movable object from timestamp t-1 to timestamp t, the projection component m of the x-axis unit vector of the object coordinate system of the movable object at timestamp t on the z-axis of the object coordinate system of the movable object at timestamp t-1 13 If it is greater than 0, the x-axis coordinate component x of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 can be used. max , determine the z-axis coordinate component z of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t max ′, and can be calculated based on the x-axis coordinate component x of the minimum vertex of the axis-aligned bounding box of the movable object at time stamp t-1 min , determine the z-axis coordinate component z of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t min ′;

[0145] If in the rotation matrix of the movable object from timestamp t-1 to timestamp t, the x-axis unit vector of the movable object at timestamp t in the object coordinate system is the projection component m of the z-axis of the movable object at timestamp t-1 in the object coordinate system 13 If it is less than 0, the x-axis coordinate component x of the minimum vertex of the axis-aligned bounding box of the movable object at time stamp t-1 can be used. min , determine the z-axis coordinate component z of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t max ′, and can be based on the x-axis coordinate component x of the maximum vertex of the axis-aligned bounding box of the movable object at time stamp t-1 max , determine the z-axis coordinate component z of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t min ′.

[0146] If in the rotation matrix of the movable object from timestamp t-1 to timestamp t, the projection component m of the y-axis unit vector of the object coordinate system of the movable object at timestamp t on the z-axis of the object coordinate system of the movable object at timestamp t-1 23 If it is greater than 0, the y-axis coordinate component y of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 can be used. max , determine the z-axis coordinate component z of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t max ′, and can be based on the y-axis coordinate component y of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 min , determine the z-axis coordinate component z of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t min ′;

[0147] If in the rotation matrix of the movable object from timestamp t-1 to timestamp t, the projection component m of the y-axis unit vector of the object coordinate system of the movable object at timestamp t on the z-axis of the object coordinate system of the movable object at timestamp t-1 23 If it is less than 0, the y-axis coordinate component y of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 can be used. min , determine the z-axis coordinate component z of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t max ′, and can be based on the y-axis coordinate component y of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 max , determine the z-axis coordinate component z of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t min ′.

[0148] If in the rotation matrix of the movable object from timestamp t-1 to timestamp t, the z-axis unit vector of the movable object in the object coordinate system at timestamp t is the projection component m of the z-axis of the movable object in the object coordinate system at timestamp t-1 33 If it is greater than 0, the z-axis coordinate component z of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 can be used. max , determine the z-axis coordinate component z of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t max ′, and can be calculated based on the z-axis coordinate component z of the minimum vertex of the axis-aligned bounding box of the movable object at time stamp t-1 min , determine the z-axis coordinate component z of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t min ′;

[0149] If in the rotation matrix of the movable object from timestamp t-1 to timestamp t, the z-axis unit vector of the movable object in the object coordinate system at timestamp t is the projection component m of the z-axis of the movable object in the object coordinate system at timestamp t-1 33 If it is less than 0, the z-axis coordinate component z of the minimum vertex of the axis-aligned bounding box of the movable object at time stamp t-1 can be used. min , determine the z-axis coordinate component z of the largest vertex of the axis-aligned bounding box of the movable object at time stamp t max ′, and can be based on the z-axis coordinate component z of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 max , determine the z-axis coordinate component z of the smallest vertex of the axis-aligned bounding box of the movable object at time stamp t min ′.

[0150] In a possible implementation, for any movable object in a three-dimensional scene, in response to the movable object being translated from timestamp t-1 to timestamp t, a translation matrix of the movable object from timestamp t-1 to timestamp t can be obtained. Based on the translation matrix and the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1, the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t can be determined.

[0151] In this implementation, when the movable object translates from timestamp t-1 to timestamp t, the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 can be multiplied by the translation matrix respectively to obtain the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t.

[0152] In a possible implementation, for any movable object in a three-dimensional scene, in response to the movable object being scaled from timestamp t-1 to timestamp t, a scaling matrix of the movable object from timestamp t-1 to timestamp t can be obtained. Based on the scaling matrix and the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1, the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t can be determined.

[0153] In this implementation, when the movable object is scaled from timestamp t-1 to timestamp t, the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 can be multiplied by the scaling matrix respectively to obtain the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t.

[0154] In a possible implementation, the method further includes: performing collision detection on objects in the three-dimensional scene based on position information of axis-aligned bounding boxes of different objects in the three-dimensional scene at timestamp t; wherein the objects include movable objects, or the objects include movable objects and immovable objects.

[0155] In a 3D scene, collision detection is the process of determining whether two or more objects are touching or overlapping each other in space. This process is critical for many applications, such as game development, physics simulation, virtual reality, etc. In this implementation, collision detection can be applied to different types of objects, including movable objects and immovable objects. Moreover, the results of collision detection can be used in a variety of applications, such as triggering events or calculating physical responses in games, avoiding object penetration in simulation environments, providing user feedback in design software, and so on.

[0156] In this implementation, the axis-aligned bounding box of each object in the three-dimensional scene may be calculated or updated at each time stamp t, and the positions of these axis-aligned bounding boxes may be compared to determine whether any of the axis-aligned bounding boxes collide.

[0157] By adopting the bounding box generation method provided in the embodiment of the present disclosure to update the axis-aligned bounding box of the object in the three-dimensional scene in each frame, collision detection is performed based on the axis-aligned bounding box, which can effectively improve the real-time performance of collision detection.

[0158] As an example of this implementation method, the collision detection of objects in the three-dimensional scene based on the position information of the axis-aligned bounding boxes of different objects in the three-dimensional scene at timestamp t includes: for a first object and a second object in the three-dimensional scene, in response to the axis-aligned bounding box of the first object at timestamp t overlapping with the axis-aligned bounding box of the second object at timestamp t in all the x-axis, y-axis and z-axis directions, determining that the first object and the second object collided at timestamp t; or, for the first object and the second object in the three-dimensional scene, in response to the axis-aligned bounding box of the first object at timestamp t not overlapping with the axis-aligned bounding box of the second object at timestamp t in any one of the x-axis, y-axis and z-axis directions, determining that the first object and the second object did not collide at timestamp t.

[0159] In this example, if the axis-aligned bounding boxes of the two objects overlap in the x-axis, y-axis, and z-axis directions, this means that at least part of the spatial positions of the two objects are touching each other. In this case, it can be determined that the two objects collided at time stamp t. On the contrary, if the axis-aligned bounding boxes of the two objects do not overlap in any coordinate axis direction (that is, the bounding box of one object is completely on one side of the bounding box of the other object in this direction), then the two objects did not collide at time stamp t.

[0160] Specifically, for the first object and the second object, their axis-aligned bounding boxes at timestamp t can be compared:

[0161] Check the x-axis direction: If the x-coordinate range of the axis-aligned bounding box of the first object overlaps with the x-coordinate range of the axis-aligned bounding box of the second object, then continue to check other axes;

[0162] Check the y-axis direction: If the y-coordinate range of the axis-aligned bounding box of the first object overlaps with the y-coordinate range of the axis-aligned bounding box of the second object, then continue to check the z-axis;

[0163] Check the z-axis direction: If the z-coordinate range of the axis-aligned bounding box of the first object overlaps with the z-coordinate range of the axis-aligned bounding box of the second object, then it can be determined that the two objects collided at time stamp t.

[0164] If there is no overlap in any axis, then the two objects did not collide at time stamp t.

[0165] By adopting this implementation, object pairs that may collide can be quickly screened out without performing precise geometric calculations, thereby improving the overall performance.

[0166] The bounding box generation method provided by the embodiments of the present disclosure can be applied to technical fields such as CPU, instruction set, software algorithm, etc., and is not limited here.

[0167] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.

[0168] In addition, the present disclosure also provides a bounding box generation device, an electronic device, a computer-readable storage medium, and a computer program product, all of which can be used to implement any bounding box generation method provided by the present disclosure. The corresponding technical solutions and technical effects can be found in the corresponding records of the method part and will not be repeated here.

[0169] Figure 3 FIG. 2 is a block diagram of a bounding box generating device provided by an embodiment of the present disclosure. Figure 3 As shown, the bounding box generating device includes:

[0170] A first obtaining module 31 is configured to obtain, for any movable object in the three-dimensional scene, a rotation matrix of the movable object from timestamp t-1 to timestamp t in response to the movable object rotating from timestamp t-1 to timestamp t, wherein t is an integer greater than or equal to 1;

[0171] The first determination module 32 is used to determine the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t according to the rotation matrix and the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1; wherein the maximum vertex of the axis-aligned bounding box of the movable object at any timestamp represents the vertex with the largest coordinate value in the axis-aligned bounding box of the movable object at the timestamp; the minimum vertex of the axis-aligned bounding box of the movable object at any timestamp represents the vertex with the smallest coordinate value in the axis-aligned bounding box of the movable object at the timestamp;

[0172] The second determination module 33 is used to determine the position information of the axis-aligned bounding box of the movable object at timestamp t according to the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t.

[0173] In a possible implementation, the first determining module 32 is used to:

[0174] For any coordinate component in the three-dimensional coordinates of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t, determine the x-axis coordinate, y-axis coordinate, and z-axis coordinate that maximize the coordinate component from the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 according to the positive and negative conditions of the three elements corresponding to the coordinate component in the rotation matrix;

[0175] The coordinate component is determined according to the three elements corresponding to the coordinate component in the rotation matrix, and the x-axis coordinate, y-axis coordinate and z-axis coordinate that maximize the coordinate component.

[0176] In a possible implementation, the first determining module 32 is used to:

[0177] For any coordinate component in the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t, determine the x-axis coordinate, y-axis coordinate, and z-axis coordinate that minimize the coordinate component from the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 according to the positive and negative conditions of the three elements corresponding to the coordinate component in the rotation matrix;

[0178] The coordinate component is determined according to the three elements corresponding to the coordinate component in the rotation matrix, and the x-axis coordinate, y-axis coordinate and z-axis coordinate that minimize the coordinate component.

[0179] In a possible implementation manner, the device further includes:

[0180] A second obtaining module is used for obtaining a vertex list of any movable object in response to the first appearance of any movable object in the three-dimensional scene, wherein the vertex list of the movable object includes three-dimensional coordinates of vertices constituting the movable object;

[0181] A first search module, configured to search for a vertex with a maximum coordinate value from a vertex list of the movable object, and obtain an initial value of a three-dimensional coordinate of a maximum vertex of an axis-aligned bounding box of the movable object;

[0182] The second search module is used to search for a vertex with the smallest coordinate value from the vertex list of the movable object, and obtain an initial value of the three-dimensional coordinate of the smallest vertex of the axis-aligned bounding box of the movable object.

[0183] In a possible implementation manner, the device further includes:

[0184] A collision detection module, configured to perform collision detection on objects in the three-dimensional scene according to position information of axis-aligned bounding boxes of different objects in the three-dimensional scene at timestamp t;

[0185] The object includes a movable object, or the object includes a movable object and an immovable object.

[0186] In a possible implementation, the collision detection module is used to:

[0187] For a first object and a second object in the three-dimensional scene, in response to an axis-aligned bounding box of the first object at timestamp t overlapping with an axis-aligned bounding box of the second object at timestamp t in an x-axis direction, a y-axis direction, and a z-axis direction, determining that the first object and the second object collide at timestamp t;

[0188] or,

[0189] For a first object and a second object in the three-dimensional scene, in response to the fact that an axis-aligned bounding box of the first object at timestamp t does not overlap with an axis-aligned bounding box of the second object at timestamp t in any one of the x-axis direction, the y-axis direction, and the z-axis direction, it is determined that the first object and the second object did not collide at timestamp t.

[0190] In a possible implementation, the three-dimensional scene includes a three-dimensional game scene.

[0191] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. Its specific implementation and technical effects can refer to the description of the above method embodiments. For the sake of brevity, they will not be repeated here.

[0192] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions implement the above method when executed by a processor. The computer-readable storage medium may be a non-volatile computer-readable storage medium, or may be a volatile computer-readable storage medium.

[0193] The embodiment of the present disclosure further provides a computer program, including a computer-readable code. When the computer-readable code is executed in an electronic device, a processor in the electronic device executes the above method.

[0194] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in an electronic device, a processor in the electronic device executes the above method.

[0195] An embodiment of the present disclosure also provides an electronic device, comprising: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to call the executable instructions stored in the memory to execute the above method.

[0196] The electronic device may be provided as a terminal, a server, or a device in other forms.

[0197] Figure 4 1 is a block diagram of an electronic device 1900 provided in an embodiment of the present disclosure. For example, the electronic device 1900 may be provided as a server. Figure 4 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0198] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output interface 1958 (I / O interface). The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as a Microsoft Server operating system (Windows Server 2003). TM ), a graphical user interface operating system launched by Apple (MacOS X TM ), a multi-user, multi-process computer operating system (UnixTM ), a free and open source Unix-like operating system (Linux TM ), an open source Unix-like operating system (FreeBSD TM ) or similar.

[0199] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.

[0200] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0201] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0202] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0203] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0204] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0205] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0206] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0207] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0208] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK) and the like.

[0209] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0210] If the technical solution of the embodiments of the present disclosure involves personal information, the product using the technical solution of the embodiments of the present disclosure has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of the embodiments of the present disclosure involves sensitive personal information, the product using the technical solution of the embodiments of the present disclosure has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the requirement of "explicit consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to collect his or her personal information; or on the device for processing personal information, when the personal information processing rules are notified by obvious signs / information, the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.

[0211] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A bounding box generation method, characterized in that: include: For any movable object in the three-dimensional scene, in response to the movable object rotating from timestamp t-1 to timestamp t, obtaining a rotation matrix of the movable object from timestamp t-1 to timestamp t, where t is an integer greater than or equal to 1; According to the rotation matrix, and the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1, the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t are determined; wherein the maximum vertex of the axis-aligned bounding box of the movable object at any timestamp represents the vertex of the movable object with the largest coordinate value in the axis-aligned bounding box of the timestamp; the minimum vertex of the axis-aligned bounding box of the movable object at any timestamp represents the vertex of the movable object with the smallest coordinate value in the axis-aligned bounding box of the timestamp; The position information of the axis-aligned bounding box of the movable object at timestamp t is determined according to the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t.

2. The method according to claim 1, characterized in that Determining the three-dimensional coordinates of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t according to the rotation matrix and the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 comprises: For any coordinate component in the three-dimensional coordinates of the maximum vertex of the axis-aligned bounding box of the movable object at timestamp t, determine the x-axis coordinate, y-axis coordinate, and z-axis coordinate that maximize the coordinate component from the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 according to the positive and negative conditions of the three elements corresponding to the coordinate component in the rotation matrix; The coordinate component is determined according to the three elements corresponding to the coordinate component in the rotation matrix, and the x-axis coordinate, y-axis coordinate and z-axis coordinate that maximize the coordinate component.

3. The method according to claim 1, characterized in that Determining the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t according to the rotation matrix and the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 comprises: For any coordinate component in the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t, determine the x-axis coordinate, y-axis coordinate, and z-axis coordinate that minimize the coordinate component from the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1 according to the positive and negative conditions of the three elements corresponding to the coordinate component in the rotation matrix; The coordinate component is determined according to the three elements corresponding to the coordinate component in the rotation matrix, and the x-axis coordinate, y-axis coordinate and z-axis coordinate that minimize the coordinate component.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: In response to any movable object appearing in the three-dimensional scene for the first time, obtaining a vertex list of the movable object, wherein the vertex list of the movable object includes three-dimensional coordinates of vertices constituting the movable object; Searching for a vertex with the largest coordinate value from the vertex list of the movable object, and obtaining an initial value of the three-dimensional coordinate of the largest vertex of the axis-aligned bounding box of the movable object; From the vertex list of the movable object, find the vertex with the smallest coordinate value, and obtain the initial value of the three-dimensional coordinate of the smallest vertex of the axis-aligned bounding box of the movable object.

5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: performing collision detection on objects in the three-dimensional scene according to position information of axis-aligned bounding boxes of different objects in the three-dimensional scene at timestamp t; The object includes a movable object, or the object includes a movable object and an immovable object.

6. The method according to claim 5, characterized in that The performing collision detection on the objects in the three-dimensional scene according to the position information of the axis-aligned bounding boxes of different objects in the three-dimensional scene at the time stamp t comprises: For a first object and a second object in the three-dimensional scene, in response to an axis-aligned bounding box of the first object at timestamp t overlapping with an axis-aligned bounding box of the second object at timestamp t in an x-axis direction, a y-axis direction, and a z-axis direction, determining that the first object and the second object collide at timestamp t; or, For a first object and a second object in the three-dimensional scene, in response to the fact that an axis-aligned bounding box of the first object at timestamp t does not overlap with an axis-aligned bounding box of the second object at timestamp t in any one of the x-axis direction, the y-axis direction, and the z-axis direction, it is determined that the first object and the second object did not collide at timestamp t.

7. The method according to any one of claims 1 to 3, characterized in that: The three-dimensional scene includes a three-dimensional game scene.

8. A bounding box generating device, characterized in that: include: A first obtaining module is used for obtaining, for any movable object in the three-dimensional scene, a rotation matrix of the movable object from timestamp t-1 to timestamp t in response to the movable object rotating from timestamp t-1 to timestamp t, wherein t is an integer greater than or equal to 1; The first determination module is used to determine the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t according to the rotation matrix and the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t-1; wherein the maximum vertex of the axis-aligned bounding box of the movable object at any timestamp represents the vertex of the movable object with the largest coordinate value in the axis-aligned bounding box of the timestamp; the minimum vertex of the axis-aligned bounding box of the movable object at any timestamp represents the vertex of the movable object with the smallest coordinate value in the axis-aligned bounding box of the timestamp; The second determination module is used to determine the position information of the axis-aligned bounding box of the movable object at timestamp t according to the three-dimensional coordinates of the maximum vertex and the three-dimensional coordinates of the minimum vertex of the axis-aligned bounding box of the movable object at timestamp t.

9. An electronic device, characterized in that: include: one or more processors; a memory for storing executable instructions; The one or more processors are configured to call the executable instructions stored in the memory to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

11. A computer program product comprising computer readable code, or a non-volatile computer readable storage medium carrying computer readable code, characterized in that: When the computer readable code is executed in an electronic device, a processor in the electronic device executes the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Medical vehicle anti-collision detection method, device and system

    CN110806581A

  • Object display method and device, electronic equipment and storage medium

    CN116594531A

  • Image rendering method, related method, device, equipment and storage medium

    CN118537507A

  • Efficiency of ray-box tests

    US20240095996A1

  • World prediction within a game application environment

    US20240325916A1