Display method and device, electronic equipment and computer medium
By constructing an axis-aligned bounding box for an object, obtaining the target bounding box information, and determining the object to be snapped into, the problem of cumbersome calculation of spatial distance between models in digital twin technology is solved, improving computational efficiency and saving resources.
Patent Information
- Application Number
- CN202410589410.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-13
- Publication Date
- 2025-11-14
AI Technical Summary
In digital twin technology, calculating the spatial distance between complex models and other models is cumbersome, inefficient, and consumes a lot of computer resources.
By constructing an axis-aligned bounding box for the object, obtaining information on multiple target bounding boxes, determining the object to be adsorbed, and judging whether to display the adsorption effect based on the target distance information, the calculation process is simplified.
It improves computational efficiency, saves computer resources, and simplifies the calculation process of spatial distance between models.
Smart Images

Figure CN120950226A_ABST
Abstract
Description
Technical Field
[0001] This disclosure belongs to the field of computer technology, and in particular relates to a display method, apparatus, electronic device and computer medium. Background Technology
[0002] Digital twin technology refers to the process of digitally modeling a physical entity to create a corresponding virtual object. Currently, digital twin technology is widely used in various fields, such as integrated circuit design, architectural design, and medical diagnosis. In the 3D scene of a digital twin, it is necessary to calculate the spatial distances between each model and other models within the 3D scene to achieve automatic model snapping. However, in related technologies, calculating the spatial distances between more complex models and other models is cumbersome and inefficient, leading to significant consumption of computer resources. Summary of the Invention
[0003] This disclosure provides an implementation scheme that differs from related technologies, in order to solve the technical problem of low computational efficiency in related technologies, which leads to high consumption of computer resources.
[0004] Firstly, this disclosure provides a display method, including:
[0005] Display a preset scene, which includes multiple objects;
[0006] In response to detecting a movement operation on a first object among the plurality of objects, multiple target bounding box information corresponding to the plurality of objects is obtained, wherein each target bounding box information is used to characterize the parameters of the axis-aligned bounding box corresponding to the object corresponding to the target bounding box information;
[0007] Based on the bounding box information of the multiple targets, the target object corresponding to the first object is determined among the multiple objects;
[0008] Based on the target distance information between the first object and the object to be adsorbed, it is determined whether to display the adsorption effect of adsorbing the first object onto the object to be adsorbed.
[0009] Secondly, this disclosure provides a display device, including:
[0010] The display unit is used to display a preset scene image, which includes multiple objects;
[0011] The acquisition unit is configured to, in response to detecting a movement operation on a first object among the plurality of objects, acquire multiple target bounding box information corresponding to the plurality of objects, wherein each target bounding box information is used to characterize the parameters of the axis-aligned bounding box corresponding to the object corresponding to the target bounding box information;
[0012] The determining unit is used to determine the object to be adsorbed corresponding to the first object among the multiple objects based on the multiple target bounding box information;
[0013] The determining unit is further configured to determine, based on the target distance information between the first object and the object to be adsorbed, whether to display the adsorption effect of adsorbing the first object onto the object to be adsorbed.
[0014] Thirdly, this disclosure provides an electronic device, including:
[0015] Processor; and
[0016] Memory for storing the executable instructions of the processor;
[0017] The processor is configured to execute the first aspect and any of the methods in each possible implementation of the first aspect by executing the executable instructions.
[0018] Fourthly, embodiments of this disclosure provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the first aspect and any of the methods in the possible implementations of the first aspect.
[0019] This disclosure provides a display of a preset scene, which includes multiple objects. In response to detecting a movement operation on a first object among the multiple objects, multiple target bounding box information corresponding to the multiple objects is acquired. Each target bounding box information is used to characterize the parameters of the axis-aligned bounding box corresponding to the object. Based on the multiple target bounding box information, the object to be adsorbed corresponding to the first object is determined among the multiple objects. Based on the target distance information between the first object and the object to be adsorbed, a scheme is determined to determine whether to display the adsorption effect of adsorbing the first object onto the object to be adsorbed. This scheme can construct corresponding axis-aligned bounding boxes for each object in the preset scene, and then calculate the distance between each object based on the axis-aligned bounding boxes, thereby determining whether to display the adsorption effect. This simplifies the calculation process, improves calculation efficiency, and effectively saves computer resources. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments or related technologies of this disclosure, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0021] Figure 1 A schematic flowchart illustrating a demonstration method provided in one embodiment of this disclosure;
[0022] Figure 2 A schematic diagram of a chip model provided for an exemplary embodiment of this disclosure;
[0023] Figure 3 A schematic diagram of a plurality of objects provided for an exemplary embodiment of this disclosure;
[0024] Figure 4 This is a schematic diagram of the structure of a display device provided in an embodiment of the present disclosure;
[0025] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0026] Embodiments of this disclosure are described in detail below, with examples of these embodiments illustrated in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting it.
[0027] The terms "first" and "second," etc., used in the specification, claims, and drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the present disclosure described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0028] First, some terms used in the embodiments of this disclosure will be explained below to facilitate understanding by those skilled in the art.
[0029] Bounding box algorithms are used to find the optimal bounding space for a discrete set of points. The basic idea is to approximate complex geometric objects with a slightly larger but simpler geometric shape (called a bounding box). An axis-aligned bounding box is the smallest hexahedron containing the model with edges parallel to the coordinate axes.
[0030] The three-dimensional Cartesian coordinate system is formed by adding a third dimension (i.e., the Z-axis) to the two-dimensional Cartesian coordinate system according to the right-hand rule.
[0031] Geometric center: describes the central position of an object with a certain degree of symmetry.
[0032] Digital twin technology refers to the process of digitally modeling a physical entity using digital technology to create a corresponding virtual object. Currently, digital twin technology is widely used in various fields, such as integrated circuit design, architectural design, and medical diagnosis. In the 3D scene of a digital twin, it is necessary to calculate the spatial distance between each model and other models within the 3D scene to achieve automatic model snapping. However, in related technologies, calculating the spatial distance between complex models and other models is cumbersome and inefficient, resulting in high consumption of computer resources. Therefore, this disclosure provides a display method, device, electronic device, and computer medium to solve the technical problem of cumbersome and inefficient calculation of spatial distance between complex models and other models, leading to high consumption of computer resources.
[0033] The technical solutions of this disclosure and how they solve the aforementioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this disclosure will now be described with reference to the accompanying drawings.
[0034] Figure 1 This is a flowchart illustrating an exemplary embodiment of the present disclosure, which is applicable to terminal devices such as personal computers, tablets, and smartphones. The method includes at least the following steps S101-S104:
[0035] S101. Display a preset scene screen, wherein the preset scene screen includes multiple objects;
[0036] In some embodiments, the preset scene image can be a three-dimensional scene image, and the preset scene image can include a preset coordinate system. The preset coordinate system can be a three-dimensional Cartesian coordinate system. The preset coordinate system can include three direction axes: the horizontal axis (x-axis), the vertical axis (y-axis), and the z-axis.
[0037] In some embodiments, the preset scene screen can be a display screen used in software for integrated circuit design, architectural design, medical diagnosis, etc., in related technologies. The software can be installed on terminal devices such as personal computers, tablets, and smartphones, allowing users to perform operations such as integrated circuit design, architectural design, and medical diagnosis through the display screen provided by the software. Each object included in the preset scene screen can be a design object in the corresponding software; for example, the object can be a chip model, a building model, etc.
[0038] Figure 2 A schematic diagram of a chip model provided for an exemplary embodiment of this disclosure, such as... Figure 2 As shown, when the object is a chip model, the object may include: chip devices and chip pins, wherein the chip pins may be spherical in shape.
[0039] S102. In response to detecting a movement operation on a first object among the plurality of objects, obtain multiple target bounding box information corresponding to the plurality of objects, wherein each target bounding box information in the multiple target bounding box information is used to characterize the parameters of the axis-aligned bounding box corresponding to the object corresponding to the target bounding box information;
[0040] In some embodiments, the first object is any one of a plurality of objects. Users can click and drag the first object in a preset display screen using a touchscreen, mouse, stylus, or other means to trigger a movement operation on the first object among the plurality of objects.
[0041] In some embodiments, the object and the target bounding box information correspond one-to-one. The target bounding box information can be the parameters of the current axis alignment bounding box of the object corresponding to the target bounding box information.
[0042] In some embodiments, in addition to the parameters of the current axis-aligned bounding box of the object corresponding to the target bounding box information described above, each object may also have initial axis-aligned bounding box parameters, i.e., initial bounding box information, before detecting a movement operation for the first object among the plurality of objects. Before detecting a movement operation for the first object among the plurality of objects, the method further includes S01-S02:
[0043] S01. For each object, obtain the position information corresponding to the object, the position information including multiple coordinate information of the object in the preset coordinate system;
[0044] In some embodiments, the plurality of coordinate information refers to the coordinate information of a plurality of coordinate points occupied by the object in the preset coordinate system.
[0045] In some embodiments, when the object is a chip model, the plurality of coordinate information may include: coordinate information of the center point of the chip device and size information of the chip device (such as the length, width and height of the chip device and the radius and / or diameter of the chip pins).
[0046] S02. Determine the initial bounding box information corresponding to the object based on the multiple coordinate information.
[0047] In some embodiments, the initial bounding box information is used to characterize the parameters of the initial axis-aligned bounding box corresponding to the object. Specifically, the initial bounding box information may include maximum vertex coordinate information and minimum vertex coordinate information. The maximum vertex coordinate information represents the coordinates of the outermost vertex of the axis-aligned bounding box, and the minimum vertex coordinate information represents the coordinates of the inner vertex of the axis-aligned bounding box. In a three-dimensional Cartesian coordinate system, the outer side can refer to the side opposite to the spatial region where the origin of the coordinate system is located; the inner side can refer to the side of the spatial region where the origin of the coordinate system is located.
[0048] In some embodiments, in S02, the initial bounding box information corresponding to the object is determined based on the plurality of coordinate information, including S021-S022:
[0049] S021. Based on the multiple coordinate information, determine the minimum vertex coordinate information and the maximum vertex coordinate information of the object in the preset coordinate system. The minimum vertex coordinate information and the maximum vertex coordinate information are used to indicate the boundary position of the object on the multiple direction axes included in the preset coordinate system.
[0050] In some embodiments, in S021, determining the minimum vertex coordinate information and the maximum vertex coordinate information of the object in the preset coordinate system based on the plurality of coordinate information includes:
[0051] Obtain the first preset coordinate variable point_min = (x_min, y_min, z_min) = (infinite, infinite, infinite) and the second preset coordinate variable point_max = (x_max, y_max, z_max) = (-infinite, -infinite, -infinite). The initial value of the first preset coordinate variable is infinite, and the initial value of the second preset coordinate variable is infinitesimal.
[0052] Traverse each coordinate information among the multiple coordinate information, and update the first preset coordinate variable and the second preset variable. Specifically, the multiple coordinate information is the coordinate information of multiple coordinate points occupied by the object in the preset coordinate system; traversing the multiple coordinate information means accessing and processing each coordinate point occupied by the object one by one, so as to update the first preset coordinate variable and the second preset variable based on the coordinate information of each coordinate point. Assume that each coordinate information is represented as (x, y, z); for each coordinate information, if x < x_min, then update x_min = x; if y < y_min, then update y_min = y; if z < z_min, then update z_min = z; if x > x_max, then update x_max = x; if y > y_max, then update y_max = y; if z > z_max, then update z_max = z;
[0053] In response to traversing the multiple coordinate information, obtain the updated minimum vertex coordinate information corresponding to the first preset coordinate variable, and the updated maximum vertex coordinate information corresponding to the second preset coordinate variable.
[0054] S022. Use the minimum vertex coordinate information and the maximum vertex coordinate information as the initial bounding box information corresponding to the object.
[0055] Specifically, the initial bounding box information can be expressed as: {x_min, y_min, z_min, x_max, y_max, z_max}, where x_min is the x-axis coordinate of the lowest point of the initial axis-aligned bounding box, y_min is the y-axis coordinate of the lowest point of the initial axis-aligned bounding box, and z_min is the z-axis coordinate of the lowest point of the initial axis-aligned bounding box; x_max is the x-axis coordinate of the highest point of the initial axis-aligned bounding box, y_max is the y-axis coordinate of the highest point of the initial axis-aligned bounding box, and z_max is the z-axis coordinate of the highest point of the initial axis-aligned bounding box.
[0056] Among them, the axis-aligned bounding box is applicable to various types of objects, including three-dimensional objects and complex models, and the construction process of the axis-aligned bounding box is simple, which can effectively improve the data calculation efficiency and save computer resources.
[0057] In some optional embodiments provided by the present disclosure, in S102, obtaining the multiple target bounding box information corresponding to the multiple objects includes S1021 - S1022:
[0058] S1021. For each object among the multiple objects, obtain the initial bounding box information corresponding to the object, and the movement information for the object;
[0059] In some embodiments, the movement information of the object can represent the position change and motion state of the object in a preset coordinate system. Specifically, the movement information of the object can include: the displacement of the object along each of the three directional axes, specifically expressed as (Δx, Δy, Δz), where Δx represents the displacement of the object along the x-axis, Δy represents the displacement of the object along the y-axis, and Δz represents the displacement of the object along the z-axis.
[0060] Optionally, a mouse drag event listener can be bound to each object in the preset scene to obtain movement information of the object corresponding to the mouse drag event listener.
[0061] S1022. Based on the movement information, the initial bounding box information is adjusted to obtain the adjusted target bounding box information corresponding to the object, and then the multiple target bounding box information corresponding to the multiple objects is obtained.
[0062] In some embodiments, in S1022, adjusting the initial bounding box information based on the movement information includes:
[0063] Obtain the minimum vertex coordinates and the maximum vertex coordinates included in the initial bounding box information;
[0064] The sum of the movement information and the minimum vertex coordinate information is used as the adjusted minimum vertex coordinate information;
[0065] The sum of the movement information and the maximum vertex coordinate information is taken as the adjusted maximum vertex coordinate information;
[0066] The adjusted minimum vertex coordinates and the adjusted maximum vertex coordinates are used as the adjusted target bounding box information corresponding to the object.
[0067] S103. Based on the multiple target bounding box information, determine the object to be adsorbed corresponding to the first object among the multiple objects;
[0068] In some optional embodiments provided in this disclosure, in S103, based on the plurality of target bounding box information, the target object corresponding to the first object is determined among the plurality of objects, including S1031-S1033:
[0069] S1031. Based on the multiple target bounding box information, at least one second object corresponding to the first object is determined among the multiple objects, and the second object overlaps with the first object on a preset direction axis.
[0070] In some embodiments, the preset direction axis can be any one of the horizontal axis (x-axis), the vertical axis (y-axis), and the z-axis.
[0071] In some embodiments, when the preset direction axis is the x-axis, for each of the multiple objects, if the projection range of the lowest point x1_min and the highest point x1_max in the first target bounding box information corresponding to the first object on the x-axis coincides with the projection range of the lowest point x0_min and the highest point x0_max in the target bounding box information corresponding to the object on the x-axis, then the object is determined to be the second object. When the preset direction axis is the y-axis, for each of the multiple objects, if the projection range of the lowest point y1_min and the highest point y1_max in the first target bounding box information corresponding to the first object on the y-axis coincides with the projection range of the lowest point y0_min and the highest point y0_max in the target bounding box information corresponding to the object on the y-axis, then the object is determined to be the second object. When the preset direction axis is the z-axis, for each of the multiple objects, if the projection range of the lowest point z1_min and the highest point z1_max in the first target bounding box information corresponding to the first object on the z-axis overlaps with the projection range of the lowest point z0_min and the highest point z0_max in the target bounding box information corresponding to the object on the z-axis, then the object is determined to be the second object.
[0072] Figure 3 A schematic diagram of a plurality of objects provided for an exemplary embodiment of this disclosure, such as Figure 3 As shown, the preset scene screen may include object A, object B and object C. After detecting a movement operation on object A (the first object) among the multiple objects, multiple target bounding box information corresponding to the multiple objects can be obtained. Then, based on the multiple target bounding box information, at least one second object that overlaps with object A on a preset direction axis can be identified as object B among the multiple objects.
[0073] S1032. Obtain the first target bounding box information corresponding to the first object and the at least one second target bounding box information corresponding to the at least one second object from the plurality of target bounding box information;
[0074] In some embodiments, the first target bounding box information is used to characterize the parameters of the first axis-aligned bounding box corresponding to the first object corresponding to the first target bounding box information, and can be represented as {x1_min, y1_min, z1_min, x1_max, y1_max, z1_max}; the second target bounding box information is used to characterize the parameters of the second axis-aligned bounding box corresponding to the second object corresponding to the second target bounding box information, and can be represented as {x2_min, y2_min, z2_min, x2_max, y2_max, z2_max}.
[0075] S1033. Based on the first target bounding box information and the at least one second target bounding box information, determine the object to be adsorbed corresponding to the first object in the at least one second object.
[0076] In some embodiments, in S1033, the object to be adsorbed corresponding to the first object is determined in the at least one second object based on the first target bounding box information and the at least one second target bounding box information, including S31-S34:
[0077] S31. Obtain the first maximum vertex information and the first minimum vertex information contained in the first target bounding box information, and obtain at least one second maximum vertex information and at least one second minimum vertex information contained in the at least one second target bounding box information;
[0078] S32. Based on the first maximum vertex information, the first minimum vertex information, the at least one second maximum vertex information, and the at least one second minimum vertex information, determine the number of third objects in the at least one second object whose corresponding second axis-aligned bounding box overlaps with the first axis-aligned bounding box of the first object.
[0079] In some embodiments, the third object is included in the at least one second object, and the method further includes, regarding the determination of the third object:
[0080] For each of the at least one second object, based on the second maximum vertex information and the second minimum vertex information corresponding to the second object, as well as the first maximum vertex information and the first minimum vertex information, it is determined whether the projections of the second axis-aligned target bounding box corresponding to the second object and the first axis-aligned bounding box corresponding to the first object on each of the multiple direction axes (x-axis, y-axis, z-axis) intersect. If the projections of the second axis-aligned bounding box and the first axis-aligned bounding box intersect for each direction axis, it is determined that the second axis-aligned bounding box and the first axis-aligned bounding box corresponding to the first object have an overlapping area, and then the second object corresponding to the second axis-aligned bounding box is determined as the third object.
[0081] Specifically, for each direction axis, if the direction axis coordinates (x1_min / y1_min / z1_min) of the lowest point of the first axis-aligned bounding box are less than the direction axis coordinates (x2_max / y2_max / z2_max) of the highest point of the second axis-aligned bounding box, and the direction axis coordinates (x1_max / y1_max / z1_max) of the highest point of the first axis-aligned bounding box are greater than the direction axis coordinates (x2_min / y2_min / z2_min) of the lowest point of the second axis-aligned bounding box, then it is determined that the second axis-aligned bounding box and the first axis-aligned bounding box are aligned on that direction axis. The projections of the second and first axis-aligned bounding boxes intersect on that direction axis. If the direction axis coordinates (x2_min / y2_min / z2_min) of the lowest point of the second axis-aligned bounding box are less than the direction axis coordinates (x1_max / y1_max / z1_max) of the highest point of the first axis-aligned bounding box, and the direction axis coordinates (x2_max / y2_max / z2_max) of the highest point of the second axis-aligned bounding box are greater than the direction axis coordinates (x1_min / y1_min / z1_min) of the lowest point of the first axis-aligned bounding box, then the projections of the second and first axis-aligned bounding boxes intersect on that direction axis.
[0082] S33. When the number of the third object is 1, the unique third object is determined as the object to be adsorbed corresponding to the first object;
[0083] S34. When the number of the third objects is greater than 1, the object to be adsorbed corresponding to the first object is determined from the multiple third objects based on the multiple third minimum vertex information and multiple third maximum vertex information corresponding to the multiple third objects.
[0084] In some embodiments, a first distance can be calculated between the third axis-aligned bounding box and the first axis-aligned bounding box corresponding to each of the plurality of third objects, thereby obtaining a plurality of first distances corresponding to the plurality of third objects, and the third object with the shortest first distance among the plurality of third objects is determined as the object to be attracted corresponding to the first object. The first distance is the minimum distance between the third axis-aligned bounding box and the first axis-aligned bounding box.
[0085] In some embodiments, regarding the determination of the first distance corresponding to each third object, the method further includes S341-S343:
[0086] S341. For each third object, calculate the first reference distance on a preset direction axis between the third axis-aligned bounding box and the first axis-aligned bounding box of the third object and the first axis-aligned bounding box of the first object, based on the third minimum vertex information corresponding to the third object and the first maximum vertex information corresponding to the first object.
[0087] Specifically, the first reference distance can be the absolute value of the difference between the direction axis coordinates (x3_min / y3_min / z3_min) of the lowest point of the third axis-aligned bounding box and the direction axis coordinates (x1_max / y1_max / z1_max) of the highest point of the first axis-aligned bounding box.
[0088] S342. Based on the third maximum vertex information corresponding to the third object and the first minimum vertex information corresponding to the first object, calculate the second reference distance between the third axis-aligned bounding box and the first axis-aligned bounding box on a preset direction axis.
[0089] Specifically, the second reference distance can be the absolute value of the difference between the direction axis coordinates (x3_max / y3_max / z3_max) of the highest point of the third axis-aligned bounding box and the direction axis coordinates (x1_min / y1_min / z1_min) of the lowest point of the first axis-aligned bounding box.
[0090] S343. The smallest reference distance between the first reference distance and the second reference distance is taken as the first distance corresponding to the third object.
[0091] S35. When the number of the third object is 0, the object to be adsorbed corresponding to the first object is determined from the at least one second object based on the information of multiple second minimum vertices and multiple second maximum vertices corresponding to at least one second object.
[0092] In some embodiments, in S35, determining the object to be attracted from the at least one second object based on multiple second minimum vertex information and multiple second maximum vertex information corresponding to at least one second object includes:
[0093] Calculate the second distance between the second axis-aligned bounding box and the first axis-aligned bounding box corresponding to each of the at least one second object, thereby obtaining multiple second distances corresponding to the at least one second object, and determine the second object with the shortest second distance among the at least one second objects as the object to be attracted corresponding to the first object. The second distance is the minimum distance between the third axis-aligned bounding box and the first axis-aligned bounding box.
[0094] In some embodiments, the method further includes S351-S353 for determining the second distance corresponding to each second object:
[0095] S351. For each of the second objects, calculate the third reference distance on a preset direction axis between the second axis-aligned bounding box and the first axis-aligned bounding box corresponding to the second object and the first axis-aligned bounding box corresponding to the first object, based on the second minimum vertex information corresponding to the second object and the first maximum vertex information corresponding to the first object.
[0096] Specifically, the third reference distance can be the absolute value of the difference between the direction axis coordinates (x2_min / y2_min / z2_min) of the lowest point of the second axis-aligned bounding box and the direction axis coordinates (x1_max / y1_max / z1_max) of the highest point of the first axis-aligned bounding box.
[0097] S352. Based on the second maximum vertex information corresponding to the second object and the first minimum vertex information corresponding to the first object, calculate the fourth reference distance between the second axis-aligned bounding box and the first axis-aligned bounding box on a preset direction axis.
[0098] Specifically, the fourth reference distance can be the absolute value of the difference between the direction axis coordinates (x2_max / y2_max / z2_max) of the highest point of the second axis-aligned bounding box and the direction axis coordinates (x1_min / y1_min / z1_min) of the lowest point of the first axis-aligned bounding box.
[0099] S353. The smallest reference distance among the third reference distance and the fourth reference distance is taken as the second distance corresponding to the second object.
[0100] S104. Based on the target distance information between the first object and the object to be adsorbed, determine whether to display the adsorption effect of adsorbing the first object onto the object to be adsorbed.
[0101] In some embodiments, when the first axis-aligned bounding box corresponding to the first object and the axis-aligned bounding box corresponding to the object to be adsorbed have overlapping areas, the target distance information between the first object and the object to be adsorbed indicates the minimum distance between the axis-aligned bounding box corresponding to the object to be adsorbed and the first axis-aligned bounding box (i.e., the first distance or the second distance mentioned above). The specific determination method can be found in S341-S343 or S351-S353 mentioned above, which will not be repeated here.
[0102] In some optional embodiments provided in this disclosure, in S104, based on the target distance information between the first object and the object to be adsorbed, it is determined whether to display the adsorption effect of adsorbing the first object onto the object to be adsorbed, including S1041-S1042:
[0103] S1041. When the target distance information between the first object and the object to be adsorbed is less than a preset threshold, determine to display the adsorption effect of adsorbing the first object onto the object to be adsorbed.
[0104] In some embodiments, the preset threshold can be set according to actual conditions; for example, the preset threshold can be 5.
[0105] In some embodiments, the adsorption effect is that the dragged object (i.e., the first object) will autonomously move a certain distance toward the object to be adsorbed to achieve a display effect of being in close contact with the object to be adsorbed. The adsorption direction of the first object adsorbing onto the object to be adsorbed can be along the aforementioned preset direction axis, or in the opposite direction to the aforementioned preset direction axis.
[0106] S1042. When the target distance information between the first object and the object to be adsorbed is not less than the preset threshold, it is determined not to display the adsorption effect of adsorbing the first object onto the object to be adsorbed.
[0107] In other embodiments, even if the first object and the object to be adsorbed do not overlap in any axial direction, if the distance between the first object and the object to be adsorbed (the vector sum of distances in all axial directions) is less than a preset distance, the adsorption effect of adsorbing the first object onto the object to be adsorbed can be demonstrated, wherein the adsorption direction can be the vector sum required to move in each axial direction.
[0108] This disclosure provides a display of a preset scene, which includes multiple objects. In response to detecting a movement operation on a first object among the multiple objects, multiple target bounding box information corresponding to the multiple objects is acquired. Each target bounding box information is used to characterize the parameters of the axis-aligned bounding box corresponding to the object. Based on the multiple target bounding box information, the object to be adsorbed corresponding to the first object is determined among the multiple objects. Based on the target distance information between the first object and the object to be adsorbed, a scheme is determined to determine whether to display the adsorption effect of adsorbing the first object onto the object to be adsorbed. This scheme can construct corresponding axis-aligned bounding boxes for each object in the preset scene, and then calculate the distance between each object based on the axis-aligned bounding boxes, thereby determining whether to display the adsorption effect. This simplifies the calculation process, improves calculation efficiency, and effectively saves computer resources.
[0109] Figure 4 A schematic diagram of the structure of a display device provided for an exemplary embodiment of this disclosure;
[0110] The device includes:
[0111] Display unit 401 is used to display a preset scene screen, which includes multiple objects;
[0112] The acquisition unit 402 is configured to, in response to detecting a movement operation on a first object among the plurality of objects, acquire multiple target bounding box information corresponding to the plurality of objects, wherein each target bounding box information is used to characterize the parameters of the axis-aligned bounding box corresponding to the object corresponding to the target bounding box information;
[0113] The determining unit 403 is used to determine the object to be adsorbed corresponding to the first object among the multiple objects based on the multiple target bounding box information;
[0114] The determining unit is further configured to determine, based on the target distance information between the first object and the object to be adsorbed, whether to display the adsorption effect of adsorbing the first object onto the object to be adsorbed.
[0115] In some optional embodiments provided in this disclosure, the acquisition unit 402, when acquiring multiple target bounding box information corresponding to the multiple objects, is specifically used for:
[0116] For each of the plurality of objects, obtain the initial bounding box information corresponding to the object, as well as the movement information of the object;
[0117] Based on the movement information, the initial bounding box information is adjusted to obtain the adjusted target bounding box information corresponding to the object, and then the multiple target bounding box information corresponding to the multiple objects is obtained.
[0118] In some optional embodiments provided in this disclosure, the preset scene screen includes a preset coordinate system, and before detecting a movement operation on a first object among the plurality of objects, the device further includes:
[0119] For each of the objects, obtain the corresponding position information of the object, the position information including multiple coordinates of the object in the preset coordinate system;
[0120] Based on the multiple coordinate information, the initial bounding box information corresponding to the object is determined.
[0121] In some optional embodiments provided in this disclosure, when the determining unit 403 is used to determine the initial bounding box information corresponding to the object based on the plurality of coordinate information, it is specifically used for:
[0122] Based on the multiple coordinate information, the minimum vertex coordinate information and the maximum vertex coordinate information of the object in the preset coordinate system are determined. The minimum vertex coordinate information and the maximum vertex coordinate information are used to indicate the boundary position of the object on the multiple direction axes included in the preset coordinate system.
[0123] The minimum vertex coordinates and the maximum vertex coordinates are used as the initial bounding box information corresponding to the object.
[0124] In some optional embodiments provided in this disclosure, when the determining unit 403 determines the object to be adsorbed corresponding to the first object among the plurality of objects based on the plurality of target bounding box information, it is specifically used for:
[0125] Based on the bounding box information of the multiple targets, at least one second object corresponding to the first object is determined among the multiple objects, and the second object overlaps with the first object on a preset direction axis.
[0126] From the plurality of target bounding box information, obtain the first target bounding box information corresponding to the first object and the at least one second target bounding box information corresponding to the at least one second object;
[0127] Based on the first target bounding box information and the at least one second target bounding box information, the target object corresponding to the first object is determined in the at least one second object.
[0128] In some optional embodiments provided in this disclosure, when determining the object to be adsorbed in the at least one second object based on the first target bounding box information and the at least one second target bounding box information, the determining unit 403 is specifically used for:
[0129] Obtain the first maximum vertex information and the first minimum vertex information contained in the first target bounding box information, and obtain at least one second maximum vertex information and at least one second minimum vertex information contained in the at least one second target bounding box information;
[0130] Based on the first maximum vertex information, the first minimum vertex information, the at least one second maximum vertex information, and the at least one second minimum vertex information, determine the number of third objects in the at least one second object whose corresponding second axis-aligned bounding box overlaps with the first axis-aligned bounding box of the first object;
[0131] When the number of the third object is 1, the unique third object is determined as the object to be adsorbed corresponding to the first object;
[0132] When the number of the third objects is greater than 1, the object to be adsorbed corresponding to the first object is determined from the multiple third objects based on the multiple third minimum vertex information and multiple third maximum vertex information corresponding to the multiple third objects.
[0133] In some optional embodiments provided in this disclosure, when the determining unit 403 determines whether to display the adsorption effect of adsorbing the first object onto the object to be adsorbed based on the target distance information between the first object and the object to be adsorbed, it is specifically used for:
[0134] When the target distance between the first object and the object to be adsorbed is less than a preset threshold, it is determined to display the adsorption effect of adsorbing the first object onto the object to be adsorbed.
[0135] When the target distance between the first object and the object to be adsorbed is not less than the preset threshold, it is determined that the adsorption effect of adsorbing the first object onto the object to be adsorbed will not be displayed.
[0136] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, they will not be repeated here. Specifically, the device can execute the above method embodiments, and the foregoing and other operations and / or functions of each module in the device correspond to the corresponding processes in the various methods in the above method embodiments, which will not be repeated here for the sake of brevity.
[0137] The apparatus of this disclosure embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this disclosure can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this disclosure embodiment can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.
[0138] Figure 5 This is a schematic block diagram of an electronic device provided in an embodiment of this disclosure. The electronic device may include:
[0139] The system includes a memory 701 and a processor 702. The memory 701 stores computer programs and transfers the program code to the processor 702. In other words, the processor 702 can retrieve and run the computer programs from the memory 701 to implement the methods described in this embodiment.
[0140] For example, the processor 702 can be used to execute the above-described method embodiments according to instructions in the computer program.
[0141] In some embodiments of this disclosure, the processor 702 may include, but is not limited to:
[0142] General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0143] In some embodiments of this disclosure, the memory 701 includes, but is not limited to:
[0144] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0145] In some embodiments of this disclosure, the computer program may be divided into one or more modules, which are stored in the memory 701 and executed by the processor 702 to perform the method provided in this disclosure. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device.
[0146] like Figure 5 As shown, the electronic device may also include:
[0147] Transceiver 703, which can be connected to processor 702 or memory 701.
[0148] The processor 702 can control the transceiver 703 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. The transceiver 703 may include a transmitter and a receiver. The transceiver 703 may further include antennas, and the number of antennas may be one or more.
[0149] It should be understood that the various components in the electronic device are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.
[0150] This disclosure also provides a computer storage medium storing a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments. Alternatively, embodiments of this disclosure also provide a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.
[0151] When implemented using software, it can be implemented wholly or partially as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this disclosure are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0152] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0153] In the embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0154] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. For example, the functional modules in the various embodiments of this disclosure may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0155] The above are merely specific embodiments of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.
Claims
1. A display method, characterized in that, include: Display a preset scene, which includes multiple objects; In response to detecting a movement operation on a first object among the plurality of objects, multiple target bounding box information corresponding to the plurality of objects is obtained, wherein each target bounding box information is used to characterize the parameters of the axis-aligned bounding box corresponding to the object corresponding to the target bounding box information; Based on the bounding box information of the multiple targets, the target object corresponding to the first object is determined among the multiple objects; Based on the target distance information between the first object and the object to be adsorbed, it is determined whether to display the adsorption effect of adsorbing the first object onto the object to be adsorbed.
2. The method according to claim 1, characterized in that, Obtaining multiple target bounding box information corresponding to the multiple objects includes: For each of the plurality of objects, obtain the initial bounding box information corresponding to the object, as well as the movement information of the object; Based on the movement information, the initial bounding box information is adjusted to obtain the adjusted target bounding box information corresponding to the object, and then the multiple target bounding box information corresponding to the multiple objects is obtained.
3. The method according to claim 2, characterized in that, The preset scene includes a preset coordinate system. Before detecting a movement operation on the first object among the plurality of objects, the method further includes: For each of the objects, obtain the corresponding position information of the object, the position information including multiple coordinates of the object in the preset coordinate system; Based on the multiple coordinate information, the initial bounding box information corresponding to the object is determined.
4. The method according to claim 3, characterized in that, Based on the multiple coordinate information, the initial bounding box information corresponding to the object is determined, including: Based on the multiple coordinate information, the minimum vertex coordinate information and the maximum vertex coordinate information of the object in the preset coordinate system are determined. The minimum vertex coordinate information and the maximum vertex coordinate information are used to indicate the boundary position of the object on the multiple direction axes included in the preset coordinate system. The minimum vertex coordinates and the maximum vertex coordinates are used as the initial bounding box information corresponding to the object.
5. The method according to claim 1, characterized in that, Based on the bounding box information of the multiple targets, the target object corresponding to the first object is determined from among the multiple objects, including: Based on the bounding box information of the multiple targets, at least one second object corresponding to the first object is determined among the multiple objects, and the second object overlaps with the first object on a preset direction axis. From the plurality of target bounding box information, obtain the first target bounding box information corresponding to the first object and the at least one second target bounding box information corresponding to the at least one second object; Based on the first target bounding box information and the at least one second target bounding box information, the target object corresponding to the first object is determined in the at least one second object.
6. The method according to claim 5, characterized in that, Based on the first target bounding box information and the at least one second target bounding box information, the target object corresponding to the first object is determined in the at least one second object, including: Obtain the first maximum vertex information and the first minimum vertex information contained in the first target bounding box information, and obtain at least one second maximum vertex information and at least one second minimum vertex information contained in the at least one second target bounding box information; Based on the first maximum vertex information, the first minimum vertex information, the at least one second maximum vertex information, and the at least one second minimum vertex information, determine the number of third objects in the at least one second object whose corresponding second axis-aligned bounding box overlaps with the first axis-aligned bounding box of the first object; When the number of the third object is 1, the unique third object is determined as the object to be adsorbed corresponding to the first object; When the number of the third objects is greater than 1, the object to be adsorbed corresponding to the first object is determined from the multiple third objects based on the multiple third minimum vertex information and multiple third maximum vertex information corresponding to the multiple third objects.
7. The method according to claim 1, characterized in that, Based on the target distance information between the first object and the object to be adsorbed, determining whether to display the adsorption effect of adsorbing the first object onto the object to be adsorbed includes: When the target distance between the first object and the object to be adsorbed is less than a preset threshold, it is determined to display the adsorption effect of adsorbing the first object onto the object to be adsorbed. When the target distance between the first object and the object to be adsorbed is not less than the preset threshold, it is determined that the adsorption effect of adsorbing the first object onto the object to be adsorbed will not be displayed.
8. A display device, characterized in that, include: The display unit is used to display a preset scene image, which includes multiple objects; The acquisition unit is configured to, in response to detecting a movement operation on a first object among the plurality of objects, acquire multiple target bounding box information corresponding to the plurality of objects, wherein each target bounding box information is used to characterize the parameters of the axis-aligned bounding box corresponding to the object corresponding to the target bounding box information; The determining unit is used to determine the object to be adsorbed corresponding to the first object among the multiple objects based on the multiple target bounding box information; The determining unit is further configured to determine, based on the target distance information between the first object and the object to be adsorbed, whether to display the adsorption effect of adsorbing the first object onto the object to be adsorbed.
9. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1-7 by executing the executable instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-7.
Citation Information
Cited By
Layout determination method, device and equipment of soft package object, medium and program product
CN121657901A