A method, device and system for automatically optimizing target observation points
By constructing picking rays and updating the camera position, the problem of lack of automatic optimization of the target observation point of the orbit camera controller in the 3D rendering system is solved, and the operation experience and the followability of scene details are improved.
Patent Information
- Application Number
- CN202310502060.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-06
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2043-05-06
AI Technical Summary
In existing 3D rendering systems, the target observation point of the orbital camera controller lacks automatic optimization, resulting in a poor operating experience. It is difficult for users to follow the movement speed of objects and accurately grasp the details of the scene.
By obtaining the position coordinates of the orbit camera and the target observation point, a picking ray is constructed to determine whether it intersects with the 3D rendering scene. When it intersects, the position coordinates of the camera and the observation point are updated, and the horizontal and vertical planes are used to assist in calculating the coordinates of the nearest observation point.
Without affecting rendering efficiency, the operating experience of the camera track camera controller has been improved, improving the user's ability to follow scene details.
Smart Images

Figure CN116934844B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to a method, device and system for automatically optimizing a target observation point. Background Art
[0002] The orbital camera controller in a 3D rendering system is a camera control method that allows users to rotate the camera around a target object to observe the object from different angles. The orbital camera controller usually consists of the following elements:
[0003] 1. Target object: the object around which the camera rotates.
[0004] 2. Path: refers to the trajectory that the camera follows when it rotates around the target object.
[0005] 3. Camera: refers to the user's perspective for observing the target object. By controlling the camera, parameters such as the observation angle and distance can be changed.
[0006] By controlling the path and camera, users can observe the target object from different perspectives, thereby rendering images from different angles.
[0007] The position of the camera's target point significantly impacts the experience of rotating a camera, as rotating a camera is achieved by changing its orientation. If the camera's target point is too far away in the scene, objects in the scene may move rapidly during camera rotation, making it difficult for the operator to accurately grasp the details of the scene by following the speed of the moving objects.
[0008] Therefore, it is necessary to set a suitable orbit camera target point position so that the objects in the scene can move at a natural speed and angle when the camera is rotated. At the same time, the operator can easily and comfortably follow the changes in the perspective and better grasp the information in the scene.
[0009] In the prior art, target control of a 3D orbit camera controller in a 3D rendering system is mostly left to the developer to set, with very little automatic optimization processing.
[0010] Based on the above, how to provide a solution that can automatically optimize the target observation point is an urgent problem to be solved. Summary of the Invention
[0011] In order to solve the problems of the prior art, the embodiments of the present invention provide the following technical solutions:
[0012] In a first aspect, the present invention provides a method for automatically optimizing a target observation point, comprising:
[0013] Get the coordinates of the orbit camera position and the target observation point position;
[0014] Constructing a picking ray according to the track camera position coordinates and the target observation point position coordinates;
[0015] Determining whether the picked ray intersects with the three-dimensional rendering scene;
[0016] If the picked ray intersects the three-dimensional rendering scene, the track camera position coordinates and the target observation point position coordinates are updated according to the picked ray.
[0017] Furthermore, before obtaining the orbit camera position and the target observation point position, it also includes:
[0018] constructing a horizontal plane and a vertical plane perpendicular to the horizontal plane;
[0019] The initial coordinates of the vertical plane and the horizontal plane are set as the target observation point position coordinates.
[0020] Furthermore, it also includes:
[0021] Set the timer's initial update frequency according to the preset time period.
[0022] Furthermore, constructing a picking ray according to the track camera position coordinates and the target observation point position coordinates includes:
[0023] Create a three-dimensional vector origin according to the position coordinates of the orbit camera;
[0024] Subtract the track camera position coordinates from the target observation point position coordinates to obtain the direction vector direction;
[0025] According to the three-dimensional vector origin and the direction vector direction, create a ray from the starting position of the orbit camera along the direction direction.
[0026] Furthermore, it also includes:
[0027] If the picked ray does not intersect the three-dimensional rendering scene, three-dimensional coordinates are picked on mutually perpendicular planes to obtain the position coordinates of the target observation point closest to the three-dimensional track camera;
[0028] The position coordinates of the target observation point closest to the three-dimensional track camera are updated as the position coordinates of the target observation point.
[0029] Furthermore, the picking of three-dimensional coordinates of mutually perpendicular planes includes:
[0030] Calculating a first coordinate point and a second coordinate point, wherein the first coordinate point is a coordinate point where the picked-up ray intersects the horizontal plane, and the second coordinate point is a coordinate point where the picked-up ray intersects the vertical plane;
[0031] Calculate the distance s1 from the first coordinate point to the position of the track camera;
[0032] Calculate the distance s2 from the second coordinate point to the position of the track camera;
[0033] Determine the size of s1 and s2 to obtain the coordinates of the target observation point closest to the track camera;
[0034] Determine the coordinates of the target observation point closest to the track camera based on the result;
[0035] The target observation point position coordinates are updated to the target observation point position coordinates closest to the track camera.
[0036] Furthermore,
[0037] Determining whether the first coordinate point is within the horizontal plane;
[0038] If the first coordinate point is within the horizontal plane, determining whether the first coordinate point is in the positive direction of the pickup ray;
[0039] If the first coordinate point is in the positive direction of the picking ray, the first coordinate point can be used as the picking point;
[0040] Determining whether the second coordinate point is within the vertical plane;
[0041] If the second coordinate point is within the vertical plane, determining whether the second coordinate point is in the positive direction of the pickup ray;
[0042] If the second coordinate point is in the positive direction of the picking ray, the second coordinate point can be used as the picking point.
[0043] Furthermore, the determining whether the first coordinate point is in the positive direction of the pickup ray includes:
[0044] Calculating the angle between the first coordinate point and the ray direction;
[0045] If the angle is less than 90°, determining that the first coordinate point is in the positive direction of the pickup ray;
[0046] If the included angle is greater than 90°, it is determined that the first coordinate point is in the opposite direction of the picked-up ray.
[0047] In a second aspect, the present invention further provides a device for automatically optimizing a target observation point, comprising:
[0048] The coordinate acquisition module is used to obtain the position coordinates of the track camera and the target observation point;
[0049] Constructing a picking ray module, used to construct a picking ray according to the position coordinates of the track camera and the position coordinates of the target observation point;
[0050] A judgment module, used to judge whether the picked ray intersects with the three-dimensional rendering scene;
[0051] An updating module is configured to update the track camera position coordinates and the target observation point position coordinates according to the picked ray if the picked ray intersects the three-dimensional rendering scene.
[0052] In a third aspect, the present invention also provides a system for automatically optimizing target observation points, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the system implements the steps of the method for automatically optimizing target observation points described in any one of the first aspects.
[0053] The present invention provides a method for automatically optimizing a target observation point. This method obtains the coordinates of a track camera and the coordinates of a target observation point; constructs a picking ray based on these coordinates; determines whether the picking ray intersects with a 3D rendered scene; and, if so, updates the track camera and target observation point coordinates based on the picking ray. This improves the user experience of the camera track controller without compromising rendering efficiency. The technical solution is easy to implement and does not increase the technical requirements for developers. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0055] Figure 1 The present invention provides a flowchart of a method for automatically optimizing target observation points according to an embodiment of the present invention.
[0056] Figure 2 This is a flowchart of a method for automatically optimizing target observation points provided by another embodiment of the present invention.
[0057] Figure 3The figure is a schematic diagram of the structure of a device for automatically optimizing target observation points provided by one embodiment of the present invention.
[0058] Figure 4 It is a schematic diagram of the system structure for automatically optimizing target observation points provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0059] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be described in detail below. Obviously, the embodiments described are only some of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other implementations obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of the present invention.
[0060] See also Figure 1 , Figure 1 This is a flowchart of a method for automatically optimizing target observation points provided by an embodiment of the present invention. Figure 1 Shown, including:
[0061] Step S101, obtaining the track camera position coordinates and the target observation point position coordinates;
[0062] Step S102: constructing a picking ray according to the track camera position coordinates and the target observation point position coordinates;
[0063] Specifically, a three-dimensional vector origin is created according to the position coordinates of the track camera;
[0064] The direction vector direction is obtained by subtracting the track camera position coordinates from the target observation point position coordinates; the direction vector direction can also be obtained by normalizing the target observation point position coordinates.
[0065] According to the three-dimensional vector origin and the direction vector direction, create a ray from the starting position of the orbit camera along the direction direction.
[0066] Step S103: determining whether the picked ray intersects with the three-dimensional rendering scene;
[0067] Step S104: If the picked ray intersects the three-dimensional rendering scene, the track camera position coordinates and the target observation point position coordinates are updated according to the picked ray.
[0068] In one embodiment, a camera orbit camera controller (OrbitControls) allows users to control the movement and rotation of the camera using a mouse or touch gestures. During the operation of the controller, the target position changes can be obtained by monitoring the controller's events, thereby triggering some operations.
[0069] To monitor the target position changes of the camera track camera controller, you need to add an event listener when initializing the controller so that the camera can be controlled when a mouse or touch gesture event is triggered.
[0070] The event manager is used to monitor the user's mouse or touch events. After monitoring the event, OrbitControls calculates the corresponding target position based on the event type, and then updates the camera position through the following steps:
[0071] Calculates a new target position based on the controller's target property and the current position of the mouse or touch event. For example, in a mouse wheel event, the new target position is calculated based on the controller and camera positions and the distance the mouse wheel has been rolled.
[0072] After calculating the new target position, OrbitControls will calculate the new position of the camera based on this position.
[0073] After calculating the new camera position, OrbitControls sets it as the camera position and points the camera toward the target position, thus achieving camera movement and rotation.
[0074] After updating the camera's position, OrbitControls can notify external code through events. External code can listen to the events to detect changes in the target position and trigger an update of the target point.
[0075] The present invention provides a method for automatically optimizing a target observation point. This method obtains the coordinates of a track camera and the coordinates of a target observation point; constructs a picking ray based on these coordinates; determines whether the picking ray intersects with a 3D rendered scene; and, if so, updates the track camera and target observation point coordinates based on the picking ray. This improves the user experience of the camera track controller without compromising rendering efficiency. The technical solution is easy to implement and does not increase the technical requirements for developers.
[0076] As a further improvement of the above embodiment, in one embodiment, before obtaining the track camera position and the target observation point position, the method further includes:
[0077] constructing a horizontal plane and a vertical plane perpendicular to the horizontal plane;
[0078] The initial coordinates of the vertical plane and the horizontal plane are set as the target observation point position coordinates.
[0079] In one embodiment, a sufficiently large horizontal plane can be created. A sufficiently large vertical plane can also be created, wherein the vertical plane is rotated 90 degrees to be perpendicular to the horizontal plane. The initial coordinates of the vertical and horizontal planes are the camera's target observation point.
[0080] In some embodiments, the method further includes setting an initial update frequency of the timer according to a preset time period.
[0081] In a practical example,
[0082] 1) Construct two mutually perpendicular plane data. The two mutually perpendicular planes only include data, and their origin positions are set as the initial target observation point position of the orbit camera;
[0083] 2) Set the initial update frequency of the timer according to the preset time period, which can be set to 200 milliseconds to trigger the plane update operation; it should be noted that the present invention does not impose specific restrictions on the update frequency of the timer, and those skilled in the art can set the timer update frequency according to actual needs.
[0084] 3) Listen to the target position operation start event of the track camera track camera controller to trigger the target point update phase operation.
[0085] Specifically, the OrbitControls allows users to control the movement and rotation of the OrbitCamera using the mouse or touch gestures. During the operation of the OrbitControls, you can listen to the OrbitControls' events to obtain changes in the target position, thereby triggering some operations.
[0086] To monitor the target position changes of the orbit camera controller, you need to add an event listener when initializing the orbit camera controller so that the orbit camera can be controlled when a mouse or touch gesture event is triggered.
[0087] The event manager listens for user mouse or touch events. After listening to the event, OrbitControls calculates the corresponding target position based on the type of event, and then updates the position of the orbit camera through the following steps:
[0088] Calculates a new target look-at position based on the Orbit Camera's Camera Controller's Target property and the current position of the mouse or touch event. For example, in a mouse wheel event, the new target look-at position can be calculated based on the positions of the Orbit Camera Controller and the Orbit Camera, as well as the distance the mouse wheel was scrolled.
[0089] After calculating the new target observation point position, OrbitControls calculates the new position of the orbit camera based on the new target observation point position.
[0090] After calculating the new orbit camera position, OrbitControls sets the new position of the orbit camera as the orbit camera position and points the orbit camera toward the target observation point position, thereby realizing the movement and rotation of the orbit camera.
[0091] After updating the orbit camera's position, OrbitControls can notify external code through events. External code can listen to events to obtain changes in the target observation point position, thereby triggering the target point update operation.
[0092] As a further improvement of the above embodiment, please refer to Figure 2 , Figure 2 FIG. 1 is a flow chart of steps of a method for automatically optimizing target observation points in one embodiment of the present invention. Figure 2 As shown,
[0093] Step S201: Obtain the track camera position coordinates and the target observation point position coordinates;
[0094] Step S202: constructing a picking ray according to the track camera position coordinates and the target observation point position coordinates;
[0095] Step S203: determining whether the picked ray intersects with the three-dimensional rendering scene;
[0096] Step S204: If the picked ray does not intersect the 3D rendering scene, three-dimensional coordinates are picked on mutually perpendicular planes to obtain the position coordinates of the target observation point closest to the 3D track camera;
[0097] Step S205: Update the position coordinates of the target observation point closest to the three-dimensional track camera to the position coordinates of the target observation point.
[0098] Specifically, picking three-dimensional coordinates of mutually perpendicular planes includes:
[0099] Calculating a first coordinate point and a second coordinate point, wherein the first coordinate point is a coordinate point where the picked-up ray intersects the horizontal plane, and the second coordinate point is a coordinate point where the picked-up ray intersects the vertical plane;
[0100] Calculate the distance s1 from the first coordinate point to the position of the track camera;
[0101] Calculate the distance s2 from the second coordinate point to the position of the track camera;
[0102] Determine the size of s1 and s2 to obtain the coordinates of the target observation point closest to the track camera;
[0103] Determine the coordinates of the target observation point closest to the track camera based on the result;
[0104] The target observation point position coordinates are updated to the target observation point position coordinates closest to the track camera.
[0105] Because the two planes are perpendicular to each other, the picking will not fail, and there will definitely be picking coordinates, thus obtaining the nearest three-dimensional coordinate point.
[0106] A horizontal plane or a vertical plane can be represented by three points. These three points are generally determined by the plane's normal vector and one of the points. The plane equation needs to be solved using the point method. The intersection point can be calculated by solving the ray equation and the plane equation simultaneously. To determine whether a point is in the plane, the dot product of the point and the normal vector can be used.
[0107] The coordinate calculation process of the plane and ray is:
[0108] Suppose there are three points P1(x1,y1,z1), P2(x2,y2,z2), and P3(x3,y3,z3), which can determine a plane. The cross product of the P1P2 and P1P3 vectors can be used to obtain the plane's normal vector N, that is:
[0109] N=(P2-P1)×(P3-P1)
[0110] The dot product operation can be used to calculate the cosine of the angle between two vectors, and the result is a scalar. In the general equation of a plane, Ax+By+Cz+D=0, assuming that point O on the plane is the origin of the coordinate system (x0, y0, z0), then the position of point O relative to point P can be represented by the vector OP(x, y, z). The plane's normal vector N and the plane's OP form two vectors. We can perform a dot product operation on them to obtain the cosine of the angle between them, and then calculate the relationship between the plane and the coordinate system.
[0111] Then, (A, B, C) is the coordinate of the plane normal vector N, D = -(A, B, C)·(x, y, z), and · represents the vector dot product.
[0112] Calculation principle of intersection point:
[0113] Assume there is a ray with a starting point O(x0,y0,z0) and a direction D(xd,yd,zd), then its parametric equation is:
[0114] x=x0+t*xd;
[0115] y=y0+t*yd;
[0116] z=z0+t*zd;
[0117] Among them, t is a parameter on the ray, indicating its distance from the starting point O.
[0118] Substituting the parametric equation into the general plane equation, we obtain:
[0119] A(x0+t*xd)+B(y0+t*yd)+C(z0+t*zd)+D=0
[0120] Solving for t gives us the coordinates of the intersection point.
[0121] As a further improvement of the above embodiment, some embodiments further include:
[0122] Determining whether the first coordinate point is within the horizontal plane;
[0123] If the first coordinate point is within the horizontal plane, determining whether the first coordinate point is in the positive direction of the pickup ray;
[0124] If the first coordinate point is in the positive direction of the picking ray, the first coordinate point can be used as the picking point;
[0125] Determining whether the second coordinate point is within the vertical plane;
[0126] If the second coordinate point is within the vertical plane, determining whether the second coordinate point is in the positive direction of the pickup ray;
[0127] If the second coordinate point is in the positive direction of the picking ray, the second coordinate point can be used as the picking point.
[0128] The process of determining whether a point is in a plane is as follows:
[0129] Let point P(x,y,z) and the plane normal vector be N(A,B,C). Then the necessary and sufficient condition for point P to be on the plane is N·P+D=0, that is:
[0130] Ax+By+Cz+D=0
[0131] If point P is on the plane, this value is 0. If point P is on one side of the plane, this value is positive; if it is on the other side of the plane, this value is negative.
[0132] If the intersection point is in the plane, continue to determine whether the point is in the positive direction of the ray, that is, whether it is in front of the starting point. If so, it is the ray intersection point and can be used as the coordinates of the picking point.
[0133] To determine whether a point is in the positive direction of a ray, we can calculate the distance from the point to the origin of the ray and the angle between the point and the direction of the ray.
[0134] Specifically, determining whether the first coordinate point is in the positive direction of the pickup ray includes:
[0135] Calculating the angle between the first coordinate point and the ray direction;
[0136] If the angle is less than 90°, determining that the first coordinate point is in the positive direction of the pickup ray;
[0137] If the included angle is greater than 90°, it is determined that the first coordinate point is in the opposite direction of the picked-up ray.
[0138] Specifically, in one embodiment, let the starting point of the ray be O, the direction vector be D, and the point to be determined be P. The vector of OP can be expressed as V = PO. The angle θ between V and D can be calculated. If θ is greater than 90°, P is in the opposite direction of the ray; otherwise, it is in the positive direction.
[0139] The angle θ between V and D can be calculated using the dot product formula as shown below:
[0140]
[0141] Where ||V|| and ||D|| represent the modulus of V and D, respectively. If θ is greater than 90°, the point is in the opposite direction of the ray; if θ is less than 90°, the point is in the positive direction of the ray.
[0142] Similarly, as a further improvement of the above embodiment, it also includes:
[0143] Determining whether the second coordinate point is within the vertical plane;
[0144] If the second coordinate point is within the vertical plane, determining whether the second coordinate point is in the positive direction of the pickup ray;
[0145] If the second coordinate point is in the positive direction of the picking ray, the second coordinate point can be used as the picking point.
[0146] The method steps for determining whether the second coordinate point is within the vertical plane are the same as those for determining whether the first coordinate point is within the horizontal plane, and are not repeated here.
[0147] It can be understood that using the technical solution provided by this invention, the target position of the track camera controller can be continuously adjusted according to the rendered scene, and the two mutually perpendicular planes will ensure the picking results, thereby greatly improving the user experience of the camera controller. This invention dynamically sets the camera's target observation point based on the observed scene and the current camera position and orientation without affecting rendering efficiency, greatly improving the user experience of using the camera while ensuring rendering efficiency.
[0148] See also Figure 3 , Figure 3 FIG. 1 is a schematic diagram of a device structure for automatically optimizing target observation points provided by an embodiment of the present invention. Figure 3 As shown, the device for automatically optimizing the target observation point includes:
[0149] The coordinate acquisition module 301 is used to acquire the position coordinates of the track camera and the position coordinates of the target observation point;
[0150] A picking ray construction module 302 is used to construct a picking ray according to the track camera position coordinates and the target observation point position coordinates;
[0151] A determination module 303 is configured to determine whether the picked ray intersects with the three-dimensional rendering scene;
[0152] The updating module 304 is configured to update the track camera position coordinates and the target observation point position coordinates according to the picked ray if the picked ray intersects the 3D rendering scene.
[0153] It can be understood that the device for automatically optimizing the target observation point provided by the present invention obtains the coordinates of the track camera position and the target observation point position via a coordinate acquisition module; constructs a picking ray based on the track camera position and target observation point position coordinates via a picking ray construction module; determines whether the picking ray intersects with the three-dimensional rendered scene via a judgment module; and if the picking ray intersects with the three-dimensional rendered scene, updates the track camera position and target observation point position coordinates based on the picking ray via an update module. This invention can dynamically set the target observation point of a track camera without affecting rendering efficiency, significantly improving the user experience on the camera while maintaining rendering efficiency.
[0154] See also Figure 4 , Figure 4 FIG. 1 is a schematic diagram of a system structure for automatically optimizing target observation points provided by an embodiment of the present invention. Figure 4 As shown, the system for automatically optimizing target observation points includes a memory 401 and a processor 402. The memory 401 stores a computer program, and the processor 402 implements the steps of the method for automatically optimizing target observation points when calling the computer program in the memory 401.
[0155] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0156] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" is at least two.
[0157] Throughout this specification, references to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" indicate that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0158] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A method for automatically optimizing a target observation point, characterized in that: include: Get the coordinates of the orbit camera position and the target observation point position; Constructing a picking ray according to the track camera position coordinates and the target observation point position coordinates; Determining whether the picked ray intersects with the three-dimensional rendering scene; If the picked ray intersects the three-dimensional rendering scene, updating the track camera position coordinates and the target observation point position coordinates according to the picked ray; Before obtaining the orbit camera position and the target observation point position, it also includes: constructing a horizontal plane and a vertical plane perpendicular to the horizontal plane; Setting the initial coordinates of the vertical plane and the horizontal plane as the target observation point position coordinates; If the picked ray does not intersect the three-dimensional rendering scene, three-dimensional coordinates are picked on mutually perpendicular planes to obtain the position coordinates of the target observation point closest to the three-dimensional track camera; Updating the position coordinates of the target observation point closest to the three-dimensional track camera to the position coordinates of the target observation point; The three-dimensional coordinate picking of mutually perpendicular planes includes: Calculating a first coordinate point and a second coordinate point, wherein the first coordinate point is a coordinate point where the picked-up ray intersects the horizontal plane, and the second coordinate point is a coordinate point where the picked-up ray intersects the vertical plane; Calculate the distance s1 from the first coordinate point to the position of the track camera; Calculate the distance s2 from the second coordinate point to the position of the track camera; Determine the size of s1 and s2 to obtain the coordinates of the target observation point closest to the track camera; Determine the coordinates of the target observation point closest to the track camera based on the result; The target observation point position coordinates are updated to the target observation point position coordinates closest to the track camera.
2. The method according to claim 1, characterized in that Also includes: Set the timer's initial update frequency according to the preset time period.
3. The method according to claim 1, characterized in that The step of constructing a picking ray according to the track camera position coordinates and the target observation point position coordinates includes: Create a three-dimensional vector origin according to the position coordinates of the orbit camera; Subtract the position coordinates of the track camera from the position coordinates of the target observation point to obtain the direction vector direction; According to the three-dimensional vector origin and the direction vector direction, create a ray from the starting position of the orbit camera along the direction direction.
4. The method according to claim 1, wherein Also includes, Determining whether the first coordinate point is within the horizontal plane; If the first coordinate point is within the horizontal plane, determining whether the first coordinate point is in the positive direction of the pickup ray; If the first coordinate point is in the positive direction of the picking ray, the first coordinate point can be used as the picking point; Determining whether the second coordinate point is within the vertical plane; If the second coordinate point is within the vertical plane, determining whether the second coordinate point is in the positive direction of the pickup ray; If the second coordinate point is in the positive direction of the picking ray, the second coordinate point can be used as the picking point.
5. The method according to claim 1, wherein The determining whether the first coordinate point is in the positive direction of the picked ray includes: Calculating the angle between the first coordinate point and the ray direction; If the angle is less than 90°, determining that the first coordinate point is in the positive direction of the pickup ray; If the included angle is greater than 90°, it is determined that the first coordinate point is in the opposite direction of the picked-up ray.
6. A device for automatically optimizing a target observation point, characterized in that: include: The coordinate acquisition module is used to obtain the position coordinates of the track camera and the target observation point; Constructing a picking ray module, used to construct a picking ray according to the position coordinates of the track camera and the position coordinates of the target observation point; A judgment module, used to judge whether the picked ray intersects with the three-dimensional rendering scene; an updating module, configured to update the track camera position coordinates and the target observation point position coordinates according to the picked ray if the picked ray intersects the three-dimensional rendering scene; Before obtaining the orbit camera position and the target observation point position, it also includes: constructing a horizontal plane and a vertical plane perpendicular to the horizontal plane; Setting the initial coordinates of the vertical plane and the horizontal plane as the target observation point position coordinates; If the picked ray does not intersect the three-dimensional rendering scene, three-dimensional coordinates are picked on mutually perpendicular planes to obtain the position coordinates of the target observation point closest to the three-dimensional track camera; Updating the position coordinates of the target observation point closest to the three-dimensional track camera to the position coordinates of the target observation point; The three-dimensional coordinate picking of mutually perpendicular planes includes: Calculating a first coordinate point and a second coordinate point, wherein the first coordinate point is a coordinate point where the picked-up ray intersects the horizontal plane, and the second coordinate point is a coordinate point where the picked-up ray intersects the vertical plane; Calculate the distance s1 from the first coordinate point to the position of the track camera; Calculate the distance s2 from the second coordinate point to the position of the track camera; Determine the size of s1 and s2 to obtain the coordinates of the target observation point closest to the track camera; Determine the coordinates of the target observation point closest to the track camera based on the result; The target observation point position coordinates are updated to the target observation point position coordinates closest to the track camera.
7. A system for automatically optimizing target observation points, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the method implements the steps of the method for automatically optimizing the target observation point according to any one of claims 1 to 5.
Citation Information
Patent Citations
Three-dimensional scene rendering depth conflict improvement method and system, medium and equipment
CN114943798A