Control method, system, device, storage medium and cloud platform for three-dimensional view
Patent Information
- Application Number
- CN202210830408.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-15
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2042-07-15
AI Technical Summary
[0005]鉴于上述的分析,本发明实施例旨在提供一种三维视图的控制方法、系统、设备、存储介质及云平台,用以解决现有三维视图控制按键冲突、操作次数多且控制不精细的问题
[0028] 1. By using custom controls to control the rotation, translation, and scaling of the 3D view, the potential key conflicts and complex control logic caused by the combination of mouse and button are avoided.
Smart Images

Figure CN115359229B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of model visualization technology, and in particular to a method, system, device, storage medium, and cloud platform for controlling three-dimensional views. Background Technology
[0002] In model design software, rotating, translating, and scaling the 3D view of a solid model are basic interactive operations.
[0003] The 3D view of a 3D model is usually controlled by using a mouse and keyboard. For example, you can use the Ctrl key, Shift key, and other keyboard shortcuts, as well as the left, middle, and right mouse buttons to activate view control. You can also control movement and rotation by moving the mouse left and right or drawing circles.
[0004] The existing control method sometimes conflicts with shortcut keys in other software, requiring replacement with more complex key combinations. Due to screen width limitations, multiple mouse movements are often necessary to achieve the desired distance and angle. Furthermore, as the mouse position changes, the direction is constantly adjusted, and without rigorous logical judgment, the rotation center often drifts, sometimes even causing the 3D model to fly out of the view area. When a mouse is unavailable, touch control becomes even more inconvenient, preventing the 3D view from displaying the user's expected effect. Summary of the Invention
[0005] Based on the above analysis, the embodiments of the present invention aim to provide a control method, system, device, storage medium, and cloud platform for three-dimensional views, in order to solve the problems of conflicting control buttons, numerous operation times, and imprecise control in existing three-dimensional view control systems.
[0006] On one hand, embodiments of the present invention provide a method for controlling a three-dimensional view, comprising the following steps:
[0007] Based on the received control activation command, display the control in the 3D view area. The control includes rotation sub-controls and translation sub-controls.
[0008] Get the click location of the click event. When the click location is within the range of any child control, set the current state to the state corresponding to the clicked child control and start a timer. Check the current state according to the timer period. If the current state is the state corresponding to any child control, adjust the virtual camera position and refresh the 3D view according to the coordinate offset of the mouse position relative to the center of the clicked child control within the detection period. Otherwise, stop the timer.
[0009] A further improvement to the above method involves displaying a control in a 3D view area, including: obtaining the range of the 3D view area based on the screen coordinate system; calculating the coordinates of the upper left corner of the control based on the height and / or width of the control, as well as the preset horizontal and vertical distances of the control relative to the 3D view area; and displaying the control in the 3D view area.
[0010] Based on the further improvement of the above method, the mouse position is acquired in real time in each detection cycle, and the coordinate offset includes the horizontal coordinate offset and the vertical coordinate offset relative to the center of the child control.
[0011] A further improvement to the above method involves adjusting the virtual camera position based on the coordinate offset between the mouse position and the center of the clicked sub-control, including:
[0012] When the clicked child control is a rotating child control, the coordinate offset is multiplied by the preset rotation adjustment coefficient to obtain the horizontal rotation amount and the vertical rotation amount respectively. The horizontal rotation amount is taken as the azimuth rotation angle of the virtual camera, and the vertical rotation amount is taken as the elevation rotation angle of the virtual camera, so that the virtual camera rotates around the camera focus as the rotation center according to the azimuth rotation angle and the elevation rotation angle.
[0013] When the clicked child control is a translation child control, the coordinate offset is multiplied by the preset translation adjustment coefficient to obtain the horizontal and vertical translation amounts respectively; the virtual camera position and camera focus are obtained and transformed to the screen coordinate system; the horizontal translation amount is subtracted from the X coordinate and the vertical translation amount is subtracted from the Y coordinate in the transformed virtual camera position and camera focus respectively; after transforming back to the world coordinate system, these are used as the translated virtual camera position and camera focus.
[0014] Based on a further improvement of the above method, the control also includes a scaling sub-control, which includes zoom in and zoom out buttons at both ends, as well as a slider and scroll bar between the zoom in and zoom out buttons; the scaling size of the virtual camera is adjusted according to the distance offset of the slider relative to the center of the scaling sub-control.
[0015] A further improvement to the above method involves adjusting the scaling of the virtual camera based on the distance offset of the slider relative to the center of the scaling sub-control, including:
[0016] By clicking the zoom in or zoom out buttons, or selecting and moving the slider, the distance offset of the slider relative to the center position of the zoom sub-control is obtained in real time. If the slider is located between the center position of the zoom sub-control and the zoom button, the distance offset is positive; otherwise, it is negative. The zoomed size of the virtual camera is obtained by adding the product of the distance offset and the preset zoom adjustment coefficient to the zoom reference.
[0017] Based on the above method, the control is implemented using QT components.
[0018] On the other hand, embodiments of the present invention provide a control system for a three-dimensional view, comprising:
[0019] The control navigation module is used to display controls in the 3D view area according to the received control activation command. The controls include rotation sub-controls and translation sub-controls.
[0020] The view control module is used to obtain the click position of the click event. When the click position is within the range of any child control, the current state is set to the state corresponding to the clicked child control, and a timer is started. The current state is checked according to the timer period. If the current state is the state corresponding to any child control, the virtual camera position is adjusted and the 3D view is refreshed according to the coordinate offset of the mouse position relative to the center of the clicked child control within the detection period. Otherwise, the timer is stopped.
[0021] This invention also provides a control device for a three-dimensional view, the device comprising:
[0022] Memory, used to store computer programs;
[0023] A processor is a step used to implement a control method for any three-dimensional view when executing a computer program.
[0024] This invention also provides a readable storage medium for storing a computer program that, when executed by a processor, implements the steps of a control method for any three-dimensional view.
[0025] This invention also provides a cloud platform for controlling a 3D view, in which a control system for the 3D view is embedded, providing customers with 3D view control services.
[0026] Furthermore, the cloud platform includes a client and a management terminal. The control system for the 3D view is embedded in the client, while the management terminal is used by administrators to perform backend management of the cloud platform.
[0027] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0028] 1. By using custom controls to control the rotation, translation, and scaling of the 3D view, the potential key conflicts and complex control logic caused by the combination of mouse and button are avoided.
[0029] 2. The desired position and angle can be achieved with a single operation. Even without a mouse, complex and accurate view operations can be performed, making it more convenient to use.
[0030] 3. As the mouse pointer moves, the direction and speed of rotation and movement are dynamically adjusted, and the scaling size is controlled. Through simple control methods and small changes, precise and convenient control is achieved.
[0031] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from what is particularly pointed out in the description and drawings. Attached Figure Description
[0032] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.
[0033] Figure 1 This is a flowchart of the three-dimensional view control method in Embodiment 1 of the present invention. Detailed Implementation
[0034] The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which constitute a part of the present invention and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.
[0035] Example 1
[0036] A specific embodiment of the present invention discloses a method for controlling a three-dimensional view, such as... Figure 1 As shown, it includes the following steps:
[0037] S11: Based on the received control start command, display the control in the 3D view area. The control includes rotation sub-control and translation sub-control.
[0038] It should be noted that the controls are implemented using a graphical interface toolkit. Preferably, the rotation and translation sub-controls are implemented using QLabel from the QT component.
[0039] The tool navigation bar or menu bar contains a start button for the control. When the user clicks the start button, a control start command is issued, and the control is displayed in the 3D view area.
[0040] Preferably, the control is initially set to not started. Clicking the start button starts the control and displays it in the 3D view area. At the same time, the control's start status is set to started. Clicking the start button again is equivalent to closing the control and hiding it in the 3D view area.
[0041] Displaying controls in a 3D view area includes: obtaining the extent of the 3D view area based on the screen coordinate system, calculating the coordinates of the upper left corner of the control based on the height and / or width of the control, and the preset horizontal and vertical distances of the control relative to the 3D view area, and displaying the control in the 3D view area.
[0042] It should be noted that the origin of the screen coordinate system is the upper left corner of the entire screen. The range of the three-dimensional view area is obtained according to the actual screen size. Preferably, the control is displayed in the upper right corner of the three-dimensional view area. Then, the coordinates (x, y) of the upper left corner of the control are calculated based on the width of the control and the initial preset horizontal and vertical distances of the control relative to the upper right corner of the three-dimensional view area, so that the control is displayed in the three-dimensional view area.
[0043] Preferably, when the control is selected and dragged with the right mouse button, the control's position is adjusted. When the mouse is not hovering over the control, the control's background is dynamically set to different levels of transparency, gradually changing the control from highlighted to semi-transparent. When the mouse hovers over the control, the control's background transparency is canceled, making the control highlighted again, thus enhancing user-friendliness.
[0044] S12: Get the click position of the click event. When the click position is within the range of any child control, set the current state to the state corresponding to the clicked child control and start a timer. Check the current state according to the timer period. If the current state is the state corresponding to any child control, then within the detection period, adjust the virtual camera position and refresh the 3D view according to the coordinate offset of the mouse position relative to the center of the clicked child control. Otherwise, stop the timer.
[0045] It should be noted that the virtual camera in this embodiment is equivalent to an observation point. The rotation and translation of the 3D model are achieved by obtaining the precise rotation angle, rotation center, translation direction, and translation amount to adjust the position of the virtual camera. The 3D view within the field of view of the virtual camera is then projected onto a 2D plane to display the rotated and translated view.
[0046] Specifically, each sub-control has a defined area. The corresponding sub-control function is activated only when the initial left mouse button click position is within the sub-control's area, and the current state is set to the state corresponding to the clicked sub-control, making it easier to identify the operation to be performed later. When the left mouse button is released, the current state returns to the initial state.
[0047] For example, when the child control clicked by the initial left mouse button is a rotation child control, the corresponding state is ROTATE; when the child control clicked by the initial left mouse button is a translation child control, the corresponding state is TRANSLATE; and when the initial left mouse button does not click any child control, or clicks and then releases the left mouse button, the corresponding state is NORMAL.
[0048] It is worth noting that in this embodiment, even without a mouse, fine-grained control can still be achieved through touch (such as a laptop pointing stick or touchpad). Therefore, the click operation here is not limited to using a mouse. The mouse position indicates the position of the mouse pointer when using different methods.
[0049] To achieve continuous rotation and translation, a timer is started to perform periodic checks at fixed time intervals, such as 100ms. The current state is checked according to the timer's cycle. If the current state is the state corresponding to any child control, it means that the click has not been released. Within the detection cycle, the coordinate offset of the mouse position relative to the center of the clicked child control is obtained according to the current control state. The virtual camera position is adjusted according to the coordinate offset, the 3D view is refreshed, and the child control function is realized. If the current state is not the state corresponding to any child control, it means that the click has been released, the timer is stopped, and the rotation or translation operation is stopped accordingly.
[0050] It should be noted that when the child control's function is activated, the mouse can be moved while the mouse is in a clicked state, allowing for rotation at different speeds and angles, or translation at different speeds and directions. Therefore, during timed detection, the mouse position is acquired in real time within each detection cycle, and the coordinate offset of the mouse position relative to the center of the clicked child control includes both horizontal and vertical coordinate offsets relative to the center of the child control.
[0051] For example, the obtained mouse position is (x s ,y s The center of the child control is (x) c ,y c If the horizontal coordinate offset dx = x, then the horizontal coordinate offset dx = x. s -x c Vertical coordinate offset dy = y s -y c .
[0052] This embodiment uses VTKCamera from VTK (visualization toolkit for 3D computer graphics, image processing and visualization) to implement virtual camera functionality.
[0053] ① When the clicked sub-control is a rotation sub-control, the coordinate offset is multiplied by the preset rotation adjustment coefficient to obtain the horizontal rotation amount and the vertical rotation amount respectively; the horizontal rotation amount is taken as the azimuth rotation angle of the virtual camera, and the vertical rotation amount is taken as the elevation rotation angle of the virtual camera, so that the virtual camera rotates around the camera focus as the rotation center according to the azimuth rotation angle and the elevation rotation angle.
[0054] It should be noted that in this embodiment, the camera focus is selected as the rotation center. The rotation center remains constant as the rotation angle and speed change, thus solving the problem of existing rotation center drift. The initial position of the camera focus is set to the center point of the 3D model, i.e., the world coordinates of the center point of the model's 3D bounding box, and will dynamically change with subsequent translation operations.
[0055] The coordinate offset is multiplied by a preset rotation adjustment coefficient to obtain the horizontal and vertical rotation values. The horizontal rotation value serves as the virtual camera's azimuth rotation angle, used to determine the rotation angle on the equatorial plane; a positive value indicates clockwise rotation, and a negative value indicates counterclockwise rotation. The vertical rotation value serves as the virtual camera's elevation rotation angle, used to determine the rotation angle on the meridian plane; a positive value indicates upward rotation, and a negative value indicates downward rotation. The horizontal and vertical rotation values together determine the direction of rotation.
[0056] For example, when the coordinate offset is constant at (0, 24), the timer performs a rotation every 100ms, which is equivalent to rotating 24 degrees on the meridian plane each time. The rotation speed is relatively fast. Therefore, in this embodiment, a rotation adjustment factor, such as 0.1, is multiplied. Then, by calling the Azimuth(0.1×dx) and Elevation(0.1×dy) methods, it is equivalent to rotating 2.4 degrees every 100ms, which effectively controls the rotation speed. Moreover, since this embodiment can achieve continuous rotation with small degrees per rotation, it is easier to achieve fine-grained control. Therefore, the horizontal and vertical rotation amounts, combined with the timer interval, jointly determine the rotation speed.
[0057] While clicking, the mouse pointer moves, and the horizontal and vertical coordinate offsets change dynamically with the movement of the mouse pointer. The virtual camera position is dynamically updated and the 3D view is refreshed through a timer, thereby achieving the purpose of adjusting the rotation speed and direction by moving the mouse pointer. Through simple control methods and small changes, precise and convenient control is achieved.
[0058] ② When the clicked child control is a translation child control, multiply the coordinate offset by the preset translation adjustment coefficient to obtain the horizontal and vertical translation amounts respectively; obtain the virtual camera position and camera focus and convert them to the screen coordinate system; subtract the horizontal translation amount from the X coordinate and the vertical translation amount from the Y coordinate in the converted virtual camera position and camera focus respectively; after converting back to the world coordinate system, use them as the translated virtual camera position and camera focus.
[0059] It should be noted that the translation adjustment factor, similar to the rotation adjustment factor, is used to control the distance of each translation. For example, it is set to 0.2.
[0060] The virtual camera position and focus are based on the world coordinate system, so they need to be converted to the screen coordinate system before processing the X and Y coordinates. When the mouse position is to the left of the center of the translation sub-control, it means that the control model is translated to the left. However, the virtual camera position relative to the model needs to be translated to the right. Therefore, the X coordinate of the converted virtual camera position and focus needs to be reduced by the horizontal movement, the Y coordinate needs to be reduced by the vertical movement, and the Z coordinate remains unchanged. After that, it is converted back to the world coordinate system and used as the translated virtual camera position and focus.
[0061] For example, when the coordinate offset is (-24,0) and remains unchanged, it is equivalent to controlling the model to shift to the left. The timer performs a translation every 100ms. SetPosition(double position[3]) is called to update the virtual camera position, and SetFocalPoint(double focalpoint[3]) is called to update the virtual camera's focal point. If the translation adjustment factor is not multiplied, the virtual camera position and the camera focal point will be translated 24 pixels to the right every 100ms, which will cause the 3D view to move too far in a very short time. When multiplied by the translation adjustment factor of 0.2, the virtual camera position and the camera focal point will be translated 4.8 pixels to the right each time, which is more convenient for fine control.
[0062] As the mouse pointer moves, the horizontal and vertical movement amounts change dynamically. By using a timer to periodically update the virtual camera position and camera focus, the movement speed and direction can be dynamically adjusted.
[0063] Preferably, the control control in this embodiment further includes a zoom sub-control, which includes zoom in and zoom out buttons at both ends, and a slider and scroll bar between the zoom in and zoom out buttons. Preferably, the zoom sub-control is implemented using QScrollBar from the QT component.
[0064] Adjust the virtual camera's zoom level based on the slider's offset relative to the center of the zoom sub-control, including:
[0065] By clicking the zoom in or zoom out buttons, or selecting and moving the slider, the distance offset of the slider relative to the center position of the zoom sub-control is obtained in real time. If the slider is located between the center position of the zoom sub-control and the zoom button, the distance offset is positive; otherwise, it is negative. The zoomed size of the virtual camera is obtained by adding the product of the distance offset and the preset zoom adjustment coefficient to the zoom reference.
[0066] It should be noted that each time the zoom-in or zoom-out button is clicked, the distance offset of the current slider relative to the center position of the zoom sub-control is increased or decreased by a preset interval distance to obtain the real-time distance offset, which is used for zoom size calculation.
[0067] Specifically, the scaling reference is generally 1. When the calculated scaling size is greater than 1, it is enlarged; when it is less than 1, it is reduced. The scaling adjustment factor is used to control the scaling speed.
[0068] Preferably, the scaling speed can be controlled within 10%, which yields better results. For example, when the scaling adjustment factor is 0.001 and the distance offset is 50, the scaling size is: 1 + 50 × 0.001 = 1.05. The 3D view can be magnified by calling the Zoom(1.05) method.
[0069] It's worth noting that the zoom sub-control is similar to the rotate and pan sub-controls in that its corresponding state is ZOOM. The zoom operation can also be combined with a timer. When the clicked sub-control is a zoom sub-control, the current state is set to ZOOM and a timer is started. When the slider is pressed and held, the distance offset dynamically changes as the slider moves. The timer periodically adjusts the zoom size, achieving continuous zooming.
[0070] Compared with existing technologies, the 3D view control method provided in this embodiment controls the rotation, translation, and scaling of the 3D view through custom controls, avoiding potential key conflicts and complex control logic caused by the combination of mouse and button. A single operation can achieve the desired position and angle, and complex and accurate view operations can be performed even without a mouse, making it more convenient to use. As the mouse pointer moves, the direction and speed of rotation and movement are dynamically adjusted to control the scaling size. Through simple control methods and small changes, precise and convenient control is achieved.
[0071] Example 2
[0072] Another embodiment of the present invention discloses a control system for a three-dimensional view, thereby implementing the control method in Embodiment 1. The specific implementation of each module is described in the corresponding description in Embodiment 1. The system includes:
[0073] The control navigation module is used to display controls in the 3D view area according to the received control activation command. The controls include rotation sub-controls and translation sub-controls.
[0074] The view control module is used to obtain the click position of the click event. When the click position is within the range of any child control, the current state is set to the state corresponding to the clicked child control, and a timer is started. The current state is checked according to the timer period. If the current state is the state corresponding to any child control, the virtual camera position is adjusted and the 3D view is refreshed according to the coordinate offset of the mouse position relative to the center of the clicked child control within the detection period. Otherwise, the timer is stopped.
[0075] Furthermore, the control navigation module also includes a zoom sub-control, which includes zoom in and zoom out buttons at both ends, as well as a slider and scroll bar between the zoom in and zoom out buttons; the zoom size of the virtual camera is adjusted according to the distance offset of the slider relative to the center of the zoom sub-control.
[0076] Since the control system for the three-dimensional view in this embodiment and the control method for the aforementioned three-dimensional view can be mutually referenced, and this is a repetition of the description, it will not be repeated here. Because this system embodiment shares the same principle as the above-described method embodiment, it also possesses the corresponding technical effects of the above-described method embodiment.
[0077] Example 3
[0078] Another embodiment of the present invention discloses a control device for a three-dimensional view, the device comprising:
[0079] Memory, used to store computer programs;
[0080] A processor is used to implement the steps of the control method for the three-dimensional view of Embodiment 1 when executing a computer program.
[0081] Example 4
[0082] Another embodiment of the present invention discloses a readable storage medium for storing a computer program that, when executed by a processor, implements the steps of the three-dimensional view control method of Embodiment 1.
[0083] Example 5
[0084] Another embodiment of the present invention discloses a control cloud platform for a three-dimensional view, which embeds the control system of the three-dimensional view in embodiment 2 to provide customers with control services for the three-dimensional view.
[0085] Specifically, the cloud platform in this embodiment includes a client and a management terminal. The control system for the three-dimensional view is embedded in the client, and the management terminal is used by administrators to perform backend management of the cloud platform.
[0086] The client includes a 3D view control unit and a data storage unit; wherein, the 3D view control unit is implemented by the 3D view control system in Embodiment 2, and the functions of the system module are encapsulated as services and deployed to the cloud platform to provide users with 3D view control services; the data storage module is used to store user information and the user's 3D model information.
[0087] After successful login, users can access the client and retrieve the uploaded 3D model information through the data storage module. The 3D view control unit then controls the display of the 3D view through rotation, translation, and scaling. Preferably, the cloud platform also includes a model design unit and a model defect repair unit. This 3D view control unit, in conjunction with other units, allows for a complete view of the 3D model and the repair of model defects under refined view control.
[0088] The management interface includes user management, rights management, 3D model management, and system parameter management, which are used by administrators to manage the backend of the cloud platform.
[0089] This cloud platform embodiment can implement the above-described method embodiments, and therefore also has the corresponding technical effects of the above-described method embodiments. Furthermore, this cloud platform embodiment embeds a three-dimensional view control system, which can provide users with three-dimensional view control services. Users only need to log in to the cloud platform to obtain the services, meeting their usage needs.
[0090] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.
[0091] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for controlling a three-dimensional view, characterized in that, Includes the following steps: Based on the received control activation command, the control is displayed in the 3D view area, the control including rotation sub-control and translation sub-control; Get the click location of the click event. When the click location is within the range of any child control, set the current state to the state corresponding to the clicked child control and start a timer. Check the current state according to the timer period. If the current state is the state corresponding to any child control, adjust the virtual camera position and refresh the 3D view according to the coordinate offset of the mouse position relative to the center of the clicked child control within the detection period. Otherwise, stop the timer. The mouse position is acquired in real time during each detection cycle, and the coordinate offset includes the horizontal coordinate offset and the vertical coordinate offset relative to the center of the sub-control. The step of adjusting the virtual camera position based on the coordinate offset of the mouse position relative to the center of the clicked sub-control includes: when the clicked sub-control is a rotating sub-control, multiplying the coordinate offset by a preset rotation adjustment coefficient to obtain the horizontal rotation amount and the vertical rotation amount respectively. The horizontal rotation amount is taken as the azimuth rotation angle of the virtual camera, and the vertical rotation amount is taken as the elevation rotation angle of the virtual camera. The virtual camera rotates around the camera focus as the rotation center according to the azimuth rotation angle and the elevation rotation angle. When the clicked sub-control is a translation sub-control, the coordinate offset is multiplied by the preset translation adjustment coefficient to obtain the horizontal movement amount and the vertical movement amount, respectively. The virtual camera position and camera focus are obtained and transformed to the screen coordinate system. The horizontal movement amount is subtracted from the X coordinate and the vertical movement amount is subtracted from the Y coordinate of the transformed virtual camera position and camera focus, respectively. After transforming back to the world coordinate system, it is used as the translated virtual camera position and camera focus.
2. The method for controlling a three-dimensional view according to claim 1, characterized in that, The step of displaying the control in the three-dimensional view area includes: obtaining the range of the three-dimensional view area based on the screen coordinate system, calculating the coordinates of the upper left corner of the control according to the height and / or width of the control and the preset horizontal and vertical distances of the control relative to the three-dimensional view area, and displaying the control in the three-dimensional view area.
3. The method for controlling a three-dimensional view according to claim 1, characterized in that, The control also includes a zoom sub-control, which includes zoom in and zoom out buttons at both ends, and a slider and scroll bar between the zoom in and zoom out buttons; the zoom size of the virtual camera is adjusted according to the distance offset of the slider relative to the center of the zoom sub-control.
4. The method for controlling a three-dimensional view according to claim 3, characterized in that, The step of adjusting the scaling size of the virtual camera based on the distance offset of the slider relative to the center of the scaling sub-control includes: By clicking the zoom in or zoom out buttons, or selecting and moving the slider, the distance offset of the slider relative to the center position of the zoom sub-control is obtained in real time. If the slider is located between the center position of the zoom sub-control and the zoom button, the distance offset is positive; otherwise, it is negative. The zoomed size of the virtual camera is obtained by adding the product of the distance offset and the preset zoom adjustment coefficient to the zoom reference.
5. The method for controlling a three-dimensional view according to claim 1 or 3, characterized in that, The control is implemented using QT components.
6. A control system for a three-dimensional view, characterized in that, include: The control navigation module is used to display controls in the three-dimensional view area according to the received control activation command, the controls including rotation sub-controls and translation sub-controls; The view control module is used to obtain the click position of the click event. When the click position is within the range of any sub-control, the current state is set to the state corresponding to the clicked sub-control, and a timer is started. The current state is checked according to the timer period. If the current state is the state corresponding to any sub-control, the virtual camera position is adjusted and the 3D view is refreshed according to the coordinate offset of the mouse position relative to the center of the clicked sub-control within the detection period. Otherwise, the timer is stopped. The mouse position is acquired in real time during each detection cycle, and the coordinate offset includes the horizontal coordinate offset and the vertical coordinate offset relative to the center of the sub-control. The step of adjusting the virtual camera position based on the coordinate offset of the mouse position relative to the center of the clicked sub-control includes: when the clicked sub-control is a rotating sub-control, multiplying the coordinate offset by a preset rotation adjustment coefficient to obtain the horizontal rotation amount and the vertical rotation amount respectively. The horizontal rotation amount is taken as the azimuth rotation angle of the virtual camera, and the vertical rotation amount is taken as the elevation rotation angle of the virtual camera. The virtual camera rotates around the camera focus as the rotation center according to the azimuth rotation angle and the elevation rotation angle. When the clicked sub-control is a translation sub-control, the coordinate offset is multiplied by the preset translation adjustment coefficient to obtain the horizontal movement amount and the vertical movement amount, respectively. The virtual camera position and camera focus are obtained and transformed to the screen coordinate system. The horizontal movement amount is subtracted from the X coordinate and the vertical movement amount is subtracted from the Y coordinate of the transformed virtual camera position and camera focus, respectively. After transforming back to the world coordinate system, it is used as the translated virtual camera position and camera focus.
7. A control device for a three-dimensional view, characterized in that, The device includes: Memory, used to store computer programs; A processor for executing a computer program to implement the steps of the control method for a three-dimensional view as described in any one of claims 1-5.
8. A readable storage medium, characterized in that, The storage medium is used to store a computer program, which, when executed by a processor, implements the steps of the three-dimensional view control method as described in any one of claims 1-5.
9. A control cloud platform for a three-dimensional view, characterized in that, The cloud platform embeds the control system for the three-dimensional view as described in claim 6, providing customers with control services for the three-dimensional view.
10. A control cloud platform for a three-dimensional view according to claim 9, characterized in that, The cloud platform includes a client and a management terminal. The control system for the 3D view is embedded in the client, and the management terminal is used by administrators to perform backend management of the cloud platform.
Citation Information
Patent Citations
Dual-system display method, notebook computer with assistant screen, and assistant display device
CN101515226A
Three-dimensional posture editing method and device, terminal and storage medium
CN112308988A