Method, System, Electronic Device, and Storage Medium for Presenting an Object at the Center of a Screen

By building a package box in a three-dimensional scene and transforming it, the problem of object presenting deviations in the center of the screen is solved, and the accurate projection of object at the center of the screen is achieved.

CN115359164BActive Publication Date: 2025-07-22HARBIN ANTIY TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210979549.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-16
Publication Date
2025-07-22
Estimated Expiration
2042-08-16

AI Technical Summary

Technical Problem

In the prior art, there is a deviation in the presentation of the object at the center of the screen, resulting in the final effect deviating from the center of the screen.

Method used

The first package box is constructed in a three-dimensional scene, converting the object into a particle swarm, and performing reverse transformation around the center point, computing the camera position to project to the center of the screen.

Benefits of technology

Through reverse and forward transformation, ensure that the object is accurately presented in the center of the screen, and the viewpoint and focus calculation are simple and efficient.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115359164B_ABST
    Figure CN115359164B_ABST
Patent Text Reader

Abstract

The method, system, electronic device, and storage medium for presenting an object at the center of a screen disclosed in the embodiments of the present invention relate to the technical field of page rendering. The method includes: constructing a first bounding box in a three-dimensional scene; performing an inverse transformation on the first bounding box around a first center point to obtain a second bounding box; calculating a set position of a camera in the three-dimensional scene according to the center point of the second bounding box and camera parameters; performing a forward transformation on the center point of the second bounding box and the set position of the camera around the first center point to obtain a target view point and a target focus of the camera; wherein, the view point is used to represent the set position of the camera in the three-dimensional scene. The present invention facilitates presenting an object at the center position of the screen and is applicable to scenarios such as Web development, user interface development, game development, and other application interface rendering scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of page rendering, and in particular, to a method, a system, an electronic device, and a storage medium for presenting an object at the center of a screen. Background Art

[0002] The rendering of three-dimensional scenes is an important implementation method for presenting three-dimensional visualization effects in many fields such as Web development and game development. In related technologies, when presenting a known object at the center position of the screen, a relatively common solution is to wrap the object in a sphere, as Figure 1 shown; then, perform simulation calculations according to the radius of the sphere to obtain the position where the sphere (referring to the object) is presented on the screen.

[0003] However, the inventors of the present application found in the process of implementing the present invention: Since most objects cannot fit well with their wrapped spheres, there is a deviation between the centers of the obtained sphere and the object positions on the screen, as Figure 1 shown in the effect, resulting in the final effect presented on the screen also deviating from the center of the screen. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a method, a system, an electronic device, and a storage medium for presenting an object at the center of a screen, which are convenient for presenting the object at the center position of the screen.

[0005] To achieve the above invention purpose, the following technical solutions are adopted:

[0006] In a first aspect, an embodiment of the present invention provides a method for presenting an object at the center of a screen. The method includes the steps of: constructing a first bounding box in a three-dimensional scene according to a user trigger instruction; the first bounding box is used to hold a particle swarm formed by an object to be presented; performing an inverse transformation on the first bounding box around a first center point to obtain a second bounding box; the first center point is the center point of the first bounding box; calculating a set position of a camera in the three-dimensional scene according to the center point of the second bounding box and camera parameters; the camera is a virtual camera tool; performing a forward transformation on the center point of the second bounding box and the set position of the camera around the first center point to obtain a target view point and a target focus of the camera; where the view point is used to represent the set position of the camera in the three-dimensional scene; projecting the object to be presented to the center position of the screen for presentation according to the target view point and the target focus of the camera.

[0007] Optionally, constructing the first bounding box in the three-dimensional scene includes: converting the object to be presented into a particle swarm; wherein, if the object to be presented is a single object, boundary points corresponding to the object are selected to form the particle swarm; if the object to be presented is multiple objects and within a first predetermined quantity, boundary points of each object are selected to form the particle swarm; if the object to be presented is multiple objects and exceeds the first predetermined quantity, each object is regarded as a particle to form the particle swarm; and constructing a bounding box around the particle swarm.

[0008] Optionally, performing an inverse transformation on the first bounding box around a first center point to obtain a second bounding box includes: rotating the first bounding box containing the particle swarm around the first center point in the reverse direction; wherein, the first center point is the origin of the three-axis coordinate system, and each particle rotates around the first center point by a first preset angle from the positive z-axis direction towards the negative x-axis direction, and rotates by a second preset angle from the xz plane towards the negative y-axis direction; calculating the second bounding box corresponding to the rotated particle swarm and the center point of the second bounding box.

[0009] Optionally, calculating the set position of the camera in the three-dimensional scene according to the center point of the second bounding box and the camera parameters includes: using the center point of the second bounding box as the current camera focus; controlling the camera to shoot towards the current camera focus along the positive z-axis direction; when the second bounding box is projected at the center of the screen, determining the set position of the camera in the three-dimensional scene according to the camera parameters.

[0010] Optionally, performing a forward transformation on the center point of the second bounding box and the set position of the camera according to the first center point to obtain the target view point and target focus of the camera includes: rotating the center point of the second bounding box around the first center point by a first preset angle and a second preset angle in the forward direction to obtain the target focus of the camera; and rotating the set position of the camera around the first center point by a first preset angle and a second preset angle in the forward direction to obtain the target view point of the camera.

[0011] Second aspect, an embodiment of the present invention further provides a system for presenting an object at the center of a screen, including: a construction program module, configured to construct a first bounding box in a three-dimensional scene according to a user trigger instruction; the first bounding box is used to hold a particle swarm composed of the object to be presented; an inverse transformation program module, which performs an inverse transformation on the first bounding box around a first center point to obtain a second bounding box; the first center point is the center point of the first bounding box; a calculation program module, which calculates the set position of the camera in the three-dimensional scene according to the center point of the second bounding box and camera parameters; the camera is a virtual camera tool; a forward transformation program module, configured to perform a forward transformation on the center point of the second bounding box and the set position of the camera around the first center point to obtain the target viewpoint and target focus of the camera; where the viewpoint is used to represent the set position of the camera in the three-dimensional scene; a presentation program module, configured to project the object to be presented to the center position of the screen for presentation according to the target viewpoint and target focus of the camera.

[0012] Optionally, the construction program module includes: a conversion program unit, configured to convert the object to be presented into a particle swarm; where, if the object to be presented is a single object, boundary points corresponding to the object are selected to form a particle swarm; if the object to be presented is multiple objects and within a first predetermined quantity, boundary points of each object are selected to form a particle swarm; if the object to be presented is multiple objects and exceeds the first predetermined quantity, each object is regarded as a particle to form a particle swarm; a construction program unit, configured to construct a bounding box around the particle swarm.

[0013] Optionally, the calculation program module is specifically configured to: use the center point of the second bounding box as the current camera focus; control the camera to shoot towards the current camera focus along the positive z-axis direction; when the second bounding box is projected at the center of the screen, determine the set position of the camera in the three-dimensional scene according to the camera parameters.

[0014] Third aspect, an embodiment of the present invention provides an electronic device, including: one or more processors; a memory; one or more executable programs are stored in the memory, and the one or more processors read the executable program code stored in the memory and run the program corresponding to the executable program code to execute the method for presenting an object at the center of the screen according to any one of the first aspect.

[0015] Fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method for presenting an object at the center of the screen according to any one of the first aspect.

[0016] The method, system, electronic device and storage medium for presenting an object at the center of a screen provided by an embodiment of the present invention wrap a particle swarm by constructing a first bounding box in a three-dimensional scene, then perform an inverse transformation on the first bounding box to obtain a second bounding box, and calculate the set position of the camera in the three-dimensional scene according to the center point of the second bounding box and the camera parameters; perform a forward transformation on the center point of the second bounding box and the set position of the camera according to the first center point to obtain the target viewpoint and target focus of the camera; in this way, by using a bounding box to wrap and hold the particle swarm of the object to be presented and performing inverse and forward transformations, when the viewing angle of the object to be presented changes, the target viewpoint and target focus of the camera can still be determined, so as to facilitate presenting the object at the center position of the screen. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained according to these drawings.

[0018] Figure 1 Schematic diagram of calculating the camera and viewpoint positions by wrapping the object to be presented in a sphere in an embodiment of the related art

[0019] Figure 2 Schematic flowchart of the method for presenting an object at the center of a screen in an embodiment of the present invention;

[0020] Figure 3 Schematic diagram of the camera viewpoint and focus positions in an embodiment of the present invention;

[0021] Figure 4 Schematic flowchart of the method for presenting an object at the center of a screen in another embodiment of the present invention;

[0022] Figure 5 Schematic block diagram of the system architecture for presenting an object at the center of a screen in another embodiment of the present invention;

[0023] Figure 6 Schematic block diagram of the architecture of an embodiment of the electronic device of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0024] The following will describe the embodiments of the present invention in detail with reference to the drawings.

[0025] It should be clear that the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.

[0026] The method for presenting an object at the center of a screen provided by an embodiment of the present invention can be applied to scenarios of application interface rendering such as Web development, user interface development, game development, etc., facilitating the presentation of the object at the center position of the screen.

[0027] It should be noted that this method can be solidified in a manufactured physical product in the form of software. When a user uses this product, the method flow of this application can be reproduced.

[0028] Before describing the embodiments of the present invention in detail, the technical terms or nouns involved in one or more embodiments of the present invention are explained as follows: Scene: The space where an object is presented; Camera: A tool used to observe an object in rendering software; Renderer: Presenting the scene observed through the camera on the screen.

[0029] Figure 2 It is a schematic flowchart of the method for presenting an object at the center of a screen in an embodiment of the present invention; see Figure 2 As shown, the method for presenting an object at the center of a screen includes the steps:

[0030] S110. Construct a first bounding box in a three-dimensional scene according to a user trigger instruction.

[0031] The first bounding box (Axis-aligned bounding box) is used to hold the particle swarm formed by the object to be presented.

[0032] S120. Perform an inverse transformation on the first bounding box according to a first center point to obtain a second bounding box.

[0033] The first center point is the center point of the first bounding box; to calculate the center point O of the first bounding box of the particle swarm, the center point O can be obtained by taking the median values of the three dimensions in a three-axis coordinate system.

[0034] S130. Calculate the set position of the camera in the three-dimensional scene according to the center point of the second bounding box and the camera parameters.

[0035] The camera is a virtual camera tool, which is a projection tool from 3D to 2D (three-dimensional to two-dimensional); exemplarily, in Three.js, there is a camera button. Selecting the corresponding type of camera will create a camera in the canvas. Its function is to continuously shoot the created scene and then render it to the screen through a renderer (Render). If you want to view the scene from different angles, you need to modify the position of the camera to shoot the scene; the camera in this embodiment mainly refers to a perspective camera (PerspectiveCamera).

[0036] The known camera parameters mainly include: fov, the vertical field of view angle of the camera frustum; aspect, the aspect ratio of the camera frustum; near, the near end face of the camera frustum; far, the far end face of the camera frustum.

[0037] S140. Positively transform the center point of the second package box and the set position of the camera (referring to the position in the three-axis coordinate system) according to the first center point to obtain the target view point and target focus of the camera.

[0038] Please refer to Figure 3 As shown, the view point is used to represent the set position of the camera in the three-dimensional scene, and the focus represents the position where the target observed by the camera is located. Generally, the default focus position is the origin in the world coordinate system. Of course, the focus position can also be set additionally through control.target.set().

[0039] During the process of observing the target, the camera control OrbitControls can control the angle of the camera rotating around a certain axis relative to the focus, so that the object can be observed from multiple angles; among them, OribitControls is the controller around the target.

[0040] S150. Project the object to be presented to the center position of the screen for presentation according to the target view point and target focus of the camera.

[0041] Using perspective projection, all contents in the frustum (used to determine what is within the camera's field of view) are projected onto the view point in a straight line; among them, the frustum is the area in 3D space that will be projected onto the screen. Any content outside this area will not appear on the screen. This is because it is either too close or too far away, or because the camera is not pointed at (Look at) it.

[0042] In this embodiment, by switching the camera parameters passed into the renderer, the content that the camera needs to render in real time is displayed at the center position of the screen.

[0043] In this embodiment, by constructing a first package box in the three-dimensional scene to wrap the particle swarm, and then performing an inverse transformation on the first package box to obtain a second package box, the set position of the camera in the three-dimensional scene is calculated according to the center point of the second package box and the camera parameters; the center point of the second package box and the set position of the camera are positively transformed according to the first center point to obtain the target view point and target focus of the camera; in this way, by using a package box to wrap and hold the particle swarm of the object to be presented and performing inverse and positive transformations, when the view angle of the object to be presented changes, the target view point and target focus of the camera can still be determined, so as to facilitate presenting the object at the center position of the screen.

[0044] Therefore, the embodiments of the present invention can make it appear at the center position of the screen at various angles, and the viewpoint and focus calculation methods are simple and efficient.

[0045] Please refer to Figure 4 As shown, in some embodiments, in step S110, constructing the first bounding box in the three-dimensional scene includes:

[0046] S111. Convert the object to be presented into a particle swarm.

[0047] Among them, if the object to be presented is a single object, the boundary points of the corresponding object are selected to form a particle swarm; if the object to be presented is multiple objects and within the first predetermined quantity, the boundary points of each object are selected to form a particle swarm; if the object to be presented is multiple objects and exceeds the first predetermined quantity, each object is regarded as a particle to form a particle swarm.

[0048] S113. Construct a bounding box around the particle swarm.

[0049] The technical solution provided by the embodiments of the present invention first regards all objects, whether single objects or multiple objects, as a particle swarm and constructs a bounding box around it, which is convenient for subsequent efficient calculation.

[0050] Please refer to Figure 4 As shown, in some embodiments, the reverse transformation of the first bounding box according to the first center point to obtain the second bounding box (S120) includes: rotating the first bounding box containing the particle swarm reversely around the first center point; wherein, the first center point is the origin O of the xyz three-axis coordinate system, and each particle rotates around the first center point by a first preset angle α (left rotation angle) from the positive direction of the z-axis towards the negative direction of the x-axis, and a second preset angle β (down rotation angle) from the xz plane towards the negative direction of the y-axis. The first preset angle α and the second preset angle β are the camera viewing angles; calculate the second bounding box corresponding to the rotated particle swarm and the center point of the second bounding box.

[0051] Among them, the first preset angle is the horizontally visible field angle (Polar Angle) of the camera frustum defined in advance, and the second preset angle is the vertically visible field angle (Azimuthal Angle) of the camera frustum defined in advance. Briefly speaking, they are the viewing angles in two directions.

[0052] According to the viewing angle requirements, the first preset angle and the second preset angle can be set by oneself.

[0053] In this embodiment, by presetting different preset angles, the object to be presented can be accurately presented at the center position of the screen at various angles.

[0054] In some embodiments, calculating the set position of the camera in the three-dimensional scene according to the center point of the second package box and the camera parameters (step S130) includes: using the center point of the second package box as the current camera focus; controlling the camera to shoot towards the current camera focus along the positive z-axis direction, and the camera control OrbitControls can be used to control the camera; when the second package box is projected at the center of the screen, determining the set position of the camera in the three-dimensional scene according to the camera parameters.

[0055] In this embodiment, according to the known camera parameters, calculate the front view field of the second package box after transformation, that is, with the new center point Q as the focus, the camera looks towards the focus in the positive z-axis direction, and when projected at the center of the screen, the position P of the camera is used as the viewpoint. Setting the camera at this position can ensure that the object is projected at the center of the screen.

[0056] Among them, determining the set position of the camera in the three-dimensional scene according to the camera parameters is a well-known technique to those skilled in the art. For the sake of brevity, it will not be elaborated here.

[0057] In some embodiments, the positive transformation of the center point of the second package box and the set position of the camera around the first center point to obtain the target viewpoint and target focus of the camera includes: rotating the center point of the second package box around the first center point by a first preset angle and a second preset angle in the positive direction to obtain the target focus of the camera; and rotating the set position of the camera around the first center point by a first preset angle and a second preset angle in the positive direction to obtain the target viewpoint of the camera.

[0058] In this embodiment, by rotating the focus Q and the viewpoint P around the first center point O again by the defined first preset angle and second preset angle, that is, rotating right by α and rotating up by β, the final focus and viewpoint positions are obtained.

[0059] In this embodiment, all objects, whether single objects or multiple objects, are regarded as a particle swarm. First, calculate the original center point of the particle swarm, then perform an inverse transformation of the field of view angle of the particle swarm with the original center, and then calculate the second package box and its center point of the transformed particle swarm. In the positive field of view, according to the second package box and its center point, as well as the camera parameters, calculate the camera position, that is, the viewpoint. Finally, the center point of the second package box and the camera position are transformed back with the original center point according to the original transformation direction to obtain the final focus and viewpoint positions, that is, the field of view positions; passing the field of view positions into the renderer can ensure that the object is projected onto the center of the screen for presentation.

[0060] Embodiment 2

[0061] Figure 5The following is a schematic block diagram of the system architecture for presenting an object at the center of the screen in an embodiment of the present invention. Please refer to Figure 5 As shown, based on the same technical concept as each embodiment in the first embodiment described above, a system for presenting an object at the center of the screen is further provided, including: a construction program module 210 for constructing a first package box in a three-dimensional scene according to a user trigger instruction; the first package box is used to hold a particle swarm composed of objects to be presented; an inverse transformation program module 220 for performing an inverse transformation on the first package box around a first center point to obtain a second package box; the first center point is the center point of the first package box; a calculation program module 230 for calculating the set position of a camera in the three-dimensional scene according to the center point of the second package box and camera parameters; the camera is a virtual camera tool; a forward transformation program module 240 for performing a forward transformation on the center point of the second package box and the set position of the camera around the first center point to obtain the target view point and target focus of the camera; where the view point is used to represent the set position of the camera in the three-dimensional scene; a presentation program module 260 for projecting the object to be presented to the center position of the screen for presentation according to the target view point and target focus of the camera.

[0062] The system of this embodiment can be used to execute Figure 1 The technical solutions of the method embodiment shown, and its implementation principle and technical effects are similar to those of the first embodiment, and will not be elaborated here, and can be referred to each other.

[0063] In some embodiments, the construction program module 210 includes: a conversion program unit for converting an object to be presented into a particle swarm; where if the object to be presented is a single object, boundary points corresponding to the object are selected to form a particle swarm; if the object to be presented is multiple objects and within a first predetermined number, boundary points of each object are selected to form a particle swarm; if the object to be presented is multiple objects and exceeds the first predetermined number, each object is regarded as a particle to form a particle swarm; a construction program unit for constructing a package box around the particle swarm.

[0064] In some embodiments, the calculation program module is specifically configured to: use the center point of the second package box as the current camera focus; control the camera to shoot towards the current camera focus along the positive z-axis direction; when the second package box is projected onto the center of the screen, determine the set position of the camera in the three-dimensional scene according to the camera parameters.

[0065] In addition, it can be understood that Figure 5 the system shown is also applicable to the execution step processes of other embodiments in the first embodiment. For specific details, please refer to the relevant descriptions in the first embodiment and will not be elaborated here.

[0066] The system for presenting an object at the center of a screen provided by an embodiment of the present invention wraps a particle swarm containing the object to be presented with a wrapping box, and performs reverse and forward transformations. When the viewing angle of the object to be presented is changed, the target viewpoint and target focus of the camera can still be determined, so as to facilitate presenting the object at the center position of the screen.

[0067] Embodiment III

[0068] Another embodiment of the present invention provides an electronic device, including: one or more processors; a memory; one or more executable programs are stored in the memory, and the one or more processors read the executable program code stored in the memory and run the program corresponding to the executable program code to execute any one of the methods for presenting an object at the center of a screen in Embodiment I.

[0069] Figure 6 is a schematic structural diagram of an embodiment of the electronic device of the present invention, which can implement any one of the methods in Embodiment I of the present invention, such as Figure 6 As shown, as an optional embodiment, the above-mentioned electronic device may include: a housing 41, a processor 42, a memory 43, a circuit board 44, and a power supply circuit 45. Among them, the circuit board 44 is arranged inside the space surrounded by the housing 41, and the processor 42 and the memory 43 are arranged on the circuit board 44; the power supply circuit 45 is used to supply power to each circuit or device of the above-mentioned electronic device; the memory 43 is used to store executable program code; the processor 42 runs the program corresponding to the executable program code by reading the executable program code stored in the memory 43, and is used to execute any one of the methods for presenting an object at the center of a screen in the foregoing Embodiment I.

[0070] For the specific execution process of the above steps by the processor 42 and the further steps executed by the processor 42 by running the executable program code, reference may be made to the description of Embodiment I of the method for presenting an object at the center of a screen in the present invention, which will not be elaborated herein.

[0071] The electronic device exists in various forms, including but not limited to: (1) Mobile communication devices: These devices are characterized by having mobile communication functions and mainly aim to provide voice and data communication. Such terminals include: smart phones, multimedia phones, functional phones, and low-end phones, etc. (2) Ultra-mobile personal computer devices: These devices belong to the category of personal computers, have computing and processing functions, and generally also have the characteristic of mobile Internet access. Such terminals include: PDA, MID, and UMPC devices, etc., such as iPad. (3) Portable entertainment devices: These devices can display and play multimedia content. Such devices include: audio and video playback modules (such as iPod), handheld game consoles, e-books, and smart toys and portable in-vehicle navigation devices. (4) Servers: Devices that provide computing services. The composition of a server includes a processor, hard disk, memory, system bus, etc. A server is similar to a general computer architecture, but due to the need to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, manageability, etc. (5) Other electronic devices with data interaction functions.

[0072] An embodiment of the present invention further provides a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method of presenting an object at the center of the screen as described in any one of the foregoing Embodiment 1.

[0073] According to the disclosure of the above embodiments, the method and system for presenting an object at the center of the screen provided by the embodiments of the present invention can accurately present the object at the center position of the screen at various angles, and the calculation methods of the viewing point and the focus are simple and efficient.

[0074] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.

[0075] Each embodiment in this specification is described in a related manner. The same or similar parts between the embodiments can be referred to each other, and the differences between each embodiment and other embodiments are emphasized.

[0076] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above various methods. Among them, the storage medium can also be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.

[0077] As mentioned above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A method for presenting an object at the center of a screen, characterized in that, The method includes the steps of: Constructing a first bounding box in a three-dimensional scene according to a user trigger instruction; the first bounding box is used to hold a particle swarm composed of objects to be presented; Performing an inverse transformation on the first bounding box around a first center point to obtain a second bounding box; The first center point is the center point of the first bounding box; Calculating the set position of a camera in the three-dimensional scene according to the center point of the second bounding box and camera parameters; the camera is a virtual camera tool; Performing a forward transformation on the center point of the second bounding box and the set position of the camera around the first center point to obtain the target viewpoint and target focus of the camera; wherein, the viewpoint is used to represent the set position of the camera in the three-dimensional scene; Projecting the object to be presented to the center position of the screen for presentation according to the target viewpoint and target focus of the camera; The constructing of the first bounding box in the three-dimensional scene includes: converting the object to be presented into a particle swarm; Wherein, if the object to be presented is a single object, boundary points of the corresponding object are selected to form a particle swarm; If the object to be presented is multiple objects and within a first predetermined quantity, boundary points of each object are selected to form a particle swarm; If the object to be presented is multiple objects and exceeds the first predetermined quantity, each object is regarded as a particle to form a particle swarm; Constructing a bounding box around the particle swarm; The performing an inverse transformation on the first bounding box around the first center point to obtain the second bounding box includes: Rotating the first bounding box containing the particle swarm around the first center point in the reverse direction; wherein, the first center point is the origin of the three-axis coordinate system, and each particle rotates around the first center point by a first preset angle from the positive z-axis direction towards the negative x-axis direction, and rotates by a second preset angle from the xz plane towards the negative y-axis direction; Calculating the second bounding box corresponding to the rotated particle swarm and the center point of the second bounding box.

2. The method for presenting an object at the center of a screen according to claim 1, characterized in that, Calculating the set position of the camera in the three-dimensional scene according to the center point of the second bounding box and camera parameters includes: Taking the center point of the second bounding box as the current camera focus; Controlling the camera to shoot towards the current camera focus along the positive z-axis direction; When the second bounding box is projected onto the center of the screen, determining the set position of the camera in the three-dimensional scene according to the camera parameters.

3. The method for presenting an object at the center of a screen according to claim 2, wherein The performing a forward transformation on the center point of the second bounding box and the set position of the camera around the first center point to obtain the target viewpoint and target focus of the camera includes: Rotating the center point of the second bounding box around the first center point by the first preset angle and the second preset angle in the forward direction to obtain the target focus of the camera; And, rotating the set position of the camera around the first center point by the first preset angle and the second preset angle in the forward direction to obtain the target viewpoint of the camera.

4. A system for presenting an object at the center of a screen, characterized in that, Including: A construction program module for constructing a first bounding box in a three-dimensional scene according to a user trigger instruction; The first bounding box is used to hold a particle swarm composed of objects to be presented; An inverse transformation program module for performing an inverse transformation on the first bounding box around the first center point to obtain a second bounding box; the first center point is the center point of the first bounding box; A calculation program module that calculates the set position of the camera in the three-dimensional scene based on the center point of the second package box and the camera parameters; the camera is a virtual camera tool; A forward transformation program module for performing a forward transformation of the center point of the second package box and the set position of the camera around the first center point to obtain the target viewpoint and target focus of the camera; wherein, the viewpoint is used to represent the set position of the camera in the three-dimensional scene; A rendering program module for projecting the object to be rendered to the center position of the screen for rendering according to the target viewpoint and target focus of the camera; The construction program module includes: a conversion program unit for converting the object to be rendered into a particle swarm; Wherein, if the object to be rendered is a single object, boundary points corresponding to the object are selected to form a particle swarm; If the object to be rendered is multiple objects and within a first predetermined number, boundary points of each object are selected to form a particle swarm; If the object to be rendered is multiple objects and exceeds the first predetermined number, each object is regarded as a particle to form a particle swarm; A construction program unit for constructing a package box around the particle swarm; The calculation program module is specifically used for: Taking the center point of the second package box as the current camera focus; Controlling the camera to shoot towards the current camera focus along the positive z-axis direction; When the second package box is projected onto the center of the screen, determining the set position of the camera in the three-dimensional scene according to the camera parameters.

5. An electronic device, characterized in that, Including: One or more processors; A memory; One or more executable programs are stored in the memory, and the one or more processors read the executable program code stored in the memory and run the program corresponding to the executable program code to execute the method for presenting an object at the center of the screen according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method for presenting an object at the center of the screen according to any one of the foregoing claims 1 to 3.

Citation Information

Patent Citations

  • Three-dimensional scene presentation method, device and equipment and storage medium

    CN109829981A

  • Charged particle beam application apparatus

    US20040251427A1