Three-dimensional infinite scaling and multi-view cooperative navigation methods and related equipment
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-29
- Publication Date
- 2026-08-14
AI Technical Summary
[0004]然而,上述现有技术存在缺点:缩放机制中,使用相机的缩放参数或调整视场角的方式是非线性的且存在极限范围,当需要进行从厘米级到公里级的大范围缩放时,极易出现图形失真,纹理被拉伸或产生边缘锯齿;调整视场角的方式在极端缩放下还会导致透视关系异常;视角切换方面,预先保存独立相机状态的方案在切换时相机状态被直接重置,前后视角之间没有中间过渡,用户会产生明显的跳跃感和空间定位迷失
通过以目标点为锚点,沿相机的当前视线方向,将缩放增量与灵敏因子的积值作为自然指数函数的变量计算得到缩放因子,并根据缩放因子等比调整相机当前位置,同步动态调整相机的视场角和近远裁剪面,缩放全程不依赖像素或离散层级,完全由向量数学驱动。用户从查看厘米级设备细节平滑放大至公里级城市全景时,图形边缘保持锐利,纹理无模糊,无层级跳变或视觉失真,克服了现有缩放技术非线性、存在极限且极端缩放易失真的缺陷,实现了从厘米级到公里级的连续无失真缩放;响应于视角切换指令,根据相机的当前位姿以及基于目标视角模式预设的目标位姿,生成从当前位姿向目标位姿连续过渡的相机位置和朝向,实现相机视角切换的平滑连续过渡。
Smart Images

Figure CN122566883A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer graphics and web front-end 3D visualization technology, and in particular to a method and related equipment for 3D spatial infinite scaling and multi-view collaborative navigation. Background Technology
[0002] With the rapid development of applications such as digital twins, smart cities, and industrial metaverses, web-based 3D visualization platforms need to support seamless browsing from centimeter-level device details to kilometer-level city panoramas. However, current mainstream 3D engines have significant limitations in spatial navigation. These limitations manifest primarily in the following ways: scaling mechanisms are based on pixels or discrete levels, often employing preset LOD levels or hard switching between near and far camera clipping planes, resulting in abrupt or blurry zooming; viewpoint modes are fragmented, with bird's-eye view and first-person view typically existing as independent functions, requiring camera state resets for switching, preventing seamless transitions; a lack of 2D / 3D hybrid experience, lacking the ability to intelligently identify and switch between planar and stereoscopic views during zooming; and significant image distortion, with traditional pixel-based scaling logic prone to texture stretching, jagged edges, or loss of precision under extreme magnification or reduction. These deficiencies severely restrict users' spatial cognitive efficiency and operational consistency in complex 3D spaces.
[0003] To address the aforementioned issues, the industry commonly employs the following solutions: Zooming operations utilize camera zoom parameters or adjust the field of view, achieving visual magnification and reduction by changing the camera's focal length or field of view; for perspective switching, independent buttons such as "overhead view" and "roam" are provided, each saving its own camera state, allowing users to directly switch between modes upon clicking; regarding 2D and 3D fusion, some engines support 2D, 2.5D, and Columbus View modes, but these modes are switched discretely; and for graphic clarity, multi-level asymptotic textures or high-resolution maps are used to alleviate blurring issues during distant viewing.
[0004] However, the aforementioned existing technologies have drawbacks: In scaling mechanisms, the use of camera scaling parameters or the adjustment of the field of view is non-linear and has limitations. When scaling over a wide range from centimeters to kilometers, image distortion, texture stretching, or jagged edges easily occur. Adjusting the field of view can also lead to abnormal perspective relationships under extreme scaling. Regarding viewpoint switching, the pre-saved independent camera state is directly reset during switching, with no intermediate transition between the previous and next viewpoints, causing users to experience noticeable jumps and spatial disorientation. In terms of 2D and 3D fusion, discrete mode switching requires manual operation. The system lacks contextual awareness of the current observation situation and cannot automatically determine and switch the appropriate view type based on camera pose, leading to frequent manual switching and reduced operational efficiency. Regarding image clarity, relying on multi-level asymptotic textures or high-resolution maps can only alleviate blur at long distances but cannot fundamentally solve the problems of texture flickering and precision loss under extreme scaling. Summary of the Invention
[0005] This invention aims to address the shortcomings of existing technologies, specifically providing a method and related equipment for three-dimensional spatial infinite scaling and multi-view cooperative navigation, as detailed below: 1) In a first aspect, the present invention provides a method for three-dimensional spatial infinite scaling and multi-view cooperative navigation, the specific technical solution of which is as follows: Obtain the target point and the scaling increment of the distance between the target point and the camera; Using the target point as the anchor point, the camera's scaling factor is determined along the camera's current line of sight by combining the natural exponential function and the scaling increment. The camera's current position is adjusted proportionally according to the scaling factor, and the camera's field of view and near / far clipping plane are dynamically adjusted synchronously according to the adjusted current position of the camera, and then rendering is performed. In response to the viewpoint switching command, the camera position and orientation are generated continuously from the current pose to the target pose based on the current pose of the camera and the target pose preset based on the target viewpoint mode, and then rendering is performed.
[0006] The beneficial effects of the three-dimensional spatial infinite scaling and multi-view cooperative navigation method provided by this invention are as follows: By using the target point as an anchor point and along the camera's current line of sight, the scaling factor is calculated as a variable of the natural exponential function, multiplying the scaling increment by the sensitivity factor. The camera's current position is then adjusted proportionally based on this scaling factor, and the field of view and near / far clipping planes are dynamically adjusted simultaneously. The scaling process is entirely driven by vector mathematics, independent of pixels or discrete levels. When users smoothly zoom from centimeter-level device details to kilometer-level city panoramas, image edges remain sharp, textures are unblurred, and there are no abrupt changes in level or visual distortion. This overcomes the shortcomings of existing scaling technologies, such as non-linearity, limitations, and distortion prone to extreme scaling, achieving continuous, distortion-free scaling from centimeter to kilometer levels. Responding to viewpoint switching commands, the camera position and orientation are generated based on the current camera pose and the target pose preset according to the target viewpoint mode, resulting in a smooth and continuous transition from the current pose to the target pose, enabling seamless camera viewpoint switching.
[0007] Based on the above scheme, the three-dimensional spatial infinite scaling and multi-view cooperative navigation method of the present invention can be further improved as follows.
[0008] Furthermore, the camera's current position is adjusted proportionally according to the scaling factor, and the camera's field of view and near-far clipping plane are dynamically adjusted synchronously according to the adjusted current position of the camera. This includes: keeping the camera's current line of sight unchanged, multiplying the distance from the camera's position before adjustment to the anchor point by the scaling factor to obtain the adjusted current position of the camera; and synchronously recalculating the camera's focal length and near-far clipping plane according to the distance from the camera's current position to the anchor point, so that the near-far clipping plane changes continuously with the change of the camera's current distance.
[0009] The beneficial effects of adopting the above-mentioned further solution are as follows: By keeping the camera's current line of sight unchanged and multiplying the distance from the camera position before adjustment to the anchor point by the scaling factor to obtain the adjusted current camera position, the scaling operation is ensured to be performed along a fixed line of sight, and the visual center does not shift laterally. The camera's focal length and near / far clipping planes are recalculated synchronously based on the distance from the current camera position to the anchor point, allowing the near / far clipping planes to change continuously with the current camera distance, avoiding clipping anomalies or graphic jumps caused by traditional hard switching. The dynamic adjustment of the focal length and the continuous change of the clipping plane work together to maintain reasonable perspective relationships of objects in the scene at any scaling scale from centimeters to kilometers, ensuring that objects at both near and far distances are not incorrectly clipped, thus achieving a smooth scaling experience without hierarchical jumps or visual distortion.
[0010] Furthermore, the scaling factor of the camera is determined by combining the natural exponential function and the scaling increment, including: substituting the product of the scaling increment and the sensitivity factor into the natural exponential function as a variable, and calculating the scaling factor through the natural exponential function.
[0011] The beneficial effect of adopting the above-mentioned further scheme is that by substituting the product of the scaling increment and the sensitivity factor into the natural exponential function as a variable to calculate the scaling factor, the change of the scaling factor has continuous and smooth exponential characteristics. The continuity of the natural exponential function ensures that the scaling factor changes continuously with the user input, without any discrete jumps or level switching. Therefore, within any scaling range from centimeters to kilometers, the scaling process remains smooth and consistent, completely avoiding visual jumps and graphic distortion caused by abrupt changes in the scaling factor.
[0012] Furthermore, it also includes: when the position and / or orientation of the camera changes, before rendering, detecting the current height and tilt angle of the camera; if the current height of the camera is greater than a preset height threshold and the absolute value of the sum of the tilt angle and 90° is less than a preset tilt angle threshold, then switching the projection mode from perspective projection to orthographic projection to enter the two-dimensional plane rendering mode; if the current height of the camera is not greater than the preset height threshold or the absolute value of the sum of the tilt angle and 90° is not less than the preset tilt angle threshold, then restoring the projection mode to perspective projection to enter the three-dimensional perspective rendering mode.
[0013] The beneficial effects of adopting the above-mentioned further solution are as follows: By detecting the camera's height and tilt angle, and automatically switching the projection mode according to preset height and tilt angle thresholds, seamless intelligent switching between 2D planar rendering mode and 3D perspective rendering mode is achieved. When the camera height is greater than the preset height threshold and the tilt angle is close to vertical, the projection mode switches from perspective projection to orthographic projection, entering the 2D planar rendering mode, which allows users to view the floor layout or pipeline routing in a planar view. When the camera height does not meet the conditions or the tilt angle deviates from vertical, the projection mode reverts to perspective projection, entering the 3D perspective rendering mode, which allows users to inspect equipment installation details in a stereoscopic view. This automatic switching mechanism avoids users manually switching projection modes frequently. In scenarios such as building information model maintenance and fire inspections that require alternating use of 2D and 3D views, it significantly reduces operation steps, lowers the error rate, and improves task execution efficiency and spatial coherence.
[0014] Furthermore, based on the current pose of the camera containing the current position and the target pose preset based on the target view mode, the position and orientation of the camera that transition continuously from the current pose to the target pose are generated, including: using spherical linear interpolation, based on the initial quaternion and the target quaternion determined by the current pose and the target pose respectively, to generate the position and orientation of the camera that transition from the current pose to the target pose.
[0015] The advantages of adopting the above-mentioned further scheme are as follows: By using spherical linear interpolation, based on the initial quaternions and target quaternions determined by the current pose and target pose respectively, the camera position and orientation transitioning from the current pose to the target pose are generated, ensuring a continuous and smooth rotation and movement trajectory during the viewpoint switching process. The spherical linear interpolation between the initial quaternion and the target quaternion guarantees a constant angular velocity for the camera orientation, avoiding uneven rotational speed or gimbal lock issues caused by linear interpolation. Simultaneously, the camera position changes synchronously and linearly with the interpolation parameters, achieving a coordinated transition of position and orientation.
[0016] Furthermore, it also includes: during the transition from the current pose to the target pose, in response to an interrupt command, stopping spherical linear interpolation, and maintaining the camera's position and orientation in the parameter state at the time the interrupt command was received.
[0017] The advantages of adopting the above-mentioned further solution are as follows: By responding to the interrupt command, spherical linear interpolation can be stopped at any time during the transition from the current pose to the target pose, and the camera's position and orientation can be maintained at the parameter state at the time the interrupt command was received. This allows the user to actively control the progress of the viewpoint switching. When the transition animation is not yet complete, the user does not need to wait for the entire switching process to finish and can immediately perform zooming, rotation, or other operations from the interruption point, avoiding the waiting time caused by being forced to complete unnecessary transitions. At the same time, after the interruption, the camera remains at the user's desired intermediate viewpoint, and the spatial context is completely preserved without viewpoint regression or forced jumps. This improves the interactive flexibility and user control of viewpoint switching, and is especially suitable for application scenarios that require frequent adjustments to the observation angle or fine operations during the transition.
[0018] Furthermore, it also includes: after entering the 2D plane rendering mode, in response to the mode lock command, pausing the detection of the camera's current height and tilt angle, and locking the projection method to orthographic projection.
[0019] The beneficial effects of adopting the above-mentioned further solution are as follows: After entering the 2D planar rendering mode, by responding to the mode lock command, the detection of the camera's current height and tilt angle is paused, and the projection method is locked to orthographic projection. This allows users to obtain a stable view environment in scenarios requiring prolonged planar operations. During the lock period, regardless of how the camera position moves or how the tilt angle changes, the system no longer automatically determines whether to exit the 2D planar rendering mode; the orthographic projection is forcibly maintained, preventing accidental switching back to 3D perspective rendering mode due to unintentional camera touches. This design eliminates the need for users to repeatedly manually adjust the projection method when performing detailed operations such as pipeline layout annotation and floor plan editing. The working view remains consistent throughout, significantly improving the operational continuity and efficiency of 2D tasks, while reducing the risk of misoperation due to accidental view switching.
[0020] 2) Secondly, the present invention also provides a three-dimensional spatial infinite scaling and multi-view cooperative navigation system, the specific technical solution of which is as follows: The acquisition module is used to acquire the target point and the scaling increment of the distance between the target point and the camera; The determination module is used to determine the camera's scaling factor by using the target point as the anchor point and along the camera's current line of sight, combining the natural exponential function and the scaling increment. The rendering module is used to adjust the current position of the camera proportionally according to the scaling factor, and to dynamically adjust the camera's field of view and near and far clipping planes synchronously according to the adjusted current position of the camera, and then perform rendering. The response module is used to respond to viewpoint switching commands, generate the camera position and orientation that transition continuously from the current pose to the target pose based on the current pose of the camera including the current position and the target pose preset based on the target viewpoint mode, and perform rendering.
[0021] 3) In a third aspect, the present invention also provides an electronic device, the electronic device including a processor coupled to a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor, so as to enable the electronic device to implement any of the above-mentioned three-dimensional space infinite scaling and multi-view cooperative navigation methods.
[0022] 4) In a fourth aspect, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the above-mentioned three-dimensional spatial infinite scaling and multi-view cooperative navigation methods.
[0023] It should be noted that the beneficial effects of the technical solutions of the second to fourth aspects of the present invention and their corresponding possible implementations can be found in the above description of the technical effects of the first aspect and its corresponding possible implementations, and will not be repeated here. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments of the present invention will be briefly introduced below: Figure 1 This is a flowchart illustrating a three-dimensional spatial infinite scaling and multi-view cooperative navigation method according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the structure of a three-dimensional spatial infinite scaling and multi-view cooperative navigation system according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0025] The principles and features of the present invention are described below. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.
[0026] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are 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 described again in some embodiments. The embodiments of the present invention will now be described with reference to the accompanying drawings.
[0027] like Figure 1 As shown, an embodiment of the present invention provides a three-dimensional spatial infinite scaling and multi-view cooperative navigation method, which includes the following steps: S1. Obtain the target point and the scaling increment of the distance between the target point and the camera; A target point is a vector uniquely defined by its X, Y, and Z coordinates in a 3D coordinate system. It represents the spatial center around which the user intends to zoom in or out. All scaling calculations use this point as an invariant anchor, ensuring its projected position on the screen remains constant during scaling, thus locking the user's visual focus. For example, the target point is acquired by listening for user interactions with the graphical user interface (GUI). The GUI captures user pointer actions, such as hovering the pointer over a 3D object and performing a pinch-to-zoom gesture, clicking a button, or scrolling the wheel. The system records the pointer's two-dimensional coordinates in the screen coordinate system. Then, the system emits a virtual ray from the camera position, passing through this pointer coordinate point on the screen, into the 3D scene. The direction of this virtual ray is determined by both the camera's projection parameters and the screen coordinates. The system calculates the first intersection point of this ray with the geometric surfaces of all interactive 3D objects in the scene. The 3D coordinates of this intersection point are then determined as the target point. If the ray does not intersect any object, the system will calculate the intersection point of the ray with a preset reference plane (such as the ground plane or a virtual plane that passes through the center of the scene and is perpendicular to the camera's line of sight) and use that intersection point as the target point.
[0028] After determining the target point, the scaling increment of the distance between the target point and the camera is obtained; that is, a raw input value representing the user's desired scaling change is acquired. In implementation, the system listens for continuous events generated by the user's input device. For example, it listens for mouse wheel rotation events or two-finger pinch gesture events on the touchscreen. Whenever the user scrolls the mouse wheel by one unit or moves two fingers one millimeter on the touchscreen, the input device driver generates an event with a raw increment value, which the system captures. If the user zooms in, the scaling increment is positive; if the user zooms out, the scaling increment is negative. This scaling increment only represents the direction and relative intensity of the user input and does not contain any information related to scene scale or camera position.
[0029] In this context, the camera is a virtual entity representing the user's viewing perspective in a 3D virtual scene. It defines the position and orientation from which the scene is rendered. The camera's position is a 3D spatial vector, while its orientation is described by a facing direction or a quaternion. In the graphics rendering pipeline, the world coordinates of all 3D objects need to be transformed to 2D coordinates on the screen using the camera's view matrix and projection matrix.
[0030] S2. Using the target point as the anchor point, determine the camera's scaling factor along the camera's current line of sight by combining the natural exponential function and the scaling increment. This determination includes: substituting the product of the scaling increment and the sensitivity factor into the natural exponential function as a variable, and then calculating the scaling factor using the natural exponential function. The specific implementation process of S2 is as follows: S20. Before calculating the scaling factor, two geometric reference elements need to be defined: ① The anchor point is the acquired target point, a vector uniquely determined by the X, Y, and Z axis coordinates in a three-dimensional coordinate system. During scaling, the anchor point remains fixed, and all scaling transformations use this point as the spatial reference center. ② The camera's current line of sight is a unit vector pointing from the camera position to the target point or along the camera's own orientation. Based on the camera's current orientation quaternion or view matrix, the camera's forward axis vector is extracted; this vector represents the camera's current line of sight. The anchor point provides a clear spatial focus for the scaling operation, while the camera's current line of sight determines the trajectory of the camera position adjustment, ensuring that the camera position moves only along this straight line without lateral offset.
[0031] S21. Based on the zoom increment and sensitivity factor obtained from the user input event, determine the camera's zoom factor. The zoom increment is a signed floating-point scalar; a positive value represents zooming in, and a negative value represents zooming out. The sensitivity factor is a constant floating-point number preset based on user experience, used to control the sensitivity of zoom operations to user input. The system multiplies the zoom increment and the sensitivity factor to obtain a new value. Let the zoom increment be a sign... Sensitivity factor is a symbol Then this product value is expressed as . The value of can be any real number, and the sign determines the scaling direction; The sensitivity factor is typically a constant between 0.1 and 0.5. A larger sensitivity factor value results in a greater change in the scaling factor for the same scaling increment, leading to a more sensitive scaling response; a smaller sensitivity factor value results in a smoother scaling response. The product value remains a signed floating-point number. When the product is positive, the product is positive. When the value is negative, the product is negative. This product value will be used as the input to the natural exponential function.
[0032] Anchor points are spatial points that remain unchanged during 3D scaling operations. In this operation, the anchor point is the target point that has already been acquired. The purpose of the anchor point is to serve as a fixed reference center when calculating the scaling factor and subsequently adjusting the camera position, ensuring that the projected position of the 3D spatial area of interest to the user does not shift on the screen during scaling, thus achieving a smooth scaling effect centered on the target point. The camera's current line of sight is a unit vector pointing directly in front of the camera from its position. This vector describes the camera's orientation in 3D space. In perspective projection, the camera's current line of sight usually coincides with the camera's forward axis. In this invention, adjusting the camera position along the camera's current line of sight means that the scaling transformation trajectory of the camera position is constrained to this straight line, thereby ensuring that the visual center does not shift laterally during scaling operations.
[0033] S22, the product value As input variables to the natural exponential function. The natural exponential function is... ,in It is the base of the natural logarithm. Substituting the variables, we get the expression... This expression means using as the base, with The natural exponential function is a power operation. It is continuous, smooth, and monotonically increasing. In this invention, the natural exponential function is used to map a linearly changing input (the product of the scaling increment and the sensitivity factor) to an exponentially changing scaling factor, thereby achieving a smooth and continuous scaling effect from centimeter-level to kilometer-level over a wide range of scales.
[0034] S23, to The scaling factor is calculated by evaluating the scaling factor. Let the scaling factor be denoted by the symbol . The complete calculation formula is: ,in, Representing the scaling factor, it is a positive floating-point number. When When it is the right time, , indicates a magnification operation; when When it is negative, , indicates a zoom-out operation; when When equal to 0, This indicates no scaling. The scaling factor is calculated using the natural exponential function. As the input variable changes continuously, there are no discrete jumps. Scaling factor This will be used to proportionally adjust the current position of the camera, specifically by multiplying the distance from the camera position to the anchor point by... This enables smooth, stepless scaling, ensuring the continuity and mathematical accuracy of the scaling process and avoiding the jumpiness and graphic distortion caused by traditional pixel-based or discrete-level scaling.
[0035] S3. Adjust the camera's current position proportionally according to the scaling factor, and dynamically adjust the camera's field of view and near / far clipping planes synchronously based on the adjusted current position, and then perform rendering. The process of adjusting the camera's current position proportionally according to the scaling factor and dynamically adjusting the camera's field of view and near / far clipping planes synchronously based on the adjusted current position includes: keeping the camera's current line of sight unchanged, multiplying the distance from the camera's original position to the anchor point by the scaling factor to obtain the adjusted current position of the camera; and synchronously recalculating the camera's focal length and near / far clipping planes based on the distance from the camera's current position to the anchor point, so that the near / far clipping planes continuously change with the camera's current distance. The specific implementation process of S3 is as follows: S30. During the zoom operation, first lock the camera's current viewing direction. The camera's current viewing direction is a unit vector, denoted as... This represents the direction from the camera's position to directly in front of the camera. The system stores the current value of this vector in memory and ensures that the camera's movement trajectory strictly follows this direction when adjusting the camera position later. The process proceeds along the straight line. Specifically, when calculating the new camera position, only the camera position along the line is changed. The distance component in the direction, without changing the camera position in relation to... Projected coordinates on a vertical plane. This operation ensures that the user's visual center does not drift laterally during zooming, and all zoom transformations are performed along the direction of the line of sight.
[0036] S31. Let the camera position before adjustment be a vector. Anchor point is a vector Calculate the vector pointing from the anchor point to the camera position before adjustment, i.e. Then calculate the magnitude of this vector to obtain the distance from the camera position to the anchor point before adjustment, denoted as... The calculation formula is: ,in, This represents the Euclidean norm, which is the length of a three-dimensional vector. `` is a non-negative floating-point scalar representing the linear distance between the camera and the anchor point in space before the scaling operation. The camera position is the coordinate of the camera in a three-dimensional coordinate system, represented by a three-dimensional vector. This indicates that it includes three components: the X-axis, Y-axis, and Z-axis. The camera position determines from which point in space the 3D scene is observed.
[0037] S32. Adjust the distance from the camera position to the anchor point before adjustment. Multiply by scaling factor This yields a new distance value, denoted as The calculation formula is: ,because , It is also a non-negative floating-point number. hour, The camera position will be far from the anchor point; when hour, The camera position will be close to the anchor point; when hour, The camera position remains unchanged.
[0038] S33, System Known Anchor Points Camera position before adjustment and scaling factor First, calculate the vector pointing from the anchor point to the camera position before adjustment. The magnitude of this vector is the distance from the camera position to the anchor point before adjustment. . Vector Multiply by scaling factor , to obtain a new vector The magnitude of the new vector is , direction and The direction from the anchor point to the camera remains the same. Finally, the adjusted current camera position is: This calculation process is equivalent to keeping the camera's current line of sight unchanged, because the direction from the camera to the anchor point is the same as... The direction is opposite, and and Since they are in the same direction, the direction of their line of sight has not changed.
[0039] S34. The adjusted distance from the current camera position to the anchor point is... The modulus, that is .because Its mold length This distance value is used to recalculate the camera's focal length and near / far clipping planes. The system directly uses the already calculated value. That's all.
[0040] S35. The camera's focal length is a parameter that affects the field of view in perspective projection. In perspective projection, there is a corresponding relationship between focal length and viewing angle (field of view). The system adjusts the distance from the current camera position to the anchor point based on this distance. This allows for dynamic adjustment of the camera's focal length. Specifically, the system presets a base focal length. and a reference distance When the distance between the camera and the anchor point equals the reference distance, the focal length is taken as the reference value. As the distance changes, the focal length is adjusted inversely to maintain the target object at a suitable visual size on the screen. The calculation formula is: ,in, It is the new focal length after recalculation. It is the preset reference focal length value. It is a preset baseline distance value. This is the adjusted distance from the current camera position to the anchor point. Using this formula, when the camera approaches the anchor point ( When the focal length increases (becomes smaller), the field of view decreases, creating a magnifying effect; when the camera moves away from the anchor point ( As the focal length increases, the field of view increases, creating a shrinking effect. The continuous change in focal length ensures a natural transition of perspective relationships during scaling.
[0041] S36. The near and far clipping planes are two planes used in perspective projection to define the rendering range of a scene. The near clipping plane has the smallest vertical distance to the camera, and the far clipping plane has the largest vertical distance. The camera position is located inside the near clipping plane. Only 3D objects located between these two planes are fed into the rendering pipeline for rendering. Objects outside this range are clipped to improve rendering efficiency. The distance from the current camera position to the anchor point is adjusted accordingly. This dynamically adjusts the near and far clipping plane distances, ensuring these two clipping planes continuously change with the camera's current distance, thus preventing incorrect cropping of objects due to distance variations. The specific implementation is as follows: Let the distance to the near clipping plane (the vertical distance between the near clipping plane and the camera) be... The distance to the far clipping plane (the vertical distance between the far clipping plane and the camera) is The system presets a basic proportion for the near-cutting plane. A basic proportion of a far-field cut .generally Choose a very small positive number, such as 0.1. Choose a large number, such as 1000. Then, adjust the distance from the current camera position to the anchor point. Calculate the actual near and far cutting plane distance: , ,in, It is the distance of the recently cut surface. This refers to the near and far clipping plane distance. Through this linear scaling, the near and far clipping planes always maintain a proportional relationship with the distance from the camera to the anchor point. When the camera approaches the anchor point, the overall clipping area shrinks to prevent nearby objects from being cut off by the near clipping plane; when the camera moves away from the anchor point, the overall clipping area expands to ensure that distant objects are not clipped by the far clipping plane. This dynamic adjustment ensures that the target scene can be rendered completely and accurately at any scaling level.
[0042] S37. After adjusting the camera position, recalculating the focal length, and dynamically adjusting the near and far clipping planes, the system performs rendering operations using the updated camera parameters. Rendering refers to the process of converting information such as geometry, textures, and lighting in a 3D scene into a 2D image using computer graphics algorithms and outputting it to the screen. The system will then adjust the current camera position. The camera's current line of sight New focal length Distance of recently cut surfaces Distance between the cutting surface and the new source These parameters are passed to the graphics rendering pipeline. The pipeline uses these parameters to construct the view matrix and projection matrix, performing coordinate transformations, lighting calculations, rasterization, and other processing on all objects in the scene, ultimately generating a single frame of image displayed on the screen. Because the camera position and clipping plane change continuously, each rendered frame exhibits a smooth, continuous scaling effect without any jerking or graphic distortion.
[0043] S4. In response to the viewpoint switching command, based on the camera's current pose (including the current position) and the target pose preset based on the target viewpoint mode, generate the camera's position and orientation continuously transitioning from the current pose to the target pose, and perform rendering. Specifically, generating the camera's position and orientation continuously transitioning from the current pose to the target pose, based on the camera's current pose (including the current position) and the target pose preset based on the target viewpoint mode, includes: using spherical linear interpolation, based on the initial quaternion and target quaternion determined by the current pose and target pose respectively, to generate the camera's position and orientation transitioning from the current pose to the target pose. The specific implementation process of S4 is as follows: S40. Continuously monitor user interaction events. When a user triggers a viewpoint switching operation through the graphical user interface, for example, clicking a button labeled "Switch to First-Person View" or pressing a preset hotkey on the keyboard, the system generates a viewpoint switching command. The viewpoint switching command is an internal event signal triggered by user interaction, used to notify the system that the current camera viewpoint needs to be changed from the existing mode to another preset mode. This command carries the type information of the target viewpoint mode, such as bird's-eye view mode or first-person mode. Based on this command, the system initiates a smooth transition process for the camera pose.
[0044] S41. Upon receiving the viewpoint switching command, first read the camera's complete state at the current moment, i.e., its current pose. The current pose consists of two parts: the camera's current position and its current orientation. The camera's current position is a three-dimensional spatial vector, denoted as... The camera's current orientation is represented by a quaternion, denoted as . Quaternions are a mathematical representation of rotations in three-dimensional space, avoiding gimbal lock and supporting smooth interpolation. Simultaneously, the system obtains the target pose from a preset configuration based on the target view mode in the view switching command. The target pose also includes the target position. and target towards quaternions For example, the target pose preset for bird's-eye view mode is: the camera position is located at a certain height directly above the center of the scene, facing vertically downwards; the target pose preset for first-person view mode is: the camera position is located at a preset viewpoint in the scene (e.g., at the height of a person's eyes), facing horizontally forwards. The system reads these preset values from memory or configuration files.
[0045] In this context, pose is a collective term for position and orientation. Position describes the camera's coordinates in a 3D coordinate system, while orientation describes the camera's rotation direction in 3D space. Together, they define the camera's complete state in space. In this invention, pose is represented by a pair of data: a 3D position vector and a rotation quaternion. The target pose refers to the final position and orientation the camera should achieve after the viewpoint switch. It is determined by the target viewpoint mode selected by the user and represents the final state of the transition animation.
[0046] S42. For camera position transitions, the system directly uses the position vector from the current pose. Use the position vector in the target pose as the starting position. As the target position. For camera orientation transitions, the system needs to extract the corresponding quaternions from the current pose and the target pose. The orientation in the current pose is already represented as a quaternion. We directly use this as the starting quaternion. The orientation in the target pose is already represented as a quaternion. The target quaternion is directly used as the target quaternion. If the target pose is stored in Euler angles, the system will first convert the Euler angles into a quaternion representation. Both the initial quaternion and the target quaternion need to be normalized to ensure that they are unit quaternions describing pure rotations.
[0047] S43. Spherical linear interpolation is a method for smooth interpolation between unit quaternions, denoted as S43. The system performs both position and orientation interpolation simultaneously, but uses different interpolation methods: linear interpolation for position and spherical linear interpolation for orientation. To ensure a synchronized and smooth transition between position and orientation, the system uses the same interpolation parameter. This allows for simultaneous control of the interpolation progress for both position and orientation. Interpolation parameters. A linear change from 0 to 1 Corresponding to the starting point, The corresponding endpoint. The entire transition process is completed within a preset time length, such as 800 milliseconds. The system calculates the current frame based on the elapsed time during each frame rendering. value: Here, the current time is a high-precision timestamp read by the system at the start of each frame, the start time is the timestamp recorded when the view switching command is triggered, and the total transition duration is a preset constant (e.g., 0.8 seconds). At that time, Truncate to 1 and end the transition.
[0048] For camera position transitions, the interpolation position for each frame is calculated using a linear interpolation formula. : ,in, When the interpolation parameter is The current position vector of the camera at that time. hour, ;when hour, .
[0049] For the transition of camera orientation, the interpolation quaternion for each frame is calculated using the spherical linear interpolation formula. : ,in, It is the initial quaternion and target quaternion The angle between them, through The calculation here is that the dot product is the inner product of quaternions (the sum of the products of their corresponding components). yes The sine value. This formula ensures that the quaternion remains on the unit sphere during interpolation, thus generating a smooth rotational transition effect. When and When the values are very close, the system degenerates into linear interpolation and is renormalized to avoid division by zero.
[0050] In each frame, the interpolation position is calculated simultaneously using the method described above. and interpolation toward quaternions And set the camera's current position to The current orientation is set to This generates a sequence of camera positions and orientations that transition continuously from the current pose to the target pose.
[0051] S44. After updating the camera position and orientation in each frame, perform the rendering operation. The system uses the interpolated position calculated in the current frame. and interpolation toward quaternions Construct the view matrix. Specifically, use quaternions. Convert to a rotation matrix, then combine with the position vector. The system calculates the camera's view matrix. Then, it multiplies the view matrix by the projection matrix, performs coordinate transformations and rasterization on all objects in the scene, and finally displays a single frame. Because the camera pose changes continuously with each frame, the user sees a smooth animation effect from the original viewpoint to the target viewpoint, without any jumps or abrupt changes. The system continuously repeats this process until... When the position reaches 1, the camera pose is completely equal to the target pose, and the viewpoint switching process ends.
[0052] Optionally, the above technical solution further includes: when the camera's position and / or orientation changes, before rendering, detecting the camera's current height and tilt angle; if the camera's current height is greater than a preset height threshold and the absolute value of the sum of the tilt angle and 90° is less than a preset tilt angle threshold, then switching the projection method from perspective projection to orthographic projection to enter a two-dimensional planar rendering mode; if the camera's current height is not greater than a preset height threshold or the absolute value of the sum of the tilt angle and 90° is not less than a preset tilt angle threshold, then restoring the projection method to perspective projection to enter a three-dimensional perspective rendering mode. The specific implementation process is as follows: S101. At the beginning of each frame's rendering loop, first determine whether the camera's position vector or orientation quaternion has changed compared to the previous frame. The system stores the camera position vector from the previous frame in memory. The camera orientation quaternion in the previous frame The camera position vector of the current frame. and Component-by-component comparison, aligning the camera orientation of the current frame to the quaternion. and Component-by-component comparison. If the absolute value of the difference between each component of the two position vectors is less than a very small threshold (e.g., ...), then... If the absolute value of the difference between each component of the two orientation quaternions is less than the minimum threshold, then it is determined that the camera's position and orientation have not changed, and rendering is performed directly using the projection method of the previous frame. If at least one of the position or orientation has changed beyond the threshold, then the 2D or 3D rendering mode is determined.
[0053] S102, from the camera position vector of the current frame Extract the vertical component. In a standard 3D coordinate system, set the positive Y-axis direction as vertically upward. Then, the camera's current height is denoted as... The calculation formula is: ,in, It is a vertically upward unit vector, extracted by dot product operation. The Y-axis component. Therefore . It is a floating-point number, with units consistent with the world units in the scene. The calculated value... The value is stored in a temporary variable; S103, From the camera in the current frame towards the quaternion Calculate the camera's forward vector . angle of depression (Unit: degrees) is calculated using the following formula: At this time, when the camera's line of sight is horizontal... , When the camera's line of sight is vertically downward , (Right now When the camera's line of sight is vertically upward. , (Right now Convert radians to degrees: ,in It is the constant of pi, after conversion This is the camera's current downward angle, measured in degrees.
[0054] S104, Set the camera's current tilt angle and Perform addition, then calculate the absolute value of the sum. Calculate the intermediate value. : ,in, This indicates the absolute value operation. For example, when the camera is pointing vertically downwards... ,but When the camera is horizontal ,but When the camera is vertically upward ,but .
[0055] S105. Based on the camera's current height and current tilt angle, make a judgment according to preset conditions: If the camera's current height... Greater than the preset height threshold And the camera's current tilt angle and The absolute value of the sum Less than the preset tilt angle threshold If the condition is met, then it is determined that the condition for entering the 2D plane rendering mode is satisfied, i.e., the judgment expression is: If both conditions are true, the system executes step S106; otherwise, the system executes step S107. Here, a preset height threshold is used. It is a floating-point number, for example, 5.0m. Preset tilt angle threshold. It is a floating-point number, with the unit being degrees, for example, a value of 80°. These two thresholds can be adjusted according to different application scenarios, and the system stores them in a read-only memory area.
[0056] S106. Check the current projection mode. If the current projection mode is already orthographic projection, no switching is needed; if the current projection mode is perspective projection, the system performs a projection mode switching operation. The specific implementation of switching the projection mode is: modifying the parameters in the camera's projection matrix generation function. Perspective projection uses parameters such as the field of view angle, near clipping plane distance, and far clipping plane distance to generate a perspective projection matrix. Orthographic projection uses six boundary parameters (left, right, bottom, top, near, and far) to generate an orthographic projection matrix. The system calculates the boundary values of the orthographic projection based on the current viewport size and scene extent. Typically, the boundary of the orthographic projection is set as a rectangular area centered at the intersection of the camera's line of sight and the scene, with a width and height equal to a certain constant. After switching, the system sets the projection mode flag to orthographic projection. Subsequently, the system enters the 2D planar rendering mode. In the 2D planar rendering mode, the rendering pipeline hides the Z-axis depth information and only renders the geometry on the current floor or work plane, presenting a view effect similar to a planar map.
[0057] S107, When the camera's current height Not greater than a preset height threshold, or the camera's current tilt angle. and The absolute value of the sum Not less than the preset tilt angle threshold If the condition is met, the system determines that it is ready to enter the 3D perspective rendering mode, i.e., perspective projection. The current projection method is checked. If the current projection method is already perspective projection, no action is needed; if the current projection method is orthographic projection, the system performs a switching operation, restoring the projection method to perspective projection. The restoration is implemented by regenerating the perspective projection matrix using the parameters of perspective projection (field angle, near clipping plane distance, far clipping plane distance, etc.) and updating the camera's projection matrix. Simultaneously, the projection method flag is set to perspective projection. Subsequently, the system enters the 3D perspective rendering mode. In 3D perspective rendering mode, the scene is presented with normal stereoscopic perspective effects; all geometric information in three dimensions is fully rendered, allowing the user to experience a sense of spatial depth.
[0058] S108. After switching the projection mode or confirming that the current projection mode is maintained, the system performs rendering operations using the current camera's view matrix and projection matrix. Rendering refers to the process of generating a 2D image from the geometry, texture, lighting, and other data of a 3D scene through the graphics rendering pipeline and outputting it to the screen. Based on the current projection mode (perspective projection or orthographic projection) and the camera's position and orientation, the system constructs the correct view projection combination matrix, performs coordinate transformation, rasterization, pixel shading, and other processing on all objects in the scene, and finally generates a frame of image displayed on the screen. Because the switching of the projection mode occurs before rendering, each frame of rendering uses the latest determined projection mode, thus achieving the effect of real-time adjustment of the 2D planar mode and the 3D perspective mode according to the camera pose.
[0059] Optionally, the above technical solution further includes: during the transition from the current pose to the target pose, in response to an interrupt command, stopping spherical linear interpolation, and maintaining the camera's position and orientation in the parameter state at the time the interrupt command was received. The specific implementation process is as follows: S201. During a viewpoint switch, a transition state is entered. This state is triggered by the viewpoint switch command, and the system begins spherical linear interpolation according to a preset total transition duration (e.g., 800ms), continuously changing the camera's position and orientation. The system internally maintains a Boolean flag, denoted as "Transition in Progress." This flag is set to true when the viewpoint switch has started and is not yet complete or interrupted. The system checks this flag in each frame's update loop. Only when this flag is true will the system perform spherical linear interpolation calculations and continuously update the camera's position and orientation. The interruption mechanism in this step is only effective during this transition. If the transition is already complete (i.e., the interpolation parameter t has reached 1), or no viewpoint switch has started, the interruption command has no effect.
[0060] S202. Throughout the transition, continuously monitor user interaction events or internal messages to detect the presence of interruption commands. Interruption commands can be generated by various user actions, such as the user clicking the view-switching button again during the view-switching animation, pressing the cancel key or movement key on the keyboard, or performing camera operations such as zooming or rotating. The system defines any user action that can interrupt the current transition as an interruption command. In specific implementation, the system sets an interrupt trigger in the input event handling function. When a predefined trigger operation is detected, the system generates an interruption command object. This command object may not contain additional data and only serves as a signal. At the beginning of each frame, the system checks whether an interruption command has been received.
[0061] The interrupt command is an internal event signal generated by user interaction, used to instruct the system to immediately stop the ongoing view transition animation. The interrupt command can be triggered at any point during the transition from the current pose to the target pose. Typical user actions that trigger the interrupt command include clicking other view buttons, pressing movement control keys, performing zoom operations, or rotating the camera. The purpose of the interrupt command is to interrupt the continuous updates of spherical linear interpolation, returning camera control to the user.
[0062] S203. Upon receiving an interrupt command during the transition, the spherical linear interpolation calculation process is immediately stopped. Specifically, the system sets the internally maintained "transition in progress" flag to false and clears the timing variables and interpolation parameters related to the transition. The system no longer calculates new interpolation parameters t based on past time, nor does it call the spherical linear interpolation function to generate new camera positions and orientations. Simultaneously, the system stops updating the start time and current time difference used for the transition. Any subsequent interpolation frames that have not yet been completed will be canceled. Stopping spherical linear interpolation means the viewpoint switching animation is permanently terminated and will not automatically resume.
[0063] S204. Upon receiving an interrupt command, the camera's position and orientation must be fixed at that instant. The implementation is as follows: Before rendering each frame, the system calculates the camera's position and orientation for that frame. When the interrupt command arrives, the system reads the camera's current parameter values—the current camera position vector and the current camera orientation quaternion—in the interrupt handler function. These parameter values are values that have been updated in the camera object after interpolation calculations in the previous or current frame. The system saves these two values to the camera state variables without performing any additional transformations. Subsequently, the system stops updating the camera's position and orientation. In all subsequent frames, the system continues to use this saved camera position and orientation for rendering, without performing any spherical linear interpolation operations. In other words, the camera will be permanently fixed at the viewpoint at the time of the interruption until the user initiates a new camera operation, such as manual rotation, zoom, or another viewpoint switch.
[0064] In this context, parameter state refers to the set of position vectors and orientation quaternions of the camera at a specific moment. In this operation, parameter state specifically refers to the current position and orientation values of the camera at the instant the system receives the interrupt command. Parameter state is a static snapshot used to fix the camera at that viewpoint, preventing it from changing further with the planned transition animation.
[0065] S205. After stopping spherical linear interpolation and maintaining the camera's position and orientation at the time of the interruption, the system immediately performs the rendering operation. Rendering refers to the process of generating a 2D image and outputting it to the screen using the graphics rendering pipeline based on the current camera position and orientation, as well as data such as geometry, textures, and lighting in the scene. At this time, the camera no longer moves, and the rendered image will remain the view at the moment of the interruption. In each subsequent frame, as long as there are no new user operations that change the camera state, the system will repeatedly render using the same camera position and orientation, keeping the image static. After the interruption, the user can continue to freely manipulate the camera, such as zooming or rotating from the currently held viewpoint, without jumping back to the unfinished transition trajectory.
[0066] Optionally, the above technical solution also includes: after entering the two-dimensional plane rendering mode, in response to the mode lock command, pausing the detection of the camera's current height and tilt angle, and locking the projection method to orthographic projection, as detailed below: S301. When the system executes the automatic projection mode switching logic, it continuously monitors the camera's height and tilt angle. When the camera's height is greater than a preset height threshold and the absolute value of the sum of the tilt angle and 90° is less than a preset tilt angle threshold, the system automatically switches the projection mode from perspective projection to orthographic projection, thus entering the 2D planar rendering mode. The system maintains a status flag, denoted as "2D planar rendering mode activated." When the above conditions are met and the projection mode is actually switched to orthographic projection, the system sets this flag to true. The mode lock command in this step can only be responded to when the 2D planar rendering mode is already activated. If the system is not currently in 2D planar rendering mode, for example, if the camera is in 3D perspective rendering mode, no mode lock command will take effect, or the system can choose to ignore the command.
[0067] S302. After entering the 2D planar rendering mode, continuously listen for user interaction events to detect the presence of a mode lock command. Mode lock commands are typically triggered by the user through specific controls on the graphical user interface, such as clicking a button labeled "Lock Planar View," or using a preset keyboard shortcut, such as pressing the L key. When the user performs these actions, the system generates a mode lock command object. This command can be a simple internal message without additional parameters. During the user input processing phase of each frame, the system checks whether a mode lock command has been received. To ensure that commands are not missed, the system temporarily stores commands in a command queue and processes them at the appropriate time.
[0068] The mode lock command is an internal event signal generated by user interaction. It notifies the system to fix the current 2D planar rendering mode and prevent it from automatically exiting the mode based on changes in camera height and tilt. Typical triggers for the mode lock command include clicking the lock button on the user interface or pressing a preset keyboard shortcut. This command pauses the system's automatic mode determination logic, allowing users to stably perform planar operations under orthographic projection and preventing accidental switching back to 3D perspective mode due to unintentional camera movement.
[0069] S303. Upon receiving a mode lock command, immediately suspend the automatic detection function of camera height and tilt angle. The specific implementation is as follows: The system internally maintains a Boolean lock flag, denoted as "mode lock". When unlocked, this flag is false. Before rendering each frame, the system reads the latest camera height and tilt angle and compares them with a preset threshold to determine whether to switch the projection mode. When the system receives a mode lock command, it sets the "mode lock" flag to true. In each subsequent frame, before executing the projection mode determination logic, the system first checks this flag. If the flag is true, the system directly skips a series of steps, such as obtaining the current camera height, calculating the current camera tilt angle, and comparing it with the threshold. In other words, the system no longer reads the camera's height value, no longer calculates the camera's tilt angle value, and does not change the projection mode based on changes in these values. The camera's automatic mode determination is completely suspended, but the camera itself can still respond to the user's manual movement or rotation operations; however, these operations will not trigger automatic projection switching.
[0070] S304. While pausing height and tilt detection, the system needs to lock the projection mode to orthographic projection. Locking means the system's projection mode will not change due to any automatic conditions. The specific implementation is as follows: When the "mode lock" flag is set to true, the system forces the projection mode to orthographic projection, and subsequent automatic recovery logic from orthographic to perspective projection is not executed. Even if the camera height becomes very low (e.g., below a preset height threshold) or the tilt angle becomes unsuitable for the planar view (e.g., becomes nearly horizontal), the system prohibits switching the projection mode back to perspective projection. To ensure the locking effect, the system can add a check to the projection mode setting function: if the "mode lock" flag is true, any call attempting to set the projection mode to perspective projection will be ignored or return failure. In this way, orthographic projection is firmly locked until the user actively unlocks it.
[0071] S305. After entering the locked state, the system will remain in this state until it receives a unlock command from the user. The unlock command is typically triggered again by the same interface control or shortcut key (e.g., clicking the lock button again or pressing the L key again). When the system receives the unlock command, it sets the "mode lock" flag to false and resumes automatic detection of camera height and tilt angle. Simultaneously, the system no longer forcibly locks orthographic projection but immediately re-evaluates based on the current camera height and tilt angle values: if the conditions for entering 2D planar rendering mode are still met, orthographic projection continues; otherwise, it automatically switches back to perspective projection. In this way, the system returns to the normal automatic mode recognition and switching process.
[0072] It's important to note that while the projection mode is locked in orthographic projection, users can still freely move the camera, change its orientation, zoom, or trigger perspective switching commands. These actions will not break the lock. For example, after locking orthographic projection, a user can pan the camera to different positions in the scene or change its tilt angle, but the rendered image will always remain in orthographic projection and will not automatically revert to perspective projection. Only when the user actively unlocks the system will it reassess the camera's height and tilt angle, and may automatically revert to perspective projection. This design allows users to obtain a stable and predictable view experience in scenes requiring precise planar manipulation.
[0073] Compared with the prior art, the technical effects of the present invention include: 1) In existing technologies, scaling operations rely on adjusting the camera's scaling factor or field of view, which has nonlinear limitations. Large-scale scaling easily leads to texture stretching, jagged edges, or loss of precision. This invention employs a pure vector-driven scaling mechanism. Using the target point as an anchor point, along the camera's current line of sight, the product of the scaling increment and the sensitivity factor is used as a variable in a natural exponential function to calculate the scaling factor. This scaling factor is a continuous positive floating-point number. By proportionally adjusting the distance from the camera position to the anchor point and simultaneously dynamically adjusting the camera's field of view and near / far clipping planes, the scaling process is independent of any pixel interpolation or discrete level switching. Therefore, users can smoothly zoom from viewing a 1-centimeter screw to an entire 5-kilometer-scale park, with sharp edges, clear textures, and no level jumps or visual distortion throughout the process. This achieves distortion-free continuous scaling from centimeter to kilometer levels, spanning five orders of magnitude.
[0074] 2) In existing technologies, bird's-eye view and first-person view are usually independent functions. Switching requires resetting the camera state, causing an interruption in the user's spatial positioning. This invention uses spherical linear interpolation to generate a camera position and orientation that transitions continuously from the current pose to the target pose, based on the initial quaternion and target quaternion determined by the current pose and target pose, respectively. The switching process is completed within 800 milliseconds and supports interruption at any time while maintaining the parameter state at the time of interruption. Users can plan a path in the bird's-eye view and then smoothly switch to the first-person view with one click for on-site verification. The spatial positioning remains continuous during the switching process, preventing disorientation. Based on internal A / B testing data, the average task completion time is reduced by 42%, achieving zero cognitive gaps in multi-view switching and a significant improvement in operational efficiency.
[0075] 3) Existing technologies require manual switching between 2D and 3D views, lacking context awareness. This invention automatically detects the camera's current height and tilt angle before rendering begins, should the camera position or orientation change. When the camera height exceeds a preset height threshold and the tilt angle is nearly vertical, the projection method is switched from perspective projection to orthographic projection, entering 2D planar rendering mode; otherwise, it reverts to perspective projection, entering 3D perspective rendering mode. In Building Information Modeling (BIM) maintenance scenarios, the system can automatically switch between viewing 2D planar views of pipeline layouts and 3D stereoscopic views of equipment installations, reducing manual mode switching operations by over 70% and decreasing the error rate by 55%. It is particularly suitable for tasks requiring frequent switching between 2D and 3D views, such as fire inspections and facility management, achieving intelligent collaboration between 2D and 3D modes and significantly improving usability in specialized scenarios.
[0076] In the above embodiments, although the steps are numbered S1, S2, etc., they are only specific embodiments given by the present invention. Those skilled in the art can adjust the execution order of S1, S2, etc. according to the actual situation. The scheme after adjusting the order is also within the protection scope of the present invention. It can be understood that in some embodiments, some or all of the above embodiments may be included.
[0077] like Figure 2 As shown, an embodiment of the present invention provides a three-dimensional spatial infinite scaling and multi-view cooperative navigation system 200, comprising: The acquisition module 201 is used to acquire the target point and the scaling increment of the distance between the target point and the camera; The determination module 202 is used to determine the camera's scaling factor by taking the target point as the anchor point and following the camera's current line of sight, combining the natural exponential function and the scaling increment. The rendering module 203 is used to adjust the current position of the camera proportionally according to the scaling factor, and to dynamically adjust the field of view and near and far clipping planes of the camera in sync with the adjusted current position of the camera, and then perform rendering. The response module 204 is used to respond to the view switching command, generate the position and orientation of the camera that transitions continuously from the current pose to the target pose based on the current pose of the camera including the current position and the target pose preset based on the target view mode, and perform rendering.
[0078] Optionally, in the above technical solution, the rendering adjustment module 203 is specifically used to: keep the current viewing direction of the camera unchanged, multiply the distance from the camera position to the anchor point before adjustment by a scaling factor to obtain the current position of the camera after adjustment; and synchronously recalculate the focal length and near and far clipping planes of the camera based on the distance from the current position of the camera to the anchor point, so that the near and far clipping planes change continuously with the change of the current distance of the camera.
[0079] Optionally, in the above technical solution, the determining module is specifically used to: substitute the product of the scaling increment and the sensitivity factor as a variable into the natural exponential function, and calculate the scaling factor through the natural exponential function.
[0080] Optionally, the above technical solution also includes a detection and determination module, which is used to: detect the current height and tilt angle of the camera before rendering when the position and / or orientation of the camera changes; if the current height of the camera is greater than a preset height threshold and the absolute value of the sum of the tilt angle and 90° is less than a preset tilt angle threshold, then switch the projection mode from perspective projection to orthographic projection to enter the two-dimensional plane rendering mode; if the current height of the camera is not greater than the preset height threshold or the absolute value of the sum of the tilt angle and 90° is not less than the preset tilt angle threshold, then restore the projection mode to perspective projection to enter the three-dimensional perspective rendering mode.
[0081] Optionally, in the above technical solution, the response module 204 is specifically used to: generate the position and orientation of the camera transitioning from the current pose to the target pose by using spherical linear interpolation, based on the initial quaternion and the target quaternion determined by the current pose and the target pose, respectively.
[0082] Optionally, in the above technical solution, the response module is further configured to: during the transition from the current pose to the target pose, in response to the interrupt command, stop spherical linear interpolation, and maintain the camera's position and orientation in the parameter state at the time the interrupt command was received.
[0083] Optionally, the above technical solution also includes a third response module, which is used to: after entering the two-dimensional plane rendering mode, in response to the mode lock command, pause the detection of the current height and tilt angle of the camera, and lock the projection method to orthographic projection.
[0084] It should be noted that the beneficial effects of the three-dimensional spatial infinite scaling and multi-view cooperative navigation system 200 provided in the above embodiments are the same as those of the three-dimensional spatial infinite scaling and multi-view cooperative navigation method described above, and will not be repeated here. Furthermore, the system provided in the above embodiments is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the system can be divided into different functional modules according to the actual situation to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, and will not be repeated here.
[0085] The three-dimensional spatial infinite scaling and multi-view cooperative navigation system of the present invention can be a computer program (including program code) running on a computer device. For example, the three-dimensional spatial infinite scaling and multi-view cooperative navigation system of the present invention is an application software that can be used to execute the corresponding steps in the three-dimensional spatial infinite scaling and multi-view cooperative navigation method of the present invention.
[0086] In some embodiments, the three-dimensional spatial infinite scaling and multi-view cooperative navigation system of the present invention can be implemented in a combination of hardware and software. As an example, the three-dimensional spatial infinite scaling and multi-view cooperative navigation system of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the three-dimensional spatial infinite scaling and multi-view cooperative navigation method of the present invention. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0087] The modules described in the embodiments of this invention can be implemented in software or hardware. The names of the modules are not, in some cases, limiting the scope of the module itself.
[0088] An electronic device according to an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any of the above-mentioned three-dimensional spatial infinite scaling and multi-view cooperative navigation methods. That is, an electronic device according to an embodiment of the present invention may include, but is not limited to: a processor and a memory; the memory is used to store the computer program; the processor is used to execute the three-dimensional spatial infinite scaling and multi-view cooperative navigation method shown in any embodiment of the present invention by calling the computer program.
[0089] In one alternative embodiment, an electronic device is provided, such as Figure 3 As shown, Figure 3The illustrated electronic device 4000 includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.
[0090] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this invention. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0091] Bus 4002 may include a path for transmitting information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 4002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The bus 4002 is represented by only one thick line, but this does not mean that there is only one bus or one type of bus.
[0092] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0093] The memory 4003 stores application code (computer program) for executing the present invention, and its execution is controlled by the processor 4001. The processor 4001 executes the application code stored in the memory 4003 to implement the content shown in the foregoing method embodiments.
[0094] Among them, electronic devices can also be terminal devices, which can be any device that can install applications, including at least one of smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, smart TVs, and smart in-vehicle devices.
[0095] It should be noted that, Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.
[0096] An embodiment of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the above-mentioned three-dimensional spatial infinite scaling and multi-view cooperative navigation methods.
[0097] Alternatively, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, a floppy disk, and an optical data storage device, etc.
[0098] In an exemplary embodiment, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform any of the above-described three-dimensional spatial infinite scaling and multi-view cooperative navigation methods.
[0099] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0100] It should be understood that the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0101] The computer-readable storage medium provided in this invention can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EEPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0102] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the method shown in the above embodiments.
[0103] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.
[0104] It should be noted that the terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and represent a limitation on a specific order or sequence. Where appropriate, the order of use for similar objects can be interchanged so that the embodiments of this application described herein can be implemented in an order other than that shown or described.
[0105] Those skilled in the art will recognize that this invention can be implemented as a system, method, or computer program product. Therefore, this invention can be specifically implemented in the following forms: it can be entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, this invention can also be implemented as a computer program product contained in one or more computer-readable media, which includes computer-readable program code.
[0106] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for three-dimensional spatial infinite scaling and multi-view cooperative navigation, characterized in that, include: Obtain the target point and the scaling increment of the distance between the target point and the camera; Using the target point as the anchor point, along the current line of sight of the camera, the scaling factor of the camera is determined by combining the natural exponential function with the scaling increment. The camera's current position is adjusted proportionally according to the scaling factor, and the camera's field of view and near / far clipping plane are dynamically adjusted synchronously according to the adjusted current position of the camera, and rendering is performed. In response to a viewpoint switching command, based on the current pose of the camera including its current position and the target pose preset based on the target viewpoint mode, the camera position and orientation that transition continuously from the current pose to the target pose are generated, and rendering is performed.
2. The three-dimensional spatial infinite scaling and multi-view cooperative navigation method according to claim 1, characterized in that, The step of proportionally adjusting the camera's current position according to the scaling factor, and synchronously and dynamically adjusting the camera's field of view and near-far clipping plane according to the adjusted current position, includes: keeping the camera's current line of sight unchanged, multiplying the distance from the camera's position before adjustment to the anchor point by the scaling factor to obtain the adjusted current position of the camera; and synchronously recalculating the camera's focal length and the near-far clipping plane according to the distance from the camera's current position to the anchor point, so that the near-far clipping plane changes continuously with the change of the camera's current distance.
3. The three-dimensional spatial infinite scaling and multi-view cooperative navigation method according to claim 2, characterized in that, Determining the camera's scaling factor by combining the natural exponential function with the scaling increment includes: substituting the product of the scaling increment and the sensitivity factor into the natural exponential function as a variable, and calculating the scaling factor through the natural exponential function.
4. The three-dimensional spatial infinite scaling and multi-view cooperative navigation method according to claim 1, characterized in that, Also includes: When the camera's position and / or orientation changes, detect the camera's current height and tilt angle before rendering; If the current height of the camera is greater than the preset height threshold and the absolute value of the sum of the depression angle and 90° is less than the preset depression angle threshold, the projection method will be switched from perspective projection to orthographic projection to enter the two-dimensional plane rendering mode. If the current height of the camera is not greater than the preset height threshold or the absolute value of the sum of the tilt angle and 90° is not less than the preset tilt angle threshold, the projection mode will be restored to perspective projection to enter the three-dimensional perspective rendering mode.
5. The three-dimensional spatial infinite scaling and multi-view cooperative navigation method according to claim 1, characterized in that, The step of generating a continuous camera position and orientation transitioning from the current pose to the target pose based on the current pose of the camera containing the current position and the target pose preset based on the target view mode includes: using spherical linear interpolation, based on the initial quaternion and the target quaternion determined by the current pose and the target pose respectively, to generate the camera position and orientation transitioning from the current pose to the target pose.
6. The three-dimensional spatial infinite scaling and multi-view cooperative navigation method according to claim 5, characterized in that, Also includes: During the transition from the current pose to the target pose, in response to an interrupt command, spherical linear interpolation is stopped, and the camera's position and orientation are maintained in the parameter state at the time the interrupt command was received.
7. The three-dimensional spatial infinite scaling and multi-view cooperative navigation method according to claim 4, characterized in that, Also includes: Upon entering the two-dimensional plane rendering mode, in response to the mode lock command, the detection of the camera's current height and tilt angle is paused, and the projection method is locked to orthographic projection.
8. A three-dimensional spatial infinite scaling and multi-view cooperative navigation system, characterized in that, include: The acquisition module is used to acquire the target point and the scaling increment of the distance between the target point and the camera; The determination module is used to determine the camera's scaling factor by taking the target point as the anchor point and along the camera's current line of sight, combining the natural exponential function with the scaling increment. The rendering module is used to adjust the current position of the camera proportionally according to the scaling factor, and to dynamically adjust the field of view and near and far clipping planes of the camera in sync with the adjusted current position of the camera, and then perform rendering. The response module is used to respond to the viewpoint switching command, generate the position and orientation of the camera in a continuous transition from the current pose to the target pose based on the current pose of the camera including the current position and the target pose preset based on the target viewpoint mode, and perform rendering.
9. An electronic device, characterized in that, The system includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements a three-dimensional spatial infinite scaling and multi-view cooperative navigation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements a three-dimensional spatial infinite scaling and multi-view cooperative navigation method as described in any one of claims 1 to 7.